Skip to content

Commit ceb46d5

Browse files
committed
Updated recipe 5.11.
1 parent 2bfa1f6 commit ceb46d5

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

notebooks/chapter05_hpc/11_mpi.ipynb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"metadata": {
33
"name": "",
4-
"signature": "sha256:36700138892ccc6e580b3f5bf11affd6a83785f7665f1e211b823818f0f69653"
4+
"signature": "sha256:311eded5d086bea3ca60a085bf3d6026103c5df55ca5b0c1a3119615bbf8811e"
55
},
66
"nbformat": 3,
77
"nbformat_minor": 0,
@@ -28,15 +28,7 @@
2828
"cell_type": "markdown",
2929
"metadata": {},
3030
"source": [
31-
"To use MPI with IPython you need:\n",
32-
"\n",
33-
"* A standard MPI implementation such as [OpenMPI](http://www.open-mpi.org) or [MPICH](http://www.mpich.org).\n",
34-
"* The [mpi4py package](http://mpi4py.scipy.org).\n",
35-
"\n",
36-
"For example, here are the commands to install MPI for IPython on Ubuntu:\n",
37-
"\n",
38-
" > sudo apt-get install libcr-dev mpich2 mpich2-doc\n",
39-
" > sudo apt-get install python-mpi4py"
31+
"For this recipe, you need a MPI installation and the mpi4py package."
4032
]
4133
},
4234
{
@@ -67,7 +59,7 @@
6759
"cell_type": "markdown",
6860
"metadata": {},
6961
"source": [
70-
"3. Once the MPI profile has been created and configured, we can launch the engines in the IPython dashboard, by selecting the number of engines (e.g. one per processor) in the *Clusters* tab, *MPI* profile, and pressing *Start*. Alternatively, we can run in a terminal: `ipcluster start -n 2 --engines MPI --profile=mpi`."
62+
"3. Once the MPI profile has been created and configured, we can launch the engines with: `ipcluster start -n 4 --engines MPI --profile=mpi` in a terminal."
7163
]
7264
},
7365
{
@@ -146,7 +138,7 @@
146138
"%%px\n",
147139
"from mpi4py import MPI\n",
148140
"import numpy as np\n",
149-
"print MPI.COMM_WORLD.allreduce(np.sum(a), op=MPI.SUM)"
141+
"print(MPI.COMM_WORLD.allreduce(np.sum(a), op=MPI.SUM))"
150142
],
151143
"language": "python",
152144
"metadata": {},

0 commit comments

Comments
 (0)