Open MPI logo

MPI_Comm_create_group(3) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents

Name

C]MPI_Comm_create_groupR] - Creates a new communicator.

Syntax

C Syntax



C]#include <mpi.h>int MPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm *newcomm)R]Fortran Syntax



C]USE MPI! or the older form: INCLUDE [aq]mpif.h[aq]MPI_COMM_CREATE_GROUP(COMM, GROUP, TAG, NEWCOMM, IERROR) INTEGER COMM, GROUP, TAG, NEWCOMM, IERRORR]Fortran 2008 Syntax



C]USE mpi_f08MPI_Comm_create_group(comm, group, tag, newcomm, ierror) TYPE(MPI_Comm), INTENT(IN) :: comm TYPE(MPI_Group), INTENT(IN) :: group INTEGER, INTENT(IN) :: tag TYPE(MPI_Comm), INTENT(OUT) :: newcomm INTEGER, OPTIONAL, INTENT(OUT) :: ierrorR]Input Parameters

[bu]
C]commR] : Communicator (handle).
[bu]
C]groupR] : Group, which is a subset of the group of comm (handle).
[bu]
C]tagR] : Tag (integer).

Output Parameters

[bu]
C]newcommR] : New communicator (handle).
[bu]
C]IERRORR] : Fortran only: Error status (integer).

Description

C]MPI_Comm_create_groupR] is similar to C]MPI_Comm_createR]; however, C]MPI_Comm_createR] must be called by all processes in the C]groupR] of C]commR], whereas C]MPI_Comm_create_groupR] must be called by all processes in C]groupR], which is a subgroup of the C]groupR] of C]commR]. In addition, C]MPI_Comm_create_groupR] requires that C]commR] is an intracommunicator. C]MPI_Comm_create_groupR] returns a new intracommunicator, C]newcommR], for which the C]groupR] argument defines the communication C]groupR]. No cached information propagates from C]commR] to C]newcommR]. Each process must provide a C]groupR] argument that is a subC]groupR] of the C]groupR] associated with C]commR]; this could be C]MPI_GROUP_EMPTYR]. If a non-empty C]groupR] is specified, then all processes in that C]groupR] must call the function, and each of these processes must provide the same arguments, including a C]groupR] that contains the same members with the same ordering. Otherwise the call is erroneous. If the calling process is a member of the C]groupR] given as the C]groupR] argument, then C]newcommR] is a communicator with C]groupR] as its associated C]groupR]. If the calling process is not a member of C]groupR], e.g., C]groupR] is C]MPI_GROUP_EMPTYR], then the call is a local operation and C]MPI_COMM_NULLR] is returned as C]newcommR].

Notes

C]MPI_Comm_create_groupR] provides a means of making a subset of processes for the purpose of separate MIMD computation, with separate communication space. C]newcommR], which is created by C]MPI_Comm_create_groupR], can be used in subsequent calls to C]MPI_Comm_create_groupR] (or other communicator constructors) to further subdivide a computation into parallel sub-computations. A more general service is provided by C]MPI_Comm_splitR].

Errors

Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with C]MPI_Comm_set_errhandlerR]; the predefined error handler C]MPI_ERRORS_RETURNR] may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.

See Also

C]MPI_Comm_createR](3)


Table of Contents

« Return to documentation listing