Minor in MPI notebooks

This commit is contained in:
Francesc Verdugo 2024-09-19 17:39:31 +02:00
parent aa694e7bde
commit da3885eeaf
4 changed files with 4711 additions and 1790 deletions

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 6.8 MiB

After

Width:  |  Height:  |  Size: 6.8 MiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 445 KiB

After

Width:  |  Height:  |  Size: 594 KiB

View File

@ -260,7 +260,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "ae6b88eb", "id": "7511de1b",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -505,7 +505,8 @@
"comm = MPI.COMM_WORLD\n", "comm = MPI.COMM_WORLD\n",
"nranks = MPI.Comm_size(comm)\n", "nranks = MPI.Comm_size(comm)\n",
"rank = MPI.Comm_rank(comm)\n", "rank = MPI.Comm_rank(comm)\n",
"println(\"Hello, I am process $rank of $nranks processes!\")\n", "host = MPI.Get_processor_name()\n",
"println(\"Hello from $host, I am process $rank of $nranks processes!\")\n",
"MPI.Finalize()\n", "MPI.Finalize()\n",
"\"\"\"\n", "\"\"\"\n",
"filename = tempname()*\".jl\"\n", "filename = tempname()*\".jl\"\n",
@ -565,7 +566,8 @@
" comm = MPI.COMM_WORLD\n", " comm = MPI.COMM_WORLD\n",
" nranks = MPI.Comm_size(comm)\n", " nranks = MPI.Comm_size(comm)\n",
" rank = MPI.Comm_rank(comm)\n", " rank = MPI.Comm_rank(comm)\n",
" println(\"Hello, I am process $rank of $nranks processes!\")\n", " host = MPI.Get_processor_name()\n",
" println(\"Hello from $host, I am process $rank of $nranks processes!\")\n",
" MPI.Finalize()\n", " MPI.Finalize()\n",
"end\n", "end\n",
"run(`$(mpiexec()) -np 4 julia --project=. -e $code`);" "run(`$(mpiexec()) -np 4 julia --project=. -e $code`);"

View File

@ -120,6 +120,16 @@
"In this example the ranks sleep for a random amount of time and then they call barrier. It is guaranteed that the message \"Done!\" will be printed after all processes printed \"I woke up\" since we used a barrier. Try also to comment out the call to `MPI.Barrier`. You will see that the message can be printed in any order." "In this example the ranks sleep for a random amount of time and then they call barrier. It is guaranteed that the message \"Done!\" will be printed after all processes printed \"I woke up\" since we used a barrier. Try also to comment out the call to `MPI.Barrier`. You will see that the message can be printed in any order."
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "c6e78389",
"metadata": {},
"outputs": [],
"source": [
"using MPI"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,