Newsgroups: comp.parallel.mpi
From: Anders Liverud <al@inko.no>
Subject: Re: Ordering of MPI messages in multi-threaded programs
Organization: Kongsberg Informasjonskontroll
Date: Tue, 20 Aug 1996 11:16:28 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3219826C.2213@inko.no>

> > 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.
> Assume the messages use the same communicator, but different tags as shown above. This 
would require buffering of the first MPI_Send. Is it a requirement for the MPI 
implementation to handle this, or is this an "unsafe" program ?
________________________________________ 
Anders Liverud (al)
Kongsberg Informasjonskontroll AS (nord)
Hvamstubben 17, 2013 SKJETTEN, NORWAY
tlf : +47 6384 5600
Fax : +47 6384 5922
e-mail : al@inko.no

