[mpich-discuss] MPI_Irecv does block

Robert Kubrick robertkubrick at gmail.com
Mon Aug 11 21:22:43 CDT 2008


I want to send a number of elements through MPI_Send. However the  
receiving process does not know the maximum number of elements in the  
array (it might be very large). The code will look something like:

MASTER:
char buf[500];
...
MPI_Send(&buf, 500, SomeDerivedType, 1, ...);

==============

WORKER:
char buf[100];
const int Master = 0;
MPI_Irecv(&buf, 100, SomeDerivedType, Master, ...);

I noticed that here the worker process blocks (despite the MPI_Irecv  
non-blocking call) because it doesn't have enough room in the buffer  
to receive all the elements. I know one way to solve the problem is  
to use MPI_Probe, but is this the expected behavior if the buffer is  
too small? Shouldn't MPI_Irecv return an error to avoid blocking?




More information about the mpich-discuss mailing list