<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">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>
<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).<br>
<br>
-- Pavan<br>
<br>
</div>
</span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
<br>
> On Feb 6, 2017, at 1:27 PM, Dmitriy Lyubimov <dlieu.7@gmail.com> 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>
> ===============================<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/mpitests$ mpic++ server.cpp -o server <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ mpic++ client.cpp -o client <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ mpiexec ./server 2 <br>
> tag#0$description#Intel-Kubu$port#39210$ifname#127.0.1.1$<br>
> Accepted. <br>
> Merged to an intracom. <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ <br>
> <br>
> (in another shell) <br>
> dmitriy@Intel-Kubu:~/projects/mpitests$ mpiexec ./client 2 'tag#0$description#Intel-Kubu$port#39210$ifname#127.0.1.1$'
<br>
> Connecting to tag#0$description#Intel-Kubu$port#39210$ifname#127.0.1.1$ <br>
> Connected. <br>
> Merged. <br>
> dmitriy@Intel-Kubu:~/projects/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 <raffenet@mcs.anl.gov> 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).................:<br>
> MPI_Comm_accept(port="tag#0$description#aaa.com<br>
> <<a href="http://aaa.com>$port#36230$ifname#192.168.42.99$">http://aaa.com>$port#36230$ifname#192.168.42.99$</a>", MPI_INFO_NULL, ro<br>
> ot=180, comm=0x84000003, newcomm=0x7f3cf681842c) failed<br>
> MPID_Comm_accept(153).................:<br>
> MPIDI_Comm_accept(1244)...............:<br>
> MPIR_Get_contextid_sparse_group(499)..:<br>
> MPIR_Allreduce_impl(755)..............:<br>
> MPIR_Allreduce_intra(414).............:<br>
> MPIDU_Complete_posted_with_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 <dlieu.7@gmail.com<br>
> <<a href="mailto:dlieu.7@gmail.com">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 <dlieu.7@gmail.com<br>
> <<a href="mailto:dlieu.7@gmail.com">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>
> <dlieu.7@gmail.com <<a href="mailto:dlieu.7@gmail.com">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 <loden@anl.gov<br>
> <<a href="mailto:loden@anl.gov">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>
> <dlieu.7@gmail.com <<a href="mailto:dlieu.7@gmail.com">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>
> > _______________________________________________<br>
> > discuss mailing list discuss@mpich.org<br>
> <<a href="mailto:discuss@mpich.org">mailto:discuss@mpich.org</a>><br>
> > To manage subscription options or unsubscribe:<br>
> > <a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
> <<a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a>><br>
> <br>
> _______________________________________________<br>
> discuss mailing list discuss@mpich.org<br>
> <<a href="mailto:discuss@mpich.org">mailto:discuss@mpich.org</a>><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
> <<a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a>><br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> discuss mailing list discuss@mpich.org<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
> <br>
> _______________________________________________<br>
> discuss mailing list discuss@mpich.org<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
> <br>
> _______________________________________________<br>
> discuss mailing list discuss@mpich.org<br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mpich.org/mailman/listinfo/discuss">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
<br>
</div>
</span></font></div>
</body>
</html>