Skip to content

Commit 6fc5990

Browse files
authored
Merge pull request #92 from qianglise/main
update text in parallel-computing.rst
2 parents 59075e0 + 4ecb82a commit 6fc5990

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

content/parallel-computing.rst

-22
Original file line numberDiff line numberDiff line change
@@ -367,28 +367,6 @@ Examples
367367
message = comm.recv(source=sender, tag=0)
368368
print(message)
369369
370-
.. tab:: isend/irecv
371-
372-
.. code-block:: python
373-
:emphasize-lines: 10,15
374-
375-
from mpi4py import MPI
376-
377-
comm = MPI.COMM_WORLD
378-
rank = comm.Get_rank()
379-
n_ranks = comm.Get_size()
380-
381-
if rank != 0:
382-
# All ranks other than 0 should send a message
383-
message = "Hello World, I'm rank {:d}".format(rank)
384-
req = comm.isend(message, dest=0, tag=0)
385-
req.wait()
386-
else:
387-
# Rank 0 will receive each message and print them
388-
for sender in range(1, n_ranks):
389-
req = comm.irecv(source=sender, tag=0)
390-
message = req.wait()
391-
print(message)
392370
.. tab:: broadcast
393371

394372
.. code-block:: python

0 commit comments

Comments
 (0)