[mpich-discuss] MPI_THREAD_MULTIPLE
Lubomir Radev
lubomirr at yahoo.com
Tue Sep 22 02:26:38 CDT 2009
This works for me too, returning MPI_THREAD_MULTIPLE, but only when started via mpiexec.
However, I need to launch my worker processes programmatically by using MPI_Comm_spawn_multiple(). That's necessitated by the nature of my app - it's actually a library that clients will be linking against. So the client process has to spawn workers and communicate with them, which works just fine from one thread and fails with two. And if I use MPI_Init_thread() from the client/master process (which isn't started by mpiexec), it always returns MPI_THREAD_SINGLE.
Should I try to pack all of my MPI communications in one thread or can you suggest a solution other than mpiexec for multiple threads? Perhaps I could somehow perform the same thread support initialization that mpiexec apparently does internally?
Thanks very much.
________________________________
From: Jayesh Krishna <jayesh at mcs.anl.gov>
To: mpich-discuss at mcs.anl.gov
Cc: Lubomir Radev <lubomirr at yahoo.com>
Sent: Monday, September 21, 2009 9:04:17 AM
Subject: RE: [mpich-discuss] MPI_THREAD_MULTIPLE
Hi,
Are you launching your MPI job using the
"-channel" option of mpiexec (mpiexec -n 2 -channel nemesis
thread_multiple_test.exe)? A simple MPI program (see
below) that queries for the thread level support returns
MPI_THREAD_MULTIPLE for me.
=========== Thread multiple test
===================
#include<iostream>
#include"mpi.h"
intmain(intargc, char*argv[]){
intprovided;provided = MPI::Init_thread(MPI_THREAD_MULTIPLE);
if(provided == MPI_THREAD_MULTIPLE){
std::cout << "Thread multiple supported"<<
std::endl;}
else{
std::cout << "Thread multiple NOT supported"<<
std::endl;}
MPI::Finalize();
}
=========== Thread multiple test
===================
Regards,
Jayesh
________________________________
From: mpich-discuss-bounces at mcs.anl.gov
[mailto:mpich-discuss-bounces at mcs.anl.gov] On Behalf Of Lubomir
Radev
Sent: Sunday, September 20, 2009 7:23 PM
To: mpich-discuss at mcs.anl.gov
Subject: Re: [mpich-discuss]
MPI_THREAD_MULTIPLE
Yes. I was using 1.0.8p1 originally, but after your suggestion got 1.1.1p1
and the problem persists.
I could reduce my code to a test case exhibiting the issue, but I need to
understand why MPI_Init_thread() won't provide me with MPI_THREAD_MULTIPLE
support and always returns MPI_THREAD_SINGLE regardless of the channel
configuration. I need to get that working first so my multi-threaded code can
assume it operates in a correctly initialized environment and can legitimately
call into MPICH2 simultaneously from more than one thread.
I'm using Boost.MPI wrapper (and Boost.Thread), but that shouldn't
matter.
Thanks
________________________________
From: Jayesh Krishna
<jayesh at mcs.anl.gov>
To: mpich-discuss at mcs.anl.gov
Sent: Friday, September 18, 2009 8:42:38 AM
Subject: Re: [mpich-discuss]
MPI_THREAD_MULTIPLE
Hi,
Are you trying the latest stable release,
1.1.1p1, of MPICH2 (http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads)
?
Can you send us a test program
?
Regards,
Jayesh
-----Original Message-----
From:
mpich-discuss-bounces at mcs.anl.gov [mailto:mpich-discuss-bounces at mcs.anl.gov]
On Behalf Of Lubomir Radev
Sent: Thursday, September 17, 2009 10:08 PM
To:
mpich-discuss at mcs.anl.gov
Subject: [mpich-discuss]
MPI_THREAD_MULTIPLE
Hey guys,
I need to call into the thread-safe
version of MPICH2 so I tried to initialize with MPI_Init_thread() and
MPI_THREAD_MULTIPLE, but no matter how I configured the channels on my nodes -
tried both mt and nemesis - that function returns MPI_THREAD_SINGLE as provided
thread support.
I'm using 1.0.8p1 on Windows if that matters. Installed
from the provided MSI binary. Perhaps I need to build from sources, configuring
it with thread support?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20090922/7766a202/attachment.htm>
More information about the mpich-discuss
mailing list