<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 7, 2017 at 11:15 AM, Balaji, Pavan <span dir="ltr"><<a href="mailto:balaji@anl.gov" target="_blank">balaji@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div>
<div class="m_-6411825982758373274BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-6411825982758373274PlainText">Hi Dmitriy,<br>
<br>
You should use publish/lookup name for this, instead of relying on manual printing.  I've attached updated server and client codes that do that.  Please see attached.<br>
<br>
You'll need to start the Hydra nameserver for this using:<br>
<br>
% hydra_nameserver<br>
<br>
Once the nameserver has started, you can connect all mpiexecs to it using something like:<br>
<br>
% mpiexec -nameserver localhost ./server 2<br></div></span></font></div></div></blockquote><div><br></div><div>Thanks but we have our own name resolution architecture (which is not manual printing/pasting). This is simple example that's been asked for to isolated the problem and provided, not the actual code. </div><div><br></div><div>The name is guaranteed to be delivered to client verbatim down to the bit. The use is fully consistent with the MPI 3 spec. </div><div><br></div><div>Moreover, we use different ports in the same job multiple times; and we may have multiple ports open at the cluster at the same time (but not in the case of lock-up though), for which this pattern use is just too simplistic in comparison.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-6411825982758373274BodyFragment"><font size="2"><span style="font-size:10pt"><div class="m_-6411825982758373274PlainText">
<br>
Here my nameserver was on the localhost, but you'll need to give the host on which the nameserver is running.  The nameserver is persistent, so you run it once and reuse it for any number of mpiexecs.<br>
<br>
I'm not seeing lockups like you reported, but I tried it at a much smaller scale (4 nodes).</div></span></font></div></div></blockquote><div><br></div><div>yes. Like i said. I am able to achieve lock up state spuriously on 192 core cluster only if i spin up almost all cores (per process) and even then i guess this should be orchestrated in a massively parallel fashion to improve probability of that happening. This is not easy to reproduce; I never saw this happening on less than 140 processes. However it does preclude us from fully utilizing clusters capacities, and it has been fully analyzed to lock up on a completely legitimate sequence of either merge intracom, or barrier call (if inserted after accept) on the intercom returned from accept/connect. At the moment, some % of the jobs just have to be torn down on timeout in such situations. But definitely increases with load and core capacity and becomes extremely unsettling in some jobs.</div><div><br></div><div>We have even more complicated, tree-like process merges into a grid, this is a most simple, naive one (but most prone to spurious lock-ups on a collective-after-accept). And it mostly works... until it doesn't.</div><div><br></div><div><br></div><div> </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-6411825982758373274BodyFragment"><font size="2"><span style="font-size:10pt"><div class="m_-6411825982758373274PlainText"><span class="HOEnZb"><font color="#888888"><br>
<br>
  -- Pavan<br>
