<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>MPI_Comm_split calls Allgather internally in many implementations...</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Jeff<br><br>Sent from my iPhone</div><div><br>On Dec 15, 2016, at 5:15 PM, Martin Schulz <<a href="mailto:schulzm@llnl.gov">schulzm@llnl.gov</a>> wrote:<br><br></div><blockquote type="cite"><div><div><div><div>Hi Guillaume,</div><div><br></div><div>Just to add to George’s suggestion and following the same idea – instead of the Allgather, which could cause scalability problems, you could just do a Reduce or Allreduce with all processes with rank 0 in the new communicator contributing 1 and the rest 0 and then use an add as the reduction operator.</div><div><br></div><div>Martin</div><div><br></div><div><br></div><div><div style="font-family: Consolas; font-size: medium;">________________________________________________________________________</div><div style="font-family: Consolas; font-size: medium;">Martin Schulz, <a href="mailto:schulzm@llnl.gov">schulzm@llnl.gov</a>, <a href="http://scalability.llnl.gov/">http://scalability.llnl.gov/</a></div><div style="font-family: Consolas; font-size: medium;">CASC @ Lawrence Livermore National Laboratory, Livermore, USA</div><div><br></div></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> <<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org">mpi-forum-bounces@lists.mpi-forum.org</a>> on behalf of George Bosilca <<a href="mailto:bosilca@icl.utk.edu">bosilca@icl.utk.edu</a>><br><span style="font-weight:bold">Reply-To: </span> Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Date: </span> Thursday, December 15, 2016 at 11:41 AM<br><span style="font-weight:bold">To: </span> Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Subject: </span> Re: [Mpi-forum] MPI_Comm_split_type question<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Guillaume,
<div class=""><br class=""></div><div class="">If I understand you correctly you are trying to figure out how many unique groups (and therefore communicators) were globally created as a result of an MPI_Comm_split_type operation. Unfortunately, depending on the type passed to this function
 (there is a single one defined by MPI, but in Open MPI we support several extensions), the resulting communicator can be created without the need for global knowledge, and thus it is impossible to know how many have communicators have been create in total.</div><div class=""><br class=""></div><div class="">To extend on what JeffH proposed, you can count the resulting number of communicators by doing an MPI_Allgather on the initial communicator on a data where each participant provide their rank in the newly created communicator (then returned by
 the MPI_Comm_split* operation), and then counting the number of 0.</div><div class=""><br class=""></div><div class="">  George.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 15, 2016, at 14:05 , Jeff Hammond <<a href="mailto:jeff.science@gmail.com" class="">jeff.science@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><br class="Apple-interchange-newline"><br class=""><div class="gmail_quote">On Thu, Dec 15, 2016 at 10:29 AM, Guillaume Mercier<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:guillaume.mercier@u-bordeaux.fr" target="_blank" class="">guillaume.mercier@u-bordeaux.fr</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class="">
Hi Jeff,<span class=""><br class=""><br class="">
On 15/12/2016 18:48, Jeff Hammond wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
The number of output communicators from MPI_Comm_split(_type) is always<br class="">
one.<br class=""></blockquote><br class=""></span>Yes, obviously.<span class=""><br class=""><br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
Different ranks may get different outputs, but one cannot transfer<br class="">
a communicator object from one rank to another.<br class=""></blockquote><br class=""></span>That's my issue actually.<span class=""><br class=""><br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
If you want to do how many total output communicators there are, you can<br class="">
perform an MPI_Allgather on the color arguments and see how many unique<br class="">
values there are.<br class=""></blockquote><br class=""></span>I'm not sure about that: tae the case of MPI_Comm_split_type with<br class="">
MPI_COMM_TYPE_SHARED. According to tha standards :"this type splits<br class="">
the communicator into subcommunicators each of which can create  a shared memory region".<br class="">
So, there is only one color, but several subcommunicators.<br class="">
Or am I understanding this the wrong way?<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">Each rank gets its own subcommunicator object that captures the ranks of the shared memory domain, as supported by MPI_Win_allocate_shared.</div><div class=""><br class=""></div><div class="">I'm still not sure I understand what the issue is.  What are you trying to do?</div><div class=""><br class=""></div><div class="">Jeff</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
Regards<span class="HOEnZb"><font color="#888888" class=""><br class="">
Guillaume</font></span><div class="HOEnZb"><div class="h5"><br class="">
______________________________<wbr class="">_________________<br class="">
mpi-forum mailing list<br class=""><a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank" class="">mpi-forum@lists.mpi-forum.org</a><br class=""><a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-forum" rel="noreferrer" target="_blank" class="">https://lists.mpi-forum.org/ma<wbr class="">ilman/listinfo/mpi-forum</a><br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>
--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Jeff Hammond<br class=""><a href="mailto:jeff.science@gmail.com" target="_blank" class="">jeff.science@gmail.com</a><br class=""><a href="http://jeffhammond.github.io/" target="_blank" class="">http://jeffhammond.github.io/</a></div></div></div><span style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">mpi-forum
 mailing list</span><br style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:mpi-forum@lists.mpi-forum.org" style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">mpi-forum@lists.mpi-forum.org</a><br style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-forum" style="font-family: CourierNewPSMT; font-size: 12px; font-style: normal; font-variant-caps: 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.mpi-forum.org/mailman/listinfo/mpi-forum</a></div></blockquote></div><br class=""></div></div></div></span>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>mpi-forum mailing list</span><br><span><a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a></span><br><span><a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-forum">https://lists.mpi-forum.org/mailman/listinfo/mpi-forum</a></span></div></blockquote></body></html>