Newsgroups: comp.parallel.mpi
From: doss@ERC.MsState.Edu (Nathan E. Doss)
Subject: Re: Creating a superset of an MPI intracommunicator
Organization: Mississippi State University
Date: 2 Feb 1995 23:42:05 GMT
Message-ID: <3grqkd$ep1@NNTP.MsState.Edu>

Jonathan Hardwick (jch@GS69.SP.CS.CMU.EDU) wrote:
: <deleted text>

: Before I start coding, I'd like to check here: is this the recommended
: way of creating a superset of an existing intracommunicator, or is there
: a simpler method that I've missed?

  I think the method you've described is the only choice that doesn't 
  involve synchronization of processes outside of the two merging 
  groups.  The only difficulty lies in how you make each of the 
  intracommunicators that are to be joined aware of each other.  Here's 
  one way to do it:

     MPI_Comm merge_world;
     MPI_Comm sub_comm;
     MPI_Comm inter_comm, merged_comm;

     /* At the beginning of your program, dup the world
        to provide a safe space to create inter-communicators in */
     MPI_Comm_dup (MPI_COMM_WORLD, &merge_world);

     /* Split up sub_comm somehow */

     /* The processes that want to merge sub communicators call this. */
     /* remote_leader is the merge_world rank of the 0th process in */
     /* the other communicator */
     MPI_Intercomm_create( 0, sub_comm, remote_leader, merge_world, 0, 
			    &inter_comm);
     MPI_Intercomm_merge(inter_comm, 0, &merged_comm);

--
Nathan Doss          doss@ERC.MsState.Edu



