<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009> Are you launching your MPI job using the
"-channel" option of mpiexec (mpiexec -n 2 -channel nemesis
thread_multiple_test.exe)?</SPAN></FONT><FONT color=#0000ff size=2
face=Arial><SPAN class=408565815-21092009> A simple MPI program (see
below) that queries for the thread level support returns
MPI_THREAD_MULTIPLE for me.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009>=========== Thread multiple test
===================</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009><FONT color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#include</FONT></FONT><FONT color=#000000 size=2> </FONT><FONT color=#a31515
size=2><FONT color=#a31515 size=2><iostream></P></FONT></FONT><FONT
color=#0000ff size=2><FONT color=#0000ff size=2>
<P>#include</FONT></FONT><FONT color=#000000 size=2> </FONT><FONT color=#a31515
size=2><FONT color=#a31515 size=2>"mpi.h"</P></FONT></FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>
<P>int</FONT></FONT><FONT color=#000000 size=2> main(</FONT><FONT color=#0000ff
size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT color=#000000 size=2>
argc, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>char</FONT></FONT><FONT size=2><FONT color=#000000> *argv[])</FONT></P>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>int</FONT></FONT><FONT size=2> provided;</P>
<P>provided = MPI::Init_thread(MPI_THREAD_MULTIPLE);</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>if</FONT></FONT><FONT size=2>(provided == MPI_THREAD_MULTIPLE){</P>
<P>std::cout << </FONT><FONT color=#a31515 size=2><FONT color=#a31515
size=2>"Thread multiple supported"</FONT></FONT><FONT size=2> <<
std::endl;</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff
size=2>else</FONT></FONT><FONT size=2>{</P>
<P>std::cout << </FONT><FONT color=#a31515 size=2><FONT color=#a31515
size=2>"Thread multiple NOT supported"</FONT></FONT><FONT size=2> <<
std::endl;</P>
<P>}</P>
<P>MPI::Finalize();</P>
<P>}</P>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009>=========== Thread multiple test
===================</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009>Regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=408565815-21092009>Jayesh</SPAN></FONT></DIV></FONT></SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> mpich-discuss-bounces@mcs.anl.gov
[mailto:mpich-discuss-bounces@mcs.anl.gov] <B>On Behalf Of </B>Lubomir
Radev<BR><B>Sent:</B> Sunday, September 20, 2009 7:23 PM<BR><B>To:</B>
mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> Re: [mpich-discuss]
MPI_THREAD_MULTIPLE<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="FONT-FAMILY: 'times new roman', 'new york', times, serif; FONT-SIZE: 12pt">
<DIV>Yes. I was using 1.0.8p1 originally, but after your suggestion got 1.1.1p1
and the problem persists.</DIV>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>I'm using Boost.MPI wrapper (and Boost.Thread), but that shouldn't
matter.</DIV>
<DIV><BR></DIV>
<DIV>Thanks</DIV>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times,
serif; FONT-SIZE: 12pt">
<DIV
style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT
size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jayesh Krishna
<jayesh@mcs.anl.gov><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
mpich-discuss@mcs.anl.gov<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B>
Friday, September 18, 2009 8:42:38 AM<BR><B><SPAN
style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [mpich-discuss]
MPI_THREAD_MULTIPLE<BR></FONT><BR>
<P><FONT size=2>Hi,<BR><SPAN> Are you trying the latest stable release,
1.1.1p1, of MPICH2 (<A
href="http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads"
target=_blank>http://www.mcs.anl.gov/research/projects/mpich2/downloads/index.php?s=downloads</A>)
?</SPAN><BR> Can you send us a test program
?<BR><BR>Regards,<BR>Jayesh<BR><BR>-----Original Message-----<BR>From:
mpich-discuss-bounces@mcs.anl.gov [<A
href="mailto:mpich-discuss-bounces@mcs.anl.gov" rel=nofollow target=_blank
ymailto="mailto:mpich-discuss-bounces@mcs.anl.gov">mailto:mpich-discuss-bounces@mcs.anl.gov</A>]
On Behalf Of Lubomir Radev<BR>Sent: Thursday, September 17, 2009 10:08 PM<BR>To:
mpich-discuss@mcs.anl.gov<BR>Subject: [mpich-discuss]
MPI_THREAD_MULTIPLE<BR><BR>Hey guys,<BR><BR>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.<BR><BR>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?<BR><BR>Thanks<BR></FONT></P></DIV></DIV>
<DIV style="POSITION: fixed"></DIV></DIV></BODY></HTML>