Newsgroups: comp.parallel.mpi
From: salo@mrjones.engr.sgi.com (Eric Salo)
Subject: Re: Ordering of MPI messages in multi-threaded programs
Organization: Silicon Graphics, Inc.  Mountain View, CA
Date: 20 Aug 1996 07:51:16 GMT
Message-ID: <4vbqpk$c8d@murrow.corp.sgi.com>

> Given a multithreaded application, having two threads per process, where 
> each thread pair uses its distinct tag, the following situation might 
> occur:
> 
> Rank 0 - Thread 0 : MPI_Send( ..., tag0, ...)
> Rank 0 - Thread 1 : MPI_Send( ..., tag1, ...)
> Rank 1 - Thread 0 : MPI_Recv( ..., tag1, ...)
> Rank 1 - Thread 1 : MPI_Recv( ..., tag0, ...)
> 
> Clause 3.5, pg. 31, MPI Std. 12 June 1995, states that these calls are 
> unordered. Is this program "unsafe"?

Well, first you have to locate a thread-safe implementation of MPI!
Assuming that you somehow obtain one, I don't see any problem with the
above code. The messages are unordered, yes, but that would only be a
problem if they shared both the same communicator and the same tag.

Eric Salo         Silicon Graphics Inc.             "Do you know what the
(415)933-2998     2011 N. Shoreline Blvd, 8U-802     last Xon said, just
salo@sgi.com      Mountain View, CA   94043-1389     before he died?"

