NAME
MMPPIICCoommmmggeettppaarreenntt - Returns the parent intercommunicator of current
spawned process. SSYYNNTTAAXX CC SSyynnttaaxx#include
int MPICommgetparent(MPIComm *parent) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h'MPICOMMGETPARENT(PARENT, IERROR)
INTEGER PARENT, IERROR
CC++++ SSyynnttaaxx#include
static MPI::Intercomm MPI::Comm::Getparent() OOUUTTPPUUTT PPAARRAAMMEETTEERRSS parent The parent communicator (handle).IERROR Fortran only: Error status (integer).
DESCRIPTION
If a process was started with MPICommspawn or MPICommspawnmulti-
ple, MPICommgetparent returns the "parent" intercommunicator of the current process. This parent intercommunicator is created implicitly inside of MPIInit and is the same intercommunicator returned by the spawn call made in the parents. If the process was not spawned, MPICommgetparent returns MPICOMMNULL. After the parent communicator is freed or disconnected, MPICommgetparent returns MPICOMMNULL. NNOOTTEESS MPICommgetparent returns a handle to a single intercommunicator. Calling MPICommgetparent a second time returns a handle to the same intercommunicator. Freeing the handle with MPICommdisconnect or MPICommfree will cause other references to the intercommunicator tobecome invalid (dangling). Note that calling MPICommfree on the par-
ent communicator is not useful. 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
MPICommspawn MPICommspawnmultiple Open MPI 1.2 September 2006 MPICommgetparent(3OpenMPI)