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
|