<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body class="" style="word-wrap:break-word" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #333399;font-size: 10pt;">Thanks! There is no way to do this with modifying the child application's code, then, right?<br>
<br>
Mattthieu<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF469042" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>From:</b> Bland, Wesley [wesley.bland@intel.com]<br>
<b>Sent:</b> Friday, February 17, 2017 8:39 AM<br>
<b>To:</b> <discuss@mpich.org><br>
<b>Subject:</b> Re: [mpich-discuss] Waiting for spawned processes to call MPI_Finalize?<br>
</font><br>
</div>
<div></div>
<div>You could use MPI_Comm_disconnect. The description is in the 3.1 standard p. 398:
<div class=""><br class="">
</div>
<blockquote class="" style="margin:0 0 0 40px; border:none; padding:0px">
<div class="">
<div class="page" title="Page 430">
<div class="layoutArea">
<div class="column">
<p class=""><span class="" style="font-size:11.000000pt; font-family:'CMR10'">This function waits for all pending communication on
</span><span class="" style="font-size:11.000000pt; font-family:'CMSS10'">comm </span>
<span class="" style="font-size:11.000000pt; font-family:'CMR10'">to complete internally, deallocates the communicator object, and sets the handle to
</span><span class="" style="font-size:10.000000pt; font-family:'CMSS10'">MPI</span><span class="" style="font-size:10.000000pt; font-family:'CMTT10'">_</span><span class="" style="font-size:10.000000pt; font-family:'CMSS10'">COMM</span><span class="" style="font-size:10.000000pt; font-family:'CMTT10'">_</span><span class="" style="font-size:10.000000pt; font-family:'CMSS10'">NULL</span><span class="" style="font-size:11.000000pt; font-family:'CMR10'">.
 It is a collective operation. </span></p>
</div>
</div>
</div>
</div>
</blockquote>
<div class="">
<div class="page" title="Page 430">
<div class="layoutArea">
<div class="column">
<div class=""><br class="">
</div>
<div class="">If you disconnect the communicator from MPI_Comm_get_parent before you call MPI_Finalize and the spawning processes do the same, you should synchronize around the disconnect.</div>
</div>
</div>
</div>
</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Feb 17, 2017, at 7:58 AM, Dorier, Matthieu <<a href="mailto:mdorier@anl.gov" class="" target="_blank">mdorier@anl.gov</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; direction:ltr; font-family:Tahoma; color:rgb(51,51,153); font-size:10pt">
Hi,<br class="">
<br class="">
If I have an application that calls MPI_Comm_spawn, is there a way to make the parent "wait" for the child application to have called MPI_Finalize (or terminated), at some point? The rational would be that MPI_Comm_spawn is sort of an MPI equivalent of "fork/execv",
 but I don't see an equivalent of "wait", in the standard. My feeling is that once a child application is spawned, it is supposed to stay alive until the parent calls MPI_Finalize as well. Am I mistaken?<br class="">
<br class="">
Thanks,<br class="">
<br class="">
Matthieu<br class="">
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">discuss
 mailing list     </span><a href="mailto:discuss@mpich.org" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px" target="_blank">discuss@mpich.org</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">To
 manage subscription options or unsubscribe:</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<a href="https://lists.mpich.org/mailman/listinfo/discuss" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>