<div dir="ltr">Hi Rajeev,<div><br></div><div>Yes, that's the question and my initial answer was the same as yours. However, we then started talking about the implementation of the barrier, which led to the second example. For example, consider a situation where there is an error in transmission and the implementation needs to enter the progress engine to retry a send operation in software.</div><div><br></div><div> ~Jim.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 10, 2020 at 5:10 PM Thakur, Rajeev <<a href="mailto:thakur@anl.gov">thakur@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_8080135445452885074WordSection1">
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif">Jim,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif"> I don’t fully understand your question. Is it “If all processes reach MPI_Barrier, are they guaranteed to exit the barrier without the need for any other MPI function to be called
on any process?” I would say yes.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif">Rajeev<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Lucida Grande",sans-serif"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(181,196,223);padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12pt;color:black">From: </span></b><span style="font-size:12pt;color:black">mpi-forum <<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org" target="_blank">mpi-forum-bounces@lists.mpi-forum.org</a>> on behalf of Jim Dinan via mpi-forum <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
<b>Reply-To: </b>Main MPI Forum mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
<b>Date: </b>Saturday, October 10, 2020 at 12:31 PM<br>
<b>To: </b>Main MPI Forum mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
<b>Cc: </b>Jim Dinan <<a href="mailto:james.dinan@gmail.com" target="_blank">james.dinan@gmail.com</a>><br>
<b>Subject: </b>[Mpi-forum] Progress Question<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Hi All,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">A colleague recently asked a question that I wasn't able to answer definitively. Is the following code guaranteed to make progress?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30pt;margin-right:0in">
<div>
<p class="MsoNormal">MPI_Barrier();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">if rank == 1<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> create_file("test")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">if rank == 0<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> while not_exists("test")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> sleep(1);<u></u><u></u></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">That is, can rank 1 require rank 0 to make MPI calls after its return from the barrier, in order for rank 1 to complete the barrier? If the code were written as follows:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="margin-left:30pt;margin-right:0in">
<div>
<p class="MsoNormal">isend(..., other_rank, &req[0])<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">irecv(..., other_rank, &req[1])<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">waitall(2, req)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">if rank == 1<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> create_file("test")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">if rank == 0<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> while not_exists("test")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> sleep(1);<u></u><u></u></p>
</div>
</blockquote>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I think it would clearly not guarantee progress since the send data can be buffered. Is the same true for barrier?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> ~Jim.<u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote></div>