Open MPI logo

MPI_Comm_create(3) man page (version 5.0.0rc2)

  |   Home   |   Support   |   FAQ   |  

« Return to documentation listing

Table of Contents

Name

C]MPI_Comm_createR] - Creates a new communicator.

Syntax

C Syntax



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



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



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

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

Output Parameters

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

Description

This function creates a new communicator C]newcommR] with communication C]groupR] defined by C]groupR] and a new context. The function sets C]newcommR] to a new communicator that spans all the processes that are in the C]groupR]. It sets C]newcommR] to C]MPI_COMM_NULLR] for processes that are not in the C]groupR]. Each process must call with a C]groupR] argument that is a subgroup of the C]groupR] associated with C]commR]; this could be C]MPI_GROUP_EMPTYR]. The processes may specify different values for the C]groupR] argument. If a process calls with a non-empty C]groupR], then all processes in that C]groupR] must call the function with the same C]groupR] as argument, that is: the same processes in the same order. Otherwise the call is erroneous.

Notes

C]MPI_Comm_createR] 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_createR], can be used in subsequent calls to C]MPI_Comm_createR] (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_splitR](3) C]MPI_Intercomm_createR](3) C]MPI_Comm_create_groupR](3)


Table of Contents

« Return to documentation listing