Hello Community,
I have a problem understanding the API for MPI_Irecv:
int MPI_Irecv(
void *buf,
int count,
MPI_Datatype datatype,
int source,
int tag,
MPI_Comm comm,
MPI_Request *request
);
Parameters
- buf
- [in] initial address of receive buffer (choice)
- count
- [in] number of elements in receive buffer (integer)
- datatype
- [in] datatype of each receive buffer element (handle)
- source
- [in] rank of source (integer)
- tag
- [in] message tag (integer)
- comm
- [in] communicator (handle)
- request
- [out] communication request (handle)
What exactly does "count" mean here?
Is it the number of elements that have been received *thus far* in the buffer?
Or is it the number of elements that are expected to be received, and hence MPI_Test will tell me that the receive is not complete untill "count" number of elements have not been received?
Here's the reason why I have a problem (and I think I may be completely stupid here, I'd appreciate your patience):
I have node 1 transmit data to node 2, in a pack of 80 bytes:
Mon Aug 20 11:09:04 2012[1,1]<stdout>: Finished transmitting 80 bytes to 2 node with Tag 1000On the receiving end:
MPI_Irecv( (void*)this->receivebuffer,/* the receive buffer */ this->receive_packetsize, /* 80 */ MPI_BYTE, /* The data type expected */ this->transmittingnode, /* The node from which to receive */ this->uniquetag, /* Tag */ MPI_COMM_WORLD, /* Communicator */ &Irecv_request /* request handle */ );I see that node 1 tells me that the transmit was successful using the MPI_Test:
MPI_Test(&Isend_request, &SendComplete, &ISend_status);which returns me "true" on Node 1 (sender).
However, I am never able to receive the payload on Node 2:
Mon Aug 20
11:09:04
2012[1,2]<stdout>:Attemting to receive payload from node 1 with tag 1000, receivepacketsize: 80I am using MPI_Issend to send payload between node 1 and node 2.
Does anyone see what could be going wrong?
Thanks a lot
Devendra