LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: hye_at_[hidden]
Date: 2004-10-17 11:01:44


Scenario:
There are 3 processors/parties: A B C involving. Their pseudocodes are shown as
following.
=================================================
A psuedocode:
...
//send message M1 to C with Isend
MPI_Isend(&M1, sizeof(M1), MPI_BYTE, C,
           M1TAG, MPI_COMM_WORLD, &request);
MPI_Wait(&request, &status);
... other computation and communication ....
//send message M2 to B with Isend
MPI_Isend(&M2, sizeof(M2), MPI_BYTE, B,
           M2TAG, MPI_COMM_WORLD, &request);
MPI_Wait(&request, &status);
... other computation and communication ....
=================================================
B psuedocode:
...
//receve message M2 from A
MPI_Recv(&M2, sizeof(M2), MPI_BYTE, A,
          M2TAG, MPI_COMM_WORLD, &status);
//forward M2 to C
MPI_Isend(&M2, sizeof(M2), MPI_BYTE, C,
           M2TAG, MPI_COMM_WORLD, &request);
MPI_Wait(&request, &status);
... other computation and communication ....
=================================================
C psuedocode:
...
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &rc,
      &status);
switch(status.MPI_TAG)
{
    case M1TAG:
      recvM1();break;
    case M2TAG:
      recvM2();break;
    ...cases for other messages....
}
...
=================================================
Question 1: is it possible that, in party C, M2 is received before M1?

Question 2: After MPI_Isend/MPI_Wait returns, where is the message?
Is the message in the receiving queue on the receiver side?

Question 3: How MPI_Iprobe select a message if MPI_ANY_SOURCE/MPI_ANY_TAG are
used?

Thank you
Hua

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/