On Mon, 12 Jan 2004, Irshad Ahmed wrote:
> I have used POSIX threads in my parallel program,One of these threads
> contains MPI_Send calls.
> Some times this program shows undefined behaviour,some times it runs
> very well.
> To have a stable program,I think that i should have to use
> 1- MPI_Thread calls instead of POSIX threads
> 2- a mutex lock for access to LAM,by any mpi call
> Please guide me is it right or mutex lock will be sufficient with POSIX
> thread???
There are actually no MPI thread calls -- MPI will not create or manage
user threads for you.
LAM does not support MPI_THREAD_MULTIPLE, meaning that LAM only supports
one thread in the MPI library at a time. It sounds like this is what you
are trying to do, but it sounds like you may also have a race condition.
You may want to read the section on threads in the LAM User's Guide, in
particular the section about MPI_THREAD_SERIALIZED -- this might work for
you (as long as you are careful not to get into deadlock situations!).
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|