<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=277145317-13052009><FONT face=Arial
color=#0000ff size=2>Simone,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=277145317-13052009><FONT face=Arial
color=#0000ff
size=2> Both
those programs are erroneous, but the implementation is not required to detect
erroneous programs. (The behavior of erroneous programs is undefined.)
</FONT></SPAN><SPAN class=277145317-13052009><FONT face=Arial color=#0000ff
size=2>Because the message size is small, the sends are being delivered as eager
even if the receive is never posted. If you increase the message size to above
the eager threshold (I don't remember what it is, but try 1 MB to be safe), the
programs will hang because the sends will wait for a rendezvous ack from the
receive side.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=277145317-13052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=277145317-13052009><FONT face=Arial
color=#0000ff size=2>Rajeev</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=277145317-13052009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Simone Atzeni
[mailto:simone.at@gmail.com] <BR><B>Sent:</B> Tuesday, May 12, 2009 10:58
PM<BR><B>To:</B> Ganesh Gopalakrishnan<BR><B>Subject:</B> Weird behavior
collective routine<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV>Hi,</DIV>
<DIV><BR></DIV>
<DIV>According to the MPI-2 Standard about collectives routine at page
132 (Section 5.2.1), it says "All processes in the group </DIV>identified
by the intracommunicator must call the collective routine with matching
arguments".
<DIV><BR></DIV>
<DIV>Running the program below using MPICH:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><SPAN style="COLOR: #aa0d91"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MIN-HEIGHT: 14px; MARGIN: 0px; FONT: 10px Monaco"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">} </SPAN></FONT><SPAN
style="COLOR: #aa0d91"><FONT class=Apple-style-span face=Helvetica
size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">else</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
</SPAN></FONT><SPAN style="COLOR: #aa0d91"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"> MPI_Reduce(&u, &v,
</SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_INT, MPI_SUM, </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_COMM_WORLD);</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">} </SPAN></FONT><SPAN
style="COLOR: #aa0d91"><FONT class=Apple-style-span face=Helvetica
size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">else</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
</SPAN></FONT><SPAN style="COLOR: #aa0d91"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">2</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"> MPI_Reduce(&u, &v,
</SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_INT, MPI_SUM, </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_COMM_WORLD); </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">}</SPAN></FONT></DIV>
<DIV><BR></DIV></DIV>
<DIV>it terminates correctly, but it shouldn't be in agreement whit the
standard because all process in the group (MPI_COMM_WORLD in this case) must
call the collective routine. In this case the root process does not call
the REDUCE routine, so where do all the messages from other MPI_Reduce
end up?</DIV>
<DIV><BR></DIV>
<DIV>Another program, using Broadcast routine:</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><BR></DIV>
<DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><SPAN style="COLOR: #aa0d91"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"> MPI_Bcast(&u, </SPAN></FONT><SPAN
style="COLOR: #1c00cf"><FONT class=Apple-style-span face=Helvetica
size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_INT, </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_COMM_WORLD); </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">}</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><SPAN style="COLOR: #aa0d91"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">else</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
</SPAN></FONT><SPAN style="COLOR: #aa0d91"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">} </SPAN></FONT><SPAN
style="COLOR: #aa0d91"><FONT class=Apple-style-span face=Helvetica
size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">else</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
</SPAN></FONT><SPAN style="COLOR: #aa0d91"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">if</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">
(rank == </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">2</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">)
{ </SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"> MPI_Bcast(&v, </SPAN></FONT><SPAN
style="COLOR: #1c00cf"><FONT class=Apple-style-span face=Helvetica
size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">1</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_INT, </SPAN></FONT><SPAN style="COLOR: #1c00cf"><FONT
class=Apple-style-span face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">0</SPAN></FONT></SPAN><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">,
MPI_COMM_WORLD);</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px">}</SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span
style="FONT-SIZE: 12px"><BR></SPAN></FONT></DIV>
<DIV style="MARGIN: 0px; FONT: 10px Monaco"><FONT class=Apple-style-span
face=Helvetica size=3><SPAN class=Apple-style-span style="FONT-SIZE: 12px">it
also terminates correctly, but also in this case not all process in the group
(MPI_COMM_WORLD) call the collective routine. So it seems that also in this
case the standard is not enforced. So where does the message to process 1 end
up?</SPAN></FONT></DIV>
<DIV><BR></DIV></DIV>
<DIV><BR></DIV>
<DIV>I tried the same programs with Open MPI and they have the same behavior,
but using Microsoft MPI both programs crash.</DIV>
<DIV>So, the question is, MPICH2 and Open MPI don't enforce the standard and
only Microsoft MPI enforces it?</DIV>
<DIV><BR></DIV>
<DIV>Thanks</DIV>
<DIV>Regards</DIV>
<DIV>Simone</DIV></DIV></BLOCKQUOTE></BODY></HTML>