<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">I don't have a simple program&nbsp; to show the behavior.&nbsp;&nbsp; I will see what I can do</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">for that.&nbsp; </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">My tracing shows that one of the slaves has completed MPI_Send, while</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">the master who is waiting for the package never sees it.&nbsp; The sync is like this:</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; master&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; slave</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">------------------------------------------</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loop {&nbsp;&nbsp;&nbsp; </DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for all slaves</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPI_recv&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPI_Send to master</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;compute status&nbsp;&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create package+status</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for all slaves</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;MPI_send&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MPI_Recv from master</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if status== end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if status == END</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;}<BR></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">the system will be stucked if any package is lost.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">MPI_Send and MPI_Recv are the only 2 MPI functions called within the loop, which is</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">deeply nested in another loop.&nbsp;&nbsp; When the lost happens, the code is usually calling</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">more than 50,000 MPI_Send/MPI_Recv per second.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">Hope this info help some.</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">thanks</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">tan</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR>&nbsp;</DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">----- Original Message ----<BR>From: Darius Buntinas &lt;buntinas@mcs.anl.gov&gt;<BR>To: chong tan &lt;chong_guan_tan@yahoo.com&gt;<BR>Cc: mpich-discuss@mcs.anl.gov<BR>Sent: Thursday, April 12, 2007 7:58:17 AM<BR>Subject: Re: [MPICH] nemesis in a threaded code<BR><BR>
<DIV>Can you send us a simple sample program that shows this behavior?&nbsp;&nbsp;If <BR>only one thread is making calls to MPI functions, I can't see that other <BR>threads should be interfering with this.&nbsp;&nbsp;I'd like to get a better idea <BR>of what's going on, so any more info you can give me would help.<BR><BR>Thanks,<BR>Darius<BR><BR>chong tan wrote:<BR>&gt; randomly, a package sent by MPI_Send disappear, the reciever ended up<BR>&gt; waiting for a package that never show up.&nbsp;&nbsp;This does not happen when the<BR>&gt; apllication is not threaded.<BR>&gt;&nbsp;&nbsp;<BR>&gt; I have completed the test using --enable-threads=funnel.&nbsp;&nbsp;The main thread is<BR>&gt; the only one calling MPI.&nbsp;&nbsp;(actually, only the master of all MPI <BR>&gt; processes are<BR>&gt; multi-threaded).&nbsp;&nbsp;It works much better, the horror is, it drops packages <BR>&gt; once<BR>&gt; in many runs.&nbsp;&nbsp;So, nemesis is pretty much useless for any threaded
 <BR>&gt; application.<BR>&gt;&nbsp;&nbsp;<BR>&gt; BTW, the package dropping usually happen after more than 30,000,000 calls<BR>&gt; to MPI_Send and MPI_Recv.<BR>&gt;&nbsp;&nbsp;<BR>&gt; Any suggestion to debug this ?<BR>&gt;&nbsp;&nbsp;<BR>&gt; thanks<BR>&gt; tan<BR>&gt; <BR>&gt; <BR>&gt;&nbsp;&nbsp;<BR>&gt; ----- Original Message ----<BR>&gt; From: Darius Buntinas &lt;buntinas@mcs.anl.gov&gt;<BR>&gt; To: chong tan &lt;chong_guan_tan@yahoo.com&gt;<BR>&gt; Cc: mpich-discuss@mcs.anl.gov<BR>&gt; Sent: Wednesday, April 11, 2007 2:22:39 PM<BR>&gt; Subject: Re: [MPICH] nemesis in a threaded code<BR>&gt; <BR>&gt; Hmm, what do you mean by "dropping packages"?&nbsp;&nbsp;What symptoms are you seeing?<BR>&gt; <BR>&gt; Darius<BR>&gt; <BR>&gt; chong tan wrote:<BR>&gt;&nbsp;&nbsp;&gt; that is what I thought too.&nbsp;&nbsp;But without using --enable-threads, <BR>&gt; nemesis is<BR>&gt;&nbsp;&nbsp;&gt; dropping packages randomly in a threaded env.&nbsp;&nbsp;I will rebuild
 with<BR>&gt;&nbsp;&nbsp;&gt; --enable-threads=funnel to see what happen.<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;<BR>&gt;&nbsp;&nbsp;&gt; tan<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;<BR>&gt;&nbsp;&nbsp;&gt; ----- Original Message ----<BR>&gt;&nbsp;&nbsp;&gt; From: Darius Buntinas &lt;buntinas@mcs.anl.gov&gt;<BR>&gt;&nbsp;&nbsp;&gt; To: chong tan &lt;chong_guan_tan@yahoo.com&gt;<BR>&gt;&nbsp;&nbsp;&gt; Cc: mpich-discuss@mcs.anl.gov<BR>&gt;&nbsp;&nbsp;&gt; Sent: Wednesday, April 11, 2007 1:07:04 PM<BR>&gt;&nbsp;&nbsp;&gt; Subject: Re: [MPICH] nemesis in a threaded code<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt; Nemesis only supports thread_single.&nbsp;&nbsp;However, as long as you ensure<BR>&gt;&nbsp;&nbsp;&gt; that only one thread is making MPI calls, it should work fine.<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt; Darius<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt; chong tan wrote:<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;
 with MPI calls done by the main thread, nemesis is dropping <BR>&gt; packages.&nbsp;&nbsp;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; Should I build MPICH<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; using --enable-threads=funneled ?<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; thanks<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; tan<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; 8:00? 8:25? 8:40? Find a flick &lt;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; <A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A> <BR>&gt; &lt;<A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news"
 target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A>&gt;<BR>&gt;&nbsp;&nbsp;&gt; &lt;<A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A> <BR>&gt; &lt;<A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A>&gt;&gt;&gt; in no time<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; with theYahoo! Search movie showtime shortcut. &lt;<BR>&gt;&nbsp;&nbsp;&gt;&nbsp;&nbsp;&gt; <A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A> <BR>&gt; &lt;<A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A>&gt;<BR>&gt;&nbsp;&nbsp;&gt; &lt;<A
 href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A> <BR>&gt; &lt;<A href="http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news" target=_blank>http://tools.search.yahoo.com/shortcuts/?fr=oni_on_mail&amp;#news</A>&gt;&gt;&gt;<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt;<BR>&gt;&nbsp;&nbsp;&gt; ------------------------------------------------------------------------<BR>&gt;&nbsp;&nbsp;&gt; TV dinner still cooling?<BR>&gt;&nbsp;&nbsp;&gt; Check out "Tonight's Picks"<BR>&gt;&nbsp;&nbsp;&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/" target=_blank>http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/</A>&gt; on Yahoo! TV.<BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; We won't tell. Get more on shows you hate to love <BR>&gt; &lt;<A
 href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265" target=_blank>http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265</A> &gt;<BR>&gt; (and love to hate): Yahoo! TV's Guilty Pleasures list. <BR>&gt; &lt;<A href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265" target=_blank>http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265</A> &gt;</DIV></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif"><BR></DIV></div><br>
      <hr size=1>Don't be flakey. <a href="http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail">Get Yahoo! Mail for Mobile</a> and <br><a href="http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail">always stay connected</a> to friends.</body></html>