Skip to content

Commit 859946a

Browse files
Matthias Köppegrhkm21
andauthored
Improve wording (from code review)
Co-authored-by: grhkm21 <[email protected]>
1 parent e01bf4f commit 859946a

File tree

1 file changed

+5
-6
lines changed
  • src/doc/en/thematic_tutorials/numerical_sage

1 file changed

+5
-6
lines changed

src/doc/en/thematic_tutorials/numerical_sage/mpi4py.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ directory)
5050
mpirun -np 5 ./sage -python mpi_1.py
5151
5252
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
5454
script ``mpi_1.py``. The result should be 5 "hello worlds" plus 5 distinct ranks.
5555

5656
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``
7373
The same command as above with ``mpi_1.py`` replaced by ``mpi_2.py`` will
7474
produce 5 outputs and you will see each process creates an array and
7575
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
7777
processes. ``MPI.COMM_WORLD`` is the communication world.
7878

7979
There are some subtleties regarding MPI to be aware of. Small sends
@@ -112,7 +112,7 @@ of an array we pass.
112112

113113
A common idiom is to have one process, usually the one with rank 0,
114114
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
116116
computation should proceed. Consider the following code
117117

118118
.. CODE-BLOCK:: python
@@ -144,9 +144,8 @@ is just a ``receive``.
144144
There is a complementary ``gather`` command that collects results from
145145
all the processes into a list. The next example uses ``scatter`` and
146146
``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.
150149

151150
.. CODE-BLOCK:: python
152151

0 commit comments

Comments
 (0)