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 17:42:14 GMT
Message-ID: <4vctdm$c8d@murrow.corp.sgi.com>

> I cannot speak for the whole Forum, but I suspect the above example
> could hang.  In MPI-1, the interaction with threads is undefined.
> Thus, I think it is ok for Rank 0, thread 0 to block all other threads
> on rank 0.  Similarly, Rank 1, thread 0 could block all others on Rank
> 1.  This could cause the program to hang.  One would hope that a good
> thread package would schedule another thread if one blocked but I
> don't think MPI-1 requires this.

Steve, I think you're right. I was assuming a true multithreaded MPI,
but one simple way to get thread-safety is to just lock the entire
library at the beginning of every MPI routine. In such an implementation,
the example code would in fact hang.

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?"

