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: 2004-06-27 13:45:22


On Fri, 25 Jun 2004, Lei_at_ICS wrote:

> If a processor PA has two messages ma and mb to send to another
> processor, PB, and if it is guaranteed that ma is sent out from PA
> before mb, is it guaranteed that if PB receives from any source with any
> tag, it will always receive ma before mb and hence process (compute
> using) ma before mb?

Yes.

More specifically, MPI guarantees that messages from the same source with
the same signature (i.e., sent on the same communicator with the same tag)
will be received in the same order as they were sent.

> It seems that this has to be true, but I just want to make sure that MPI
> has such a scheduling policy (FIFO?) between two processors. The reason
> for knowing that for sure is so I can avoid using message tags.

You may want to reconsider that. Message tags are your friends -- they
can really help in terms of development, debugging, and ensuring that you
don't have difficult-to-diagnose race conditions later. It doesn't cost
much to post a few non-blocking receives on multiple tags and then using
MPI_Testany/MPI_Waitany to see if any of them have completed.

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