Simple mpi4py example fails

时间:2016-10-19 13:38:34

标签: python parallel-processing mpi mpi4py

I have tried running the following code for sending and receiving python objects using mpi4py from http://mpi4py.readthedocs.io/en/stable/tutorial.html:

from mpi4py import MPI

comm = MPI.COMM_WORLD
rank = comm.Get_rank()

if rank == 0:
    data = {'a': 7, 'b': 3.14}
    comm.send(data, dest=1, tag=11)
elif rank == 1:
    data = comm.recv(source=0, tag=11)

but it produces the following error on rank one trying to receive:

  File "send.py", line 11, in <module>
    data = comm.recv(source=0, tag=11)
  File "MPI/Comm.pyx", line 1192, in mpi4py.MPI.Comm.recv (src/mpi4py.MPI.c:106889)
  File "MPI/msgpickle.pxi", line 264, in mpi4py.MPI.PyMPI_recv (src/mpi4py.MPI.c:42691)
mpi4py.MPI.Exception: MPI_ERR_INTERN: internal error

I'm using Python 3.4.2

Anyone know why this could be?

Thanks!

0 个答案:

没有答案