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-11-10 08:29:22


On Nov 9, 2004, at 5:05 PM, atarpley wrote:

> I think I understand this, I would just like some confirmation. :-)
>
> MPI_Send is a blocking, synchronous routine. Meaning it won't return
> until
> the send buffer is good to use AND the recipient has started to
> receive the
> message.

Not quite right. MPI_Send does not necessarily return before the
receiver has started to receive. If you need those semantics, then you
should use MPI_Ssend (synchronous send).

> Question: Does this mean it wont return until the recipient STARTS
> to receive or until the recipient FULLY receives the msg?

MPI_Ssend will return after the receiver *starts* to receive. You are
given no indication when the receiver *finishes* receiving.

> MPI_Isend is a non-blocking, asynchronous routine. Meaning it returns
> immediatly, regardless of the status of the matching receive or the
> buffer.
> In order to delete the send buffer okay, MPI_Wait (or MPI_Test) must
> say that
> it is okay to do so.

Correct.

> Question: The requirement that a test or wait routine be
> used to determine the status of the send buffer effectively turns this
> into a
> blocking, asynchronous routine, correct? If I want to deallocate the
> buffer
> after each send?

Test is non-blocking; it will always return [more-or-less] immediately
and will never block. Wait will always block.

There are also several variants of test and wait available (dealing
with arrays of requests); you might want to look in the MPI standard
and read the descriptions of each.

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