<br>
</font></span></div>
</span></font></div><div><div class="h5">
<div class="m_-6411825982758373274BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="m_-6411825982758373274PlainText"><br>
<br>
> On Feb 6, 2017, at 1:27 PM, Dmitriy Lyubimov <<a href="mailto:dlieu.7@gmail.com" target="_blank">dlieu.7@gmail.com</a>> wrote:<br>
> <br>
> Thank you, Kenneth.<br>
> <br>
> Here is a simple C++ equivalent of what i am doing:<br>
> <br>
> server.cpp:<br>
> =============================<br>
> <br>
> #include <iostream><br>
> #include <mpi/mpi.h><br>
> #include <stdlib.h><br>
> <br>
> using namespace std;<br>
> <br>
> // The only argument must be the number of processes in communicator we expect to build.<br>
> int main(int argc, char** argv)<br>
> {<br>
> <br>
>     int np = atoi(argv[1]);<br>
> <br>
>     int ac = 0;<br>
>     MPI_Init(&ac, &argv);<br>
> <br>
>     char portName[MPI_MAX_PORT_NAME];<br>
> <br>
>     MPI_Open_port(MPI_INFO_NULL, portName);<br>
> <br>
>     cout << portName << "\n";<br>
> <br>
>     MPI_Comm intercomm, intracomm = MPI_COMM_SELF;<br>
> <br>
>     // Build an intracom dynamically until n processes are reached.<br>
>     for (int i = 1; i < np; i++) {<br>
> <br>
>         MPI_Comm_accept(portName, MPI_INFO_NULL, 0, intracomm, &intercomm);<br>
> <br>
>         cout << "Accepted.\n";<br>
> <br>
>         MPI_Intercomm_merge(intercomm, false, &intracomm);<br>
> <br>
>         cout << "Merged to an intracom.\n";<br>
> <br>
>         MPI_Comm_free(&intercomm);<br>
>     }<br>
> <br>
>     // Intracomm contains the one we can now use with n-grid.<br>
>     MPI_Comm_free(&intracomm);<br>
> <br>
>     MPI_Close_port(portName);<br>
> <br>
>     MPI_Finalize();<br>
> }<br>
> <br>
> <br>
> client.cpp:<br>
> ==============================<wbr>=<br>
> #include <iostream><br>
> #include <mpi/mpi.h><br>
> #include <stdlib.h><br>
> <br>
> using namespace std;<br>
> <br>
> // This expects intracom size and the port name to connect to.<br>
> // When using with shell, use single quotas to avoid shell substitution.<br>
> int main(int argc, char** argv)<br>
> {<br>
> <br>
>     int ac = 0;<br>
>     MPI_Init(&ac, &argv);<br>
> <br>
>     int np = atoi(argv[1]);<br>
>     char* portName = argv[2];<br>
> <br>
>     cout << "Connecting to " << portName << "\n";<br>
> <br>
>     MPI_Comm intercomm, intracomm;<br>
> <br>
>     MPI_Comm_connect(portName, MPI_INFO_NULL, 0, MPI_COMM_SELF, &intercomm);<br>
> <br>
>     cout << "Connected.\n";<br>
> <br>
>     MPI_Intercomm_merge(intercomm, true, &intracomm);<br>
> <br>
>     cout << "Merged.\n";<br>
> <br>
>     MPI_Comm_free(&intercomm);<br>
> <br>
>     int i;<br>
> <br>
>     MPI_Comm_size(intracomm, &i);<br>
> <br>
>     // Build an intracom dynamically until n processes are reached.<br>
>     for (; i < np; i++) {<br>
> <br>
>         MPI_Comm_accept(portName, MPI_INFO_NULL, 0, intracomm, &intercomm);<br>
> <br>
>         cout << "Accepted.\n";<br>
> <br>
>         MPI_Intercomm_merge(intercomm, false, &intracomm);<br>
> <br>
>         cout << "Merged to an intracom.\n";<br>
> <br>
>         MPI_Comm_free(&intercomm);<br>
>     }<br>
> <br>
>     // Intracomm contains the one we can now use with n-grid.<br>
>     MPI_Comm_free(&intracomm);<br>
> <br>
>     MPI_Finalize();<br>
> }<br>
> <br>
> ============================<br>
> Run example on one machine, intracom size=2 (in this case I have run 3.3a)<br>
> <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ mpic++ server.cpp -o server <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ mpic++ client.cpp -o client <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$  <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$  <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ mpiexec ./server 2 <br>
> tag#0$description#Intel-Kubu$<wbr>port#39210$ifname#127.0.1.1$<br>
> Accepted. <br>
> Merged to an intracom. <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ <br>
> <br>
> (in another shell) <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ mpiexec ./client 2 'tag#0$description#Intel-Kubu$<wbr>port#39210$ifname#127.0.1.1$'
<br>
> Connecting to tag#0$description#Intel-Kubu$<wbr>port#39210$ifname#127.0.1.1$ <br>
> Connected. <br>
> Merged. <br>
> dmitriy@Intel-Kubu:~/projects/<wbr>mpitests$ <br>
> <br>
> First parameter is eventual size of intracom we are trying to build dynamically, and client also needs to know the port reported by server process. So there's therfore 1 server and (n-1) clients that connect to form the intracom.<br>
> <br>
> Now, if i do that for 192 processes on a 192 core cluster (occasionally slightly overloaded in terms of cpu load), I more often get a lock-up than not. The incidence is more frequent for 3.2 than 3.3a2. This cluster has mellanox infiniband.<br>
> <br>
> 3.2 usually locks up on merge intercom call; and 3.3a2 locked up at least once on 2 clients connected and waiting on merge intercom at the same time (but my understanding only one client should be connected at a time, even if there massive connects pending
 from other clients).<br>
