On Feb 19, 2005, at 12:33 AM, Brian Barrett wrote:
>> 3. In principle, shall I always regard MPI_Send as a
>> blocking function and should avoid something like:
>> loop rank for all
>> {
>> MPI_Send( to rank)
>> MPI_Recv( from rank)
>> }
>> Because that's the situation we encountered in the
>> real situation inside a loop when the rank index has
>> a chance to be the same as its own rank.
>
> The above code snippet violates the MPI standard (I believe the MPI
> standard document explicitly mentions this case). A more subtle
> version of this is the case where every process does an MPI_Send to
> ((my_rank + 1) % comm_world_size) then does an MPI_Recv from ((my_rank
> - 1) % comm_world_size). This too results in deadlock for
> significantly large messages, as the processes have nowhere to send
> to.
To finish out this thread, yes, this specific case is detailed in the
MPI standard. Check out MPI-1:3.5, the sub-section on "Resource
limitations" -- in particular, example 3.9.
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|