From 1e6d713b82dd11db38062762770cca42a43ad699 Mon Sep 17 00:00:00 2001 From: Jussi Enkovaara Date: Mon, 25 May 2020 12:53:48 +0300 Subject: [PATCH] Fix bugs in snippets --- docs/mooc/parallel-programming/collectives-1-to-n.md | 4 ++-- docs/mooc/parallel-programming/collectives-n-to-1.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/mooc/parallel-programming/collectives-1-to-n.md b/docs/mooc/parallel-programming/collectives-1-to-n.md index 41912bf..650905c 100644 --- a/docs/mooc/parallel-programming/collectives-1-to-n.md +++ b/docs/mooc/parallel-programming/collectives-1-to-n.md @@ -67,10 +67,10 @@ rank = comm.Get_rank() if rank == 0: py_data = {'key1' : 0.0, 'key2' : 11} # Python object - data = np.arange(8) / 10. # numpy array + data = numpy.arange(8) / 10. # numpy array else: py_data = None - data = np.zeros(8) + data = numpy.zeros(8) new_data = comm.bcast(py_data, root=0) comm.Bcast(data, root=0) diff --git a/docs/mooc/parallel-programming/collectives-n-to-1.md b/docs/mooc/parallel-programming/collectives-n-to-1.md index f0838da..7d01bc7 100644 --- a/docs/mooc/parallel-programming/collectives-n-to-1.md +++ b/docs/mooc/parallel-programming/collectives-n-to-1.md @@ -63,7 +63,7 @@ received values: ~~~python from mpi4py import MPI -from numpy import arange, empty +from numpy import arange, zeros comm = MPI.COMM_WORLD rank = comm.Get_rank()