<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18854"></HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>You will need to use intercomm_merge but you have to
merge them one pair at a time. Example below from an old
mail.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>Rajeev</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>If you have 3 intercommunicators AB_inter, AC_inter,
and AD_inter, you can merge them all into a single<BR>intercommunicator as
follows:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* begin by doing an MPI_Intercomm_merge on AB_inter,
resulting in an<BR>intracommunicator AB_intra.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* then create an intercommunicator between AB on one
side and C on the other<BR>by using MPI_Intercomm_create. Pass AB_intra as the
local_comm on A and B,<BR>MPI_COMM_WORLD as the intracomm on C, and AC_inter as
the peer_comm. This<BR>results in the intercommunicator AB_C_inter.
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* then call MPI_Intercomm_merge on it to create the
intracommunicator<BR>ABC_intra. </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* then call MPI_Intercomm_create to create an
intercommunicator between ABC<BR>and D just as you did with AB and C above.
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* Again do an intercomm_merge. This will give you an
intracommunicator<BR>containing A, B, C, D. </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=573061318-15012010>* If you want an intercommunicator with A in one group
and B,C,D in the<BR>other, as you would get with a single spawn of 3 processes,
you have to call<BR>MPI_Comm_split to split this single communicator into
two<BR>intracommunicators, one containing A and the other containing B,C,D.
Then<BR>call MPI_Intercomm_create to create the
intercommunicator.<BR></SPAN></FONT></DIV><BR>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> mpich-discuss-bounces@mcs.anl.gov
[mailto:mpich-discuss-bounces@mcs.anl.gov] <B>On Behalf Of </B>Francisco
Javier García Blas<BR><B>Sent:</B> Friday, January 15, 2010 11:09
AM<BR><B>To:</B> mpich-discuss@mcs.anl.gov<BR><B>Subject:</B> [mpich-discuss]
New communicator from connect/accept primitives<BR></FONT><BR></DIV>
<DIV></DIV>Hello all,
<DIV><BR></DIV>
<DIV>I wondering the possibility of get a new inter-comunicator from N
communicators, which are results from different calls of mpi_comm_connect or
mpi_comm_accept.</DIV>
<DIV><BR></DIV>
<DIV>My initial solution was first, to get the group of each
inter-communicator with mpi_comm_group, second, to join all the groups into
one bigger and finally, to create a new communicator from the group with the
mpi_comm_create primitive. </DIV>
<DIV><BR></DIV>
<DIV>Currently I am handling a pool of inter - communicators in order to keep
the functionality. However this idea is not suitable for collective and
MPI_ANY_SOURCE sends/recvs.</DIV>
<DIV><BR></DIV>
<DIV>Exist another way to join all the inter-communicator into one?
</DIV>
<DIV><BR></DIV>
<DIV>Any suggestion?</DIV>
<DIV><BR></DIV>
<DIV>Best regards.</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV><SPAN style="FONT-SIZE: 12px" class=Apple-style-span>
<DIV><FONT class=Apple-style-span
color=#000000>--------------------------------------------------</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>Francisco Javier García
Blas</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>Computer Architecture,
Communications and Systems Area.</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>Computer Science Department.
UNIVERSIDAD CARLOS III DE MADRID</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>Avda. de la Universidad,
30</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>28911 Leganés (Madrid),
SPAIN</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>e-mail: <A
href="mailto:fjblas@arcos.inf.uc3m.es">fjblas@arcos.inf.uc3m.es</A></FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>
<A
href="mailto:fjblas@inf.uc3m.es">fjblas@inf.uc3m.es</A></FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>Phone:(+34)
916249118</FONT></DIV>
<DIV><FONT class=Apple-style-span color=#000000>FAX: (+34)
916249129</FONT></DIV>
<DIV><FONT class=Apple-style-span
color=#000000>--------------------------------------------------</FONT></DIV></SPAN></DIV></DIV></SPAN></SPAN></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>