Newsgroups: comp.programming.threads,comp.parallel.mpi
From: Christoph Giess <Ch.Giess@DKFZ-Heidelberg.de>
Subject: Re: Threads, MPI and Re-entrancy
Organization: DKFZ
Date: Mon, 06 Jul 1998 07:59:48 +0200
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <35A067D4.238B@DKFZ-Heidelberg.de>

Girindra D. Sharma wrote:
> 
> Hi,
>  Has anybody used pthreads and MPI together ?
Yes.

>  I have written a threaded pingpong using
>  the MPICH implementation of MPI.
>  The main thread hands over the messages to a
>  sender thread and does the receiving itself.
>  The pingpong is not behaving correctly.
>  It hangs in some MPI calls. So the thread
>  making that call blocks.
>  I think I might be facing re-entrancy problems.
That's correct.

>  I know that MPI is re-entrant.
Unfortunately not.

>  But the calls MPI might be making  may not be
>  re-entrant. So I tried locking all my MPI
>  calls. This time the pingpong worked fine.
>  Am I correct in inferring the the underlying
>  system Iam using is not re-entrant.
Yes.

>  How can I confirm this ?
Have a look at the source code :-). There must be
a locking. To get a simple model, I assumed in my
work that all MPI calls are protected by a mutex
semaphore.

>  I don't want to sequentialize my MPI calls.
>  Is there any way out ?
It depends on what you want to do, but generally: NO.

>   Iam using SUN OS 5.6
That should be the same on all platforms using p4.

> 
>  Thanks in advance.
> 
>  -- Girindra Sharma

Bye,
 Christoph
                                     ... still running against the wind.
========================================================================
Christoph Giess
Deutsches Krebsforschungszentrum         (German Cancer Research Center)
Div. Medical and Biological Informatics H0100    Tel: (+49) 6221-42 2325
Im Neuenheimer Feld 280                          Fax: (+49) 6221-42 2345
D-69120 Heidelberg                   e-mail  Ch.Giess@DKFZ-Heidelberg.de
Germany                              http://mbi.dkfz-heidelberg.de/
========================================================================

