MPI_Intercomm_create
--- Creates an intercommuncator from two intracommunicators
Input Paramters
- local_comm
- Local (intra)communicator
- local_leader
- Rank in local_comm of leader (often 0)
- peer_comm
- Remote (intra)communicator
- remote_leader
- Rank in peer_comm of leader (often 0)
- tag
- Message tag to use in constructing intercommunicator; if multiple
MPI_Intercomm_creates are being made, they should use different tags (more
precisely, ensure that the local and remote leaders are using different
tags for each MPI_intercomm_create).
Output Parameter
- comm_out
- Created intercommunicator
int MPI_Intercomm_create ( local_comm, local_leader, peer_comm,
remote_leader, tag, comm_out )
Algorithm
- 1)
- Allocate a send context, an inter-coll context, and an intra-coll context
- 2)
- Send "send_context" and lrank_to_grank list from local comm group
if I'm the local_leader.
- 3)
- If I'm the local leader, then wait on the posted sends and receives
to complete. Post the receive for the remote group information and
wait for it to complete.
- 4)
- Broadcast information received from the remote leader.
- 5)
- Create the inter_communicator from the information we now have.
- An
- inter-communicator ends up with three levels of communicators.
The inter-communicator returned to the user, a "collective"
inter-communicator that can be used for safe communications between
local ∧ remote groups, and a collective intra-communicator that can
be used to allocate new contexts during the merge and dup operations.
For the resulting inter-communicator, comm_out
comm_out = inter-communicator
comm_out->comm_coll = "collective" inter-communicator
comm_out->comm_coll->comm_coll = safe collective intra-communicator
Synopsis
#include "mpi.h"
int MPI_Intercomm_create ( local_comm, local_leader, peer_comm,
remote_leader, tag, comm_out )
MPI_Comm local_comm;
int local_leader;
MPI_Comm peer_comm;
int remote_leader;
int tag;
MPI_Comm *comm_out;
Location: ic_create.c