Below is the code that works when a numpy array of smaller size (stored as Data) is communicated to the neighbour workers (defined by NbrList). For large array (eg N=50000), the send function gets stuck. Any idea how to solve it?
from mpi4py import MPI
import numpy as np
Comm = MPI.COMM_WORLD
N_Workers = Comm.Get_size()
Rank = Comm.Get_rank()
if not N_Workers == 2: raise Exception('Only 2 workers allowed')
NbrList = [1, 0]
N = int(5e4)
Data = np.random.rand(N)
Dest = NbrList[Rank]
print('Sending: ' + str(Rank) + '->' + str(Dest))
Comm.Send([Data, N, MPI.DOUBLE] , dest=Dest, tag=Rank)
print('Data Sent: ' + str(Rank) + '->' + str(Dest))
RecvData = np.empty(N, dtype=np.float)
Src = NbrList[Rank]
Comm.Recv([RecvData, N, MPI.DOUBLE], source=Src, tag=Src)
print('Data Recvd: ' + str(Rank) + '<-' + str(Src) + ': ' + str(len(RecvData)))
Output for N = 30000:
Sending: 0->1
Sending: 1->0
Data Sent: 1->0
Data Sent: 0->1
Data Recvd: 0<-1: 30000
Data Recvd: 1<-0: 30000
Output for N=50000:
Sending: 0->1
Sending: 1->0
--
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/de1be355-755f-4345-bb16-e257b431fb32o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/CAEcYPwAVwvrrqwq3R%2BQokRo-aRz0Et9c%3DRJ8MYgMGJ%3DC_vmMyw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/CAKDYFR7mF9d%3DLpDY0-KouveG_HSOnvWFpXZ96F%2Bb1G%3DzBhc%3D9Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/CAEcYPwBCkPFGKvb2mxmz6HwLvQRHYNxou7qCAL91GVp23sBUZg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/de1be355-755f-4345-bb16-e257b431fb32o%40googlegroups.com.
----Lisandro Dalcin
============
Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/CAEcYPwAVwvrrqwq3R%2BQokRo-aRz0Et9c%3DRJ8MYgMGJ%3DC_vmMyw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/CAKDYFR7mF9d%3DLpDY0-KouveG_HSOnvWFpXZ96F%2Bb1G%3DzBhc%3D9Q%40mail.gmail.com.
----Lisandro Dalcin
============
Research Scientist
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+unsubscribe@googlegroups.com.