<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Mohammad,
<div class=""><br class="">
</div>
<div class="">I was wrong in my answer. The same issue was discussed last year, and the problem was fixed after mpich-3.1.3. Please refer <a href="http://lists.mpich.org/pipermail/discuss/2015-January/003660.html" class="">http://lists.mpich.org/pipermail/discuss/2015-January/003660.html</a></div>
<div class=""><br class="">
</div>
<div class="">Can you try your code with a recent version of mpich?</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Sangmin</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Jan 4, 2016, at 8:09 PM, Seo, Sangmin <<a href="mailto:sseo@anl.gov" class="">sseo@anl.gov</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hi Mohammad,</div>
<div class=""><br class="">
</div>
<div class="">It seems the same port name can be used only once, since the MPI 3.1 standard (p. 419, line 31) says "A port name may be reused after it is freed with MPI_CLOSE_PORT and released by the system.” Can you try close the port and open it again to
 establish a new connection? If it doesn’t work, could you send us your actual code (if possible, please send us a simplified version of your code)?</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Sangmin</div>
<div class=""><br class="">
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Dec 29, 2015, at 11:44 AM, Mohammad Javad Rashti <<a href="mailto:mjrashti@gmail.com" class="">mjrashti@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi,
<div class="">Using mpich-3.1.2, we are trying to create a multi-process multi-node MPI job with the client-server model but we are having issues creating the global communicator we need.</div>
<div class=""><br class="">
</div>
<div class="">We cannot use mpiexec to launch the MPI processes; they are launched by a different daemon and we want them to join a group and use MPI after they are launched.<br class="">
</div>
<div class="">
<div class="">We chose to use a server to publish a name/port and wait on a known number of clients to connect. The goal is to create an intracommunicator among all the clients and the server, and start normal MPI communication (not sure whether there is a
 better way to accomplish this goal?).</div>
<div class=""><b class=""><br class="">
</b></div>
<div class=""><b class="">The problem </b>is that the first client connects fine, but the subsequent clients block. </div>
</div>
<div class=""><br class="">
</div>
<div class="">The <b class="">simplified method </b>that we are using is here:</div>
<div class=""><br class="">
</div>
<div class=""><b class=""> ------------------- Server -----------------</b></div>
<div class=""><br class="">
</div>
<div class="">- Call <i class="">MPI_Open_port(MPI_INFO_NULL, port_name)</i></div>
<div class=""><i class=""><br class="">
</i></div>
<div class="">- Call <i class="">MPI_Publish_name(service_name, MPI_INFO_NULL, port_name)</i><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">- clients = 0</div>
<div class=""><br class="">
</div>
<div class="">Loop until clients = MAX_CLIENTS:</div>
<div class=""><br class="">
</div>
<div class="">   if ( !clients )</div>
<div class="">       - Call <i class="">MPI_Comm_accept(port_name,MPI_INFO_NULL,0,MPI_COMM_FELF,&new_ircomm)</i><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">   else</div>
<div class="">       - Call <i class="">MPI_Comm_accept(port_name,MPI_INFO_NULL,0,previous_iacomm,&new_ircomm)</i></div>
<div class="">  </div>
<div class="">   - Call <i class="">MPI_Intercomm_merge(new_ircomm, 0, &new_iacomm)</i></div>
<div class=""><i class=""><br class="">
</i></div>
<div class="">   - previous_iacomm = new_iacomm</div>
<div class=""><br class="">
</div>
<div class="">   - clients ++</div>
<div class=""><br class="">
</div>
<div class="">end Loop</div>
<div class=""><br class="">
</div>
<div class=""><b class="">---------------- Client ---------------</b></div>
<div class=""><br class="">
</div>
<div class="">- Call <i class="">MPI_Lookup_name(service_name, MPI_INFO_NULL, port_name)</i></div>
<div class=""><br class="">
</div>
<div class="">- Call <i class="">MPI_Comm_connect(port_name, MPI_INFO_NULL, 0, MPI_COMM_SELF, &new_ircomm)</i></div>
<div class=""><br class="">
</div>
<div class="">- Call <i class="">MPI_Intercomm_merge(new_ircomm, 1 , &new_iacomm)</i><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">- previous_iacomm <i class="">= </i>new_iacomm</div>
<div class=""><br class="">
</div>
<div class="">Loop for all clients connecting after me:</div>
<div class=""><br class="">
</div>
<div class="">    - Call <i class="">MPI_Comm_accept(port_name,MPI_INFO_NULL,0,previous_iacomm,&new_ircomm)</i></div>
<div class=""><br class="">
</div>
<div class="">    - Call <i class="">MPI_Intercomm_merge(new_ircomm, 0, &new_iacomm)</i></div>
<div class="">    </div>
<div class="">    - previous_iacomm = new_iacomm</div>
<div class=""><br class="">
</div>
<div class="">end Loop</div>
<div class=""><br class="">
</div>
<div class="">----------------------------------</div>
<div class=""><br class="">
</div>
<div class=""><b class="">Note </b>that MPI report states that MPI_Comm_accept is collective over the calling communicator, that's why we are calling it by the server and all previously connected clients.</div>
<div class=""><br class="">
</div>
<div class=""><b class="">The problem we are having </b>is that the first client connects fine, but the subsequent clients block on MPI_Comm_connect. Also the server and previously connected clients block on MPI_Comm_accept.<br class="">
</div>
<div class="">
<div class=""> </div>
<div class="">(the server does not block only if we use MPI_COMM_SELF for all accept calls, but that does not help us creating the global intracomm that we want.</div>
</div>
<div class=""><br class="">
</div>
<div class="">I suspect that we are missing something in our usage of MPI_Comm_accept. Any insight is helpful and appreciated. I can send the actual C code if needed.</div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">Mohammad</div>
</div>
_______________________________________________<br class="">
discuss mailing list     <a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
To manage subscription options or unsubscribe:<br class="">
<a href="https://lists.mpich.org/mailman/listinfo/discuss" class="">https://lists.mpich.org/mailman/listinfo/discuss</a></div>
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
discuss mailing list     <a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
To manage subscription options or unsubscribe:<br class="">
<a href="https://lists.mpich.org/mailman/listinfo/discuss" class="">https://lists.mpich.org/mailman/listinfo/discuss</a></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>