Skip to content

Commit b9e3ec8

Browse files
committed
Update docs
1 parent 698d7ce commit b9e3ec8

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

docs/Documentation.ipynb

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,32 @@
754754
"\n",
755755
"Now we do the same for runtime vs matrix size and number of processes.\n",
756756
"\n",
757-
"<!-- TODO: Add image -->\n",
758-
"<!-- ![Time profiling](images/plot_time.png) -->"
757+
"![Time profiling](images/plot_time.png)\n",
758+
"\n",
759+
"Based on this plot, we would be tempted to say that not only the execution time is much bigger that it is for `numpy` and `scipy`, but it might also seem that our method does not scale with respect to the number of processes.\n",
760+
"However, running a single time the file `shell/time_profile.sh`, we notice that this is likely a problem related to how `time.time()` saves the results.\n",
761+
"\n",
762+
"Running, for instance,\n",
763+
"```bash\n",
764+
"$ shell/time_profile.sh 1 1500 # 1 refers to n_procs, 1000 to the matrix size\n",
765+
"```\n",
766+
"we get the following results:\n",
767+
"```mermaid\n",
768+
"Some results\n",
769+
"```\n",
770+
"Re-running with `n_procs=2`, we obtain\n",
771+
"```mermaid\n",
772+
"Even more results\n",
773+
"```\n",
774+
"Finally, for `n_procs=4`, we obtain\n",
775+
"```mermaid\n",
776+
"Final results\n",
777+
"```\n",
778+
"The previous results suggest that the method scales well with the number of processes, and that the performance (while worse than `numpy` and `scipy`) is such that the comparison goes much better than it seemed to do earlier.\n",
779+
"We believe that the reason for such a behavior is related to the execution of multiple scripts, which can have an impact on execution times as measured with `time.time()`.\n",
780+
"\n",
781+
"Notice that we parallelized everything that could be parallelized (except for the secular solver, which usually takes no more than $5\\%$ of the total time): the bottleneck is given by the Lanczos method, which cannot be parallelized.\n",
782+
"If the Lanczos method is not needed (that is, if the matrix $A$ of which we want to compute the eigenvalues and eigenvectors is already tridiagonal), then the execution time of our solver becomes comparable to the one of `numpy` and `scipy`."
759783
]
760784
},
761785
{
@@ -817,6 +841,15 @@
817841
" ), \"Error. The eigenvalues were not computed correctly.\""
818842
]
819843
},
844+
{
845+
"cell_type": "markdown",
846+
"metadata": {},
847+
"source": [
848+
"# Final remarks\n",
849+
"We hope this file, along with the `README.md`, provides sufficient information to understand the work done in our project.\n",
850+
"If anything remains unclear, feel free to reach out: we’ll be happy to answer any questions you may have."
851+
]
852+
},
820853
{
821854
"cell_type": "markdown",
822855
"metadata": {

shell/time_profile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ sed -i "s/^dim: .*/dim: $2/" $CONFIG_FILE
1515
mv "${CONFIG_FOLDER}/config.bak" "${CONFIG_FILE}"
1616

1717
echo "Running with $1 process(es) with a matrix of size $2"
18-
mpirun -np "$1" python "$python_script"
18+
mpirun -np "$1" python "$python_script"

0 commit comments

Comments
 (0)