LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Peter Kjellstrom (cap_at_[hidden])
Date: 2009-04-09 03:46:03


On Tuesday 07 April 2009, Davide Cesari wrote:
> Pedro Petrovitch ha scritto:
> > I've experienced a lock at my program while using the the pattern that
> > guarantees that it won't lock,
> > if the send isn't blocking (I use a MPI_Send and then a MPI_Recv for
> > both processes). The lock just started to happen
>
> Well, MPI_Send and MPI_Recv ARE blocking functions,

Using MPI spec wording. MPI_Send may be non-local (what is called blocking
here) and is always blocking (that is you may reuse your buffer).

...
> ...blocking, if you want to guarantee portability and reliability for your
> application, you had better use MPI_Isend and/or MPI_Irecv at the cost
> of a slightly more complex code.
> Good luck, Davide

Or use MPI_Bsend and the code should be ok. Note that telling MPI to buffer
each and every send is likely to be sub-optimal performance wise.

/Peter