> <br>
> Hope this gives a little more material.<br>
> -Dmitriy<br>
> <br>
> <br>
> On Fri, Feb 3, 2017 at 8:40 AM, Kenneth Raffenetti <<a href="mailto:raffenet@mcs.anl.gov" target="_blank">raffenet@mcs.anl.gov</a>> wrote:<br>
> Hi Dmitriy,<br>
> <br>
> MPICH does appear to be reported a process exit/crash in this case. A simple reproducer would be useful to test if that is indeed the cause or if there's something else going on.<br>
> <br>
> I see below that you are using a non-standard MPI binding. If the test case is simple enough, we can try to port it and investigate further.<br>
> <br>
> Ken<br>
> <br>
> On 01/19/2017 06:58 PM, Dmitriy Lyubimov wrote:<br>
> These lock-ups seem to be gone in 3.3a2.<br>
> <br>
> I do occasionally get the following though:<br>
> <br>
> Unknown error class, error stack:<br>
> PMPI_Comm_accept(129).........<wbr>........:<br>
> MPI_Comm_accept(port="tag#0$<wbr>description#<a href="http://aaa.com" target="_blank">aaa.com</a><br>
> <<a>http://aaa.com>$port#36230$<wbr>ifname#192.168.42.99$</a>", MPI_INFO_NULL, ro<br>
> ot=180, comm=0x84000003, newcomm=0x7f3cf681842c) failed<br>
> MPID_Comm_accept(153).........<wbr>........:<br>
> MPIDI_Comm_accept(1244).......<wbr>........:<br>
> MPIR_Get_contextid_sparse_<wbr>group(499)..:<br>
> MPIR_Allreduce_impl(755)......<wbr>........:<br>
> MPIR_Allreduce_intra(414).....<wbr>........:<br>
> MPIDU_Complete_posted_with_<wbr>error(1137): Process failed<br>
> <br>
> What does this message mean? some process just exited/died (like with<br>
> seg fault?)<br>
> <br>
> Thank you.<br>
> -Dmitriy<br>
> <br>
> On Thu, Jan 12, 2017 at 11:55 AM, Dmitriy Lyubimov <<a href="mailto:dlieu.7@gmail.com" target="_blank">dlieu.7@gmail.com</a><br>
> <<a href="mailto:dlieu.7@gmail.com" target="_blank">mailto:dlieu.7@gmail.com</a>>> wrote:<br>
> <br>
>     further debugging shows that it's not actually mergeIntercom that<br>
>     locks up but a pair of send/recv that two nodes decide to execute<br>
>     before MPI_intercom_merge.<br>
> <br>
>     so the total snapshot of the situation is that everyone waits on<br>
>     mergeIntercom except for two processes that wait in send/recv<br>
>     respectively, while majority of others already have entered<br>
>     collective barrier.<br>
> <br>
>     it would seem that this sort of assymetric logic would be<br>
>     acceptable, since the send/recv pair is balanced before the merge is<br>
>     to occur, but in practice it seems to lock up -- increasingly so as<br>
>     the number of participating processes increases. It almost like<br>
>      once collective barrier of certain cardinality is formed,<br>
>     point-to-point messages are not going thru any longer.<br>
> <br>
>     If this scenario begets any ideas, please let me know.<br>
> <br>
>     thank you!<br>
>     -Dmitriy<br>
> <br>
> <br>
> <br>
>     On Wed, Jan 11, 2017 at 9:38 AM, Dmitriy Lyubimov <<a href="mailto:dlieu.7@gmail.com" target="_blank">dlieu.7@gmail.com</a><br>
>     <<a href="mailto:dlieu.7@gmail.com" target="_blank">mailto:dlieu.7@gmail.com</a>>> wrote:<br>
> <br>
>         Maybe it has something to do with the fact that it is stepping<br>
>         thru JVM JNI and that somehow screws threading model of MPI,<br>
>         although it is a single threaded JVM process, and MPI mappings<br>
>         are known to have been done before (e.g., openmpi had an effort<br>
>         towards that).<br>
> <br>
>         Strange thing is that i never had lock up with # of processes<br>
>         under 120 but something changes after that, the spurious<br>
>         condition becomes much more common after that. By the time I am<br>
>         at 150 processes in the intercom, I am almost certain to have a<br>
>         merge lock-up.<br>
> <br>
> <br>
>         On Wed, Jan 11, 2017 at 9:34 AM, Dmitriy Lyubimov<br>
>         <<a href="mailto:dlieu.7@gmail.com" target="_blank">dlieu.7@gmail.com</a> <<a href="mailto:dlieu.7@gmail.com" target="_blank">mailto:dlieu.7@gmail.com</a>>> wrote:<br>
> <br>
>             Thanks.<br>
>             it would not be easy for me to do immediately as i am using<br>
>             proprietary scala binding api for MPI.<br>
> <br>
>             it would help me to know if there's a known problem like<br>
>             that in the past, or generally mergeIntercomm api is known<br>
>             to work on hundreds of processes. Sounds like there are no<br>
>             known issues with that.<br>
> <br>
> <br>
> <br>
>             On Tue, Jan 10, 2017 at 11:53 PM, Oden, Lena <<a href="mailto:loden@anl.gov" target="_blank">loden@anl.gov</a><br>
>             <<a href="mailto:loden@anl.gov" target="_blank">mailto:loden@anl.gov</a>>> wrote:<br>
> <br>
>                 Hello Dmittiy,<br>
> <br>
>                 can you maybe create a simple example-program to<br>
>                 reproduce this failure?<br>
>                 It is also often easier also to look at a code example<br>
>                 to identify a problem.<br>
> <br>
>                 Thanks,<br>
>                 Lena<br>
>                 > On Jan 11, 2017, at 2:45 AM, Dmitriy Lyubimov<br>
>                 <<a href="mailto:dlieu.7@gmail.com" target="_blank">dlieu.7@gmail.com</a> <<a href="mailto:dlieu.7@gmail.com" target="_blank">mailto:dlieu.7@gmail.com</a>>> wrote:<br>
>                 ><br>
>                 > Hello,<br>
>                 ><br>
>                 > (mpich 3.2)<br>
>                 ><br>
>                 > I have a scenario when i add a few extra processes do<br>
>                 existing intercom.<br>
>                 ><br>
>                 > it works as a simple loop --<br>
>                 > (1) n processes accept on n-intercom<br>
>                 > (2) 1 process connects<br>
>                 > (3) intracom is merged into n+1 intercom, intracom and<br>
>                 n-intercom are closed<br>
>                 > (4) repeat 1-3 as needed.<br>
>                 ><br>
>                 > Occasionally, i observe that step 3 spuriously locks<br>
>                 up (once i get in the range of 100+ processes). From<br>
>                 what i can tell, all processes in step 3 are accounted<br>
>                 for, and are waiting on the merge, but nothing happens.<br>
>                 the collective barrier locks up.<br>
>                 ><br>
>                 > I really have trouble resolving this issue, any ideas<br>
>                 are appreciated!<br>
>                 ><br>
>                 > Thank you very much.<br>
>                 > -Dmitriy<br>
>                 ><br>
>                 ><br>
>                 > ______________________________<wbr>_________________<br>
>                 > discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
>                 <<a href="mailto:discuss@mpich.org" target="_blank">mailto:discuss@mpich.org</a>><br>
>                 > To manage subscription options or unsubscribe:<br>
>                 > <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
>                 <<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a>><br>
> <br>
>                 ______________________________<wbr>_________________<br>
>                 discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
>                 <<a href="mailto:discuss@mpich.org" target="_blank">mailto:discuss@mpich.org</a>><br>
>                 To manage subscription options or unsubscribe:<br>
>                 <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
>                 <<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a>><br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> ______________________________<wbr>_________________<br>
> discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
> <br>
> ______________________________<wbr>_________________<br>
> discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
> <br>
> ______________________________<wbr>_________________<br>
> discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br>
<br>
</div>
</span></font></div>
</div></div></div>

<br>______________________________<wbr>_________________<br>
discuss mailing list     <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.mpich.org/<wbr>mailman/listinfo/discuss</a><br></blockquote></div><br></div></div>