Sending and receiving structured array data in MPI4Py using NumPy

I am trying to send and receive data in MPI4Py using a structured array from NumPy. The following is the structure of the array:

numpy.zeros(FILE_LINES, dtype='i4,54b')

and I use the Sendrecv method to exchange data as follows:

comm.Sendrecv(data_send, dest=partner_rank, sendtag=data_tag, \
        recvbuf=data_receive, source=partner_rank, recvtag=data_tag, status=None)

But I get an exception when the communication method is called:

Traceback (most recent call last):
  File "bipy.py", line 91, in <module>
  bitonic_sort()
File "bipy.py", line 72, in bitonic_sort
  bitonic_merge(i, ixj, (i & k) == 0)
File "bipy.py", line 51, in bitonic_merge
  recvbuf=data_receive, source=partner_rank, recvtag=data_tag, status=None)
File "Comm.pyx", line 166, in mpi4py.MPI.Comm.Sendrecv (src/mpi4py.MPI.c:58898)
File "message.pxi", line 318, in mpi4py.MPI.message_p2p_send (src/mpi4py.MPI.c:21422)
File "message.pxi", line 301, in mpi4py.MPI._p_msg_p2p.for_send (src/mpi4py.MPI.c:21285)
File "message.pxi", line 111, in mpi4py.MPI.message_simple (src/mpi4py.MPI.c:19256)
File "message.pxi", line 58, in mpi4py.MPI.message_basic (src/mpi4py.MPI.c:18509)
KeyError: 'T{=l:f0:(54)b:f1:}'

It works when using an array with one data type (for example, all bytes). MPI4Py cannot send these structured arrays, or am I doing something wrong?

+5
source share
1 answer

: (, Sendrecv()) " ", , API C. , , . , Sendrecv().

MPI4Py http://mpi4py.scipy.org/docs/usrman/mpi4py.html.

+3

All Articles