@@ -50,7 +50,7 @@ directory)
50
50
mpirun -np 5 ./sage -python mpi_1.py
51
51
52
52
The command ``mpirun -np 5 `` starts 5 copies of a program under MPI. In
53
- this case we have 5 copies of Sage in pure Python mode run the
53
+ this case we have 5 copies of Sage in pure Python mode running the
54
54
script ``mpi_1.py ``. The result should be 5 "hello worlds" plus 5 distinct ranks.
55
55
56
56
The two most important MPI operations are sending and receiving.
@@ -73,7 +73,7 @@ Consider the following example which you should put in a script ``mpi_2.py``
73
73
The same command as above with ``mpi_1.py `` replaced by ``mpi_2.py `` will
74
74
produce 5 outputs and you will see each process creates an array and
75
75
then passes it to the next guy (where the last guy passes to the
76
- first.) Note that ``MPI.size `` is the total number of MPI
76
+ first. Note that ``MPI.size `` is the total number of MPI
77
77
processes. ``MPI.COMM_WORLD `` is the communication world.
78
78
79
79
There are some subtleties regarding MPI to be aware of. Small sends
@@ -112,7 +112,7 @@ of an array we pass.
112
112
113
113
A common idiom is to have one process, usually the one with rank 0,
114
114
act as a leader. That process sends data out to the other
115
- processes and processes the results and decides how further
115
+ processes, compute on the results, and decides how much further
116
116
computation should proceed. Consider the following code
117
117
118
118
.. CODE-BLOCK :: python
@@ -144,9 +144,8 @@ is just a ``receive``.
144
144
There is a complementary ``gather `` command that collects results from
145
145
all the processes into a list. The next example uses ``scatter `` and
146
146
``gather `` together. Now the root process scatters the rows of a
147
- matrix, each process then squares the elements of the row it gets.
148
- Then the rows are all gathered up again by the root process who
149
- collects them into a new matrix.
147
+ matrix. Each process squares the elements of the row it receives.
148
+ The root process then gathers the rows into a new matrix.
150
149
151
150
.. CODE-BLOCK :: python
152
151
0 commit comments