Newsgroups: comp.parallel.mpi
From: Marcelo Pasin <pasin@imag.fr>
Subject: Re: MPI v1.1 + multithread
Organization: IMAG, Grenoble, France
Date: Tue, 11 Feb 1997 16:58:54 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3300973E.51E97DFD@imag.fr>

Kun Hou wrote:
> Trying to use MPI version 1.1
There are several MPI implementations and many of them run on different
machines and use different underlying layers. You should be more
precise. If necessary, ask your system manager.

> in a multithread program I encountered several problems even
> including a nondeterministic behaviour of the program.
This is an old problem. Until today, I've never seen any thread-safe or
thread-aware version of MPI other than MPI-F (IBM research prototype).
Current MPI implementations are not even expected to be thread-safe or
thread-aware.

> If anobody has ever encountered a similar problem or even has
> a solution I would like him to drop me a massage here in this
> newsgroup.
The solution we take is to protect all calls to MPI with mutexes, never
use blocking calls and never call MPI_WAIT. To implement that, we
developed a multi-threaded layer on top of MPI. A thread willing to send
a message, does an MPI_ISEND request and store it in a table. When the
thread wants to wait the end of the send, it blocks in a condition
variable associated to the send request. A daemon thread polls MPI to
see which requests ended and signals the corresponding condition
variables. If you are interested in use it, please drop me a mail. 

Cheers,

-- 
Marcelo Pasin                      email: Marcelo.Pasin@imag.fr
Institut IMAG - LMC/Apache,          tel: +33 (0)476 51 4574
100 Rue des Mathematiques,           fax: +33 (0)476 51 4846
BP 53, Campus Universitaire, 38041 Grenoble Cedex 9, FRANCE

