Newsgroups: comp.parallel.mpi
From: Marcelo Pasin <pasin@imag.fr>
Subject: Re: Problems using IBM MPI + threads
Organization: IMAG, Grenoble, France
Date: Thu, 27 Jun 1996 15:45:49 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <31D2908D.1003D815@imag.fr>

Fabian Breg (fbreg@cs.vu.nl) wrote:
> I'm experiencing the same problems here. When you read the info-
> explorer pages (info -l pe) they mention somewhere the incompatibility
> between POE and threads.
What do you mean as "compatibility". Or, what do THEY mean?

> The way I work around the problem is using only non-blocking MPI-
> calls and protect these with a mutex. If there's another (better)
> solution, I'd like to hear about it too.
That's *exactly* what I do. But most of the MPI implementations
are by-hand-multi-threaded. What I mean is that its execution is
not sequential, because it can be redirected by a signal. In 
that case, if you use a threads package which relies on the
same signals as your MPI (say, timer), things doesn't work as
you expect.

But my problem is not that. With the version 4 of AIX and its
proper MPI, I can't run even that simple program because it
dumps the core at the thread scheduling, like a join or yield.

William E. Hannon Jr. (whannon@austin.ibm.com) wrote:
>         I believe the previous code you posted, really should have been
> compiled with cc_r4 not cc_r .... because you cannot pthread_join to
They don't have the libraries lib*dce*.a needed to compile with
cc_r4. (I work in Grenoble and our SP1.5 is still running AIX 3.2,
while I'm evaluating the trauma of porting our software to AIX
4.1, in an SP2 at Montpellier).

> that it can be compiled either with cc_r or cc_r4.  The only question
> that I have is does MPI require cc_r4 ... does it make any DCE API
> calls or DCE services?
I don't think so. It's not linked with any of the DCE libs.
Unless that IBM has copied the modules into POE libs.

> and it must link with with -lpthreads and -lc_r .... 
Sort of. I run nm over /lib/crt0_r.o and /...poe/lib/crt0.o and the
functions they basically call are pthread_init() and mp_main(),
respectively. The test I did was to compile with all POE stuff
plus /lib/libpthreads.a, just adding a call to the pthread_init() 
function in the very beginning of my main() function. IT WORKS!
(We used to call that pthread_init() with older versions of IBM
MPI too).

> can you append the mpcc stanza from /etc/xlC.cfg?
I think it's better to append -lpthreads to /...poe/lib/poe.cfg.
In this solution, all the calls to libc or libmpi must be mutex-
protected, because none of them is thread safe.  We're used to
call MPI in that manner, but not libc. Our software calls malloc
or write without protection, which could work with /lib/libc_r.a.

Does anybody know why the heck MPI redefines all libc?

-- 
Marcelo Pasin
Institut IMAG - LMC/Apache

