NAME
MMPPIICCaarrttssuubb - Partitions a communicator into subgroups, which form
lower-dimensional Cartesian subgrids.
SSYYNNTTAAXX CC SSyynnttaaxx#include
int MPICartsub(MPIComm comm, int *remaindims, MPIComm *commnew) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h'MPICARTSUB(COMM, REMAINDIMS, COMMNEW, IERROR)
INTEGER COMM, COMMNEW, IERROR
LOGICAL REMAINDIMS(*) CC++++ SSyynnttaaxx#include
Cartcomm Cartcomm::Sub(const bool remaindims[]) const IINNPPUUTT PPAARRAAMMEETTEERRSS comm Communicator with Cartesian structure (handle). remaindimsThe ith entry of remaindims specifies whether the ith dimen-
sion is kept in the subgrid (true) or is dropped (false) (logical vector). OOUUTTPPUUTT PPAARRAAMMEETTEERRSS commnew Communicator containing the subgrid that includes the calling process (handle).IERROR Fortran only: Error status (integer).
DESCRIPTION
If a Cartesian topology has been created with MPICartcreate, the function MPICartsub can be used to partition the communicator groupinto subgroups that form lower-dimensional Cartesian subgrids, and to
build for each subgroup a communicator with the associated subgrid Cartesian topology. (This function is closely related to MPICommsplit.) EExxaammppllee:: Assume that MPICartcreate( ..., comm) has defined a (2 x 3 x 4) grid. Let remaindims = (true, false, true). Then a call to MPICartsub(comm, remaindims, commnew) will create three communicators, each with eight processes in a 2 x 4 Cartesian topology. If remaindims = (false, false, true) then the callto MPICartsub(comm, remaindims, commnew) will create six nonover-
lapping communicators, each with four processes, in a one-dimensional
Cartesian topology. EERRRROORRSS Almost all MPI routines return an error value; C routines as the valueof the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set toMPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object. 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 withMPICommseterrhandler; the predefined error handler MPIERRORSRETURN
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
MPICartcreate MPICommsplit Open MPI 1.2 September 2006 MPICartsub(3OpenMPI)