LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-04-15 19:28:55


On Apr 15, 2005, at 3:46 PM, Guanhua Yan wrote:

> A problem with MPI_Isend. After I post an MPI_Isend request to a
> receiving node, may I use MPI_Isend to post another one to the same
> node before it has been ensured that the receiver has received the
> previous message? In the parameters of MPI_Isend, I used different
> sending buffers. But it seems that the first message has not been
> received by the first one sometimes. I checked the MPI tutorial but
> still unclear about it.

MPI's message ordering guarantee is as follows:

Messages are guaranteed to be received in the order in which they are
sent when they have the same signature (same sender/receiver, same
communicator, same tag).

Hence, if you:

MPI_Isend(A, ..., 0, 123, comm, &req[0]);
MPI_Isend(B, ..., 0, 123, comm, &req[1]);
MPI_Waitall(...);

MPI guarantees that process 0 will first receive message A and then
receive message B. However, if you do the following:

MPI_Isend(A, ..., 0, 123, comm, &req[0]);
MPI_Isend(B, ..., 0, 456, comm, &req[1]);
MPI_Waitall(...);

(note that the tags are different) MPI does *not* guarantee the
delivery order.

In your problem above, ensure that you are using 2 different requests
(as in my examples above) and then you test or wait on both of them.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/