<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">These comments are on the MPI 3.1 spec[0], Section 3.7.5, pages 61 and 62 on MPI_Waitsome and MPI_Testsome.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The spec makes two comments on what elements in `array_of_indices` and `array_of_statuses` are accessed:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">“Returns in the first <b>outcount</b> locations of the array array_of_indices the indices of these operations (index within the array array_of_requests; the array is indexed from zero in C and from one in
Fortran)”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">“Returns in the first <b>outcount</b> locations of the array array_of_status the status for these completed operations.”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">As far as I can tell, the spec provides no other indication of the size of these two arrays. So, as a user, I would think that `array_of_indices` is only required to be as large as the largest possible value
of `outcount`.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The max value of outcount is not necessarily the same as the size of `array_of_requests`: If an array_of_requests has 10 elements, but the user knows that only 8 of the requests are active, they
<i>know</i> that outcount must be less than or equal to 8.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The reason I ask is that OpenMPI takes the liberty of treating `array_of_indices` as being the same size as `array_of_requests`[1]. It uses array_of_indices[i] as scratch space to store the completion of array_of_requests[i].<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Is the spec ambiguous here, or is OpenMPI in violation of the spec? Or am I missing an explicit definition of the required size of these arrays?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thank you very much!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[0] <a href="http://mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf">
http://mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[1] <a href="https://github.com/open-mpi/ompi/blob/master/ompi/request/req_wait.c#L422">
https://github.com/open-mpi/ompi/blob/master/ompi/request/req_wait.c#L422</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">Andrew Gaspar<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">CCS-7 – Applied Computer Science<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:black">505-664-0676 / agaspar@lanl.gov</span><o:p></o:p></p>
</div>
</body>
</html>