Thanks Ralph,

I have not much experience in this area.shall i use pthread_mutex_lock(*),*pthread_mutex_unlock() ..etc or following which i saw in OpenMPI source :

static opal_mutex_t ompi_lock;

OPAL_THREAD_LOCK(&ompi_lock);
  //
OPAL_THREAD_UNLOCK(&ompi_lock);

Thanks in advance,
umanga

Ralph Castain wrote:
Only thing I can suggest is to place a thread lock around the call to comm_spawn so that only one thread at a time can execute that function. The call to mpi_init_thread is fine - you just need to explicitly protect the call to comm_spawn.


On Sep 17, 2009, at 7:44 PM, Ashika Umanga Umagiliya wrote:

HI Jeff, Ralph,

Yes, I call MPI_COMM_SPAWN in multiple threads simultaneously.
Because I need to expose my parallel algorithm as a web service, I need multiple clients connect and execute my logic as same time(ie mutiple threads). For each client , a new thread is created (by Web service framework) and inside the thread,MPI_Init_Thread() is called if the MPI hasnt been initialized.
The the thread calls MPI_COMM__SPAWN and create new processes.

So ,if this is the case isn't there any workarounds ?

Thanks in advance,
umanga


Jeff Squyres wrote:
On Sep 16, 2009, at 9:53 PM, Ralph Castain wrote:

Only the obvious, and not very helpful one: comm_spawn isn't thread
safe at this time. You'll need to serialize your requests to that
function.



This is likely the cause of your issues if you are calling MPI_COMM_SPAWN in multiple threads simultaneously. Can you verify?

If not, we'll need to dig a little deeper to figure out what's going on. But Ralph is right -- read up on the THREAD_MULTIPLE constraints (check the OMPI README file) to see if that's what's biting you.


_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to