next up previous
Next: Miscellaneous Functions Up: MPI Overview Previous: Collective Communication Functions

Communicator Manipulation Functions

The two communicator manipulation functions implemented by MPISIM are MPI_Comm_dup and MPI_Comm_split. They have the following prototypes:

int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm)
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm 
*newcomm)
MPI_Comm_dup duplicates the communicator comm, and returns a pointer to the new communicator in newcomm. This is implemented as a globally synchronizing call, since if it were not, there would have to be a provision for buffering messages for communicators that have not yet been created.

MPI_Comm_split splits the communicator comm into multiple subgroups, each forming a new communicator. All processes with the same value of color get grouped into to the same new communicator. Their ranks in the new communicator are defined by the value key, and ties are broken according to their rank in comm. Each process is returned a pointer to the new communicator it is a member of, upon completion of the call. The existing communicator is not destroyed. As MPI_Comm_dup, MPI_Comm_split is also a globally synchronizing call.



next up previous
Next: Miscellaneous Functions Up: MPI Overview Previous: Collective Communication Functions



Andy Kahn
Wed Jun 25 20:28:02 PDT 1997