<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Correct, but that’s not what I was suggesting. I was saying that the root alone could track completion of any number of collectives individually and then broadcast notice of those completions to all ranks.<div><br></div><div>This is but one example use case where freeing requests associated with NBCs makes sense.<br><div><br></div><div>Jeff<br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On Aug 8, 2020, at 2:14 PM, Richard Graham <richgraham@nvidia.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:CMR10;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:CMSS10;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:CMTT10;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->


<div class="WordSection1">
<p class="MsoNormal">The non-blocking reductions are required to start in the same order, completion order is not specified.  So I don’t think you can infer from the completion of the last non-blocking operation (ibarrier in this case), that all others have
 completed.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also, completion is local, and even in a synchronized operation like a reduction, not all ranks will complete at exactly the same time.  All have to enter the operation before any can complete, but the fact that one completed does not guarantee
 the other have.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Rich<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> mpi-forum <mpi-forum-bounces@lists.mpi-forum.org>
<b>On Behalf Of </b>Jeff Hammond via mpi-forum<br>
<b>Sent:</b> Saturday, August 8, 2020 3:56 PM<br>
<b>To:</b> Main MPI Forum mailing list <mpi-forum@lists.mpi-forum.org><br>
<b>Cc:</b> Jeff Hammond <jeff.science@gmail.com><br>
<b>Subject:</b> Re: [Mpi-forum] MPI_Request_free restrictions<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="1" cellpadding="0" style="background:#FFEB9C">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">External email: Use caution opening links or attachments</span></b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">
</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">The argument that there is no portable way to detect completion is false.  It is completely portable to detect completion using only a subset of processes, and there may even be use cases for it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For example, an application can use Ibarrier to determine whether all processes have reached a phase of the program but only detect this at one rank.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">MPI_Request req; <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">{<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  foo();<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  MPI_Ibarrier(comm, &req);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  if (rank) MPI_Request_free(&req);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  ..<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">if (!rank) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  MPI_Wait(&req);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  printf("foo finished everywhere\n");<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Similarly, one might have a bunch of Ireduce operations where the root is the only rank that tests completion, after which it notifies all processes that the bunch has completed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Are there any implementations that can't trivially support this?  I recall that MPICH implements requests as nothing more than pointers to internal state, and I assume that Open-MPI does something similar.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Jeff<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Sat, Aug 8, 2020 at 9:45 AM Bangalore, Purushotham via mpi-forum <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">I see discussion of this issue here:
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><a href="https://github.com/mpi-forum/mpi-forum-historic/issues/83" target="_blank">https://github.com/mpi-forum/mpi-forum-historic/issues/83</a><o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Puri<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="gmail-m_-7361355248288129080divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="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 Balaji, Pavan via mpi-forum
 <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
<b>Sent:</b> Saturday, August 8, 2020 8:51 AM<br>
<b>To:</b> <a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a> <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
<b>Cc:</b> Balaji, Pavan <<a href="mailto:balaji@anl.gov" target="_blank">balaji@anl.gov</a>><br>
<b>Subject:</b> [Mpi-forum] MPI_Request_free restrictions</span> <o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">Folks, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Does someone remember why we disallowed users from calling MPI_Request_free on nonblocking collective requests?  I remember the reasoning for not allowing cancel (i.e., the operation might have completed on some processes, but not all),
 but not for Request_free.  AFAICT, allowing the users to free the request doesn’t make any difference to the MPI library.  The MPI library would simply maintain its own refcount to the request and continue forward till the operation completes.  One of our
 users would like to free NBC requests so they don’t have to wait for the operation to complete in some situations.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Unfortunately, when I added the Rput/Rget operations in the RMA chapter, I copy-pasted that text into RMA as well without thinking too hard about it.  My bad!  Either the RMA committee missed it too, or they thought of a reason that I can’t
 think of now.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Can someone clarify or remind me what the reason was?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">  — Pavan<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">MPI-3.1 standard, page 197, lines 26-27:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">“<span style="font-family:"CMR10",serif">It is erroneous to call
</span><span style="font-family:"CMSS10",serif">MPI</span><span style="font-family:"CMTT10",serif">_</span><span style="font-family:"CMSS10",serif">REQUEST</span><span style="font-family:"CMTT10",serif">_</span><span style="font-family:"CMSS10",serif">FREE
</span><span style="font-family:"CMR10",serif">or </span><span style="font-family:"CMSS10",serif">MPI</span><span style="font-family:"CMTT10",serif">_</span><span style="font-family:"CMSS10",serif">CANCEL
</span><span style="font-family:"CMR10",serif">for a request associated with a nonblocking collective operation.</span>”<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
mpi-forum mailing list<br>
<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br>
<a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-forum" target="_blank">https://lists.mpi-forum.org/mailman/listinfo/mpi-forum</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Jeff Hammond<br>
<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br>
<a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><o:p></o:p></p>
</div>
</div>
</div>
</div>


</div></blockquote></div></div></body></html>