3.1.4.6. c3po.mpi.MPICoupler module

Inheritance diagram of c3po.mpi.MPICoupler

Contain the class MPICoupler.

class c3po.mpi.MPICoupler.MPICoupler(physics, exchangers, dataManagers=[], mpiComm=None)

Bases: Coupler

MPICoupler is the MPI collaborative version of c3po.Coupler.Coupler.

The MPI functionalities are used for some collective operations.

Can replace, without impact, a c3po.Coupler.Coupler for a calculation on a single process, if the MPI environment is available.

__init__(physics, exchangers, dataManagers=[], mpiComm=None)

Build a MPICoupler object.

Has the same form than Coupler.__init__() but can also contain MPIRemote (and MPICollectiveProcess) objects.

When at least one MPIRemote is present, MPICoupler uses collective MPI communications: the object must be built and used in the same way for all the involved processes. They must all share the same communicator,and all the processes of this communicator must be involved.

Parameters:
computeTimeStep()

See Coupler.computeTimeStep().

getIterateStatus()

See Coupler.getIterateStatus().

getMEDCouplingMajorVersion()

See Coupler.getMEDCouplingMajorVersion().

getMPIComm()

(Optional) Return the MPI communicator used by the code for parallel computations.

Returns:

mpi4py communicator.

Return type:

mpi4py.MPI.Comm

getSolveStatus()

See Coupler.getSolveStatus().

getStationaryMode()

See Coupler.getStationaryMode().

initTimeStep(dt)

See Coupler.initTimeStep().

initialize()

See Coupler.initialize().

isMEDCoupling64Bits()

See Coupler.isMEDCoupling64Bits().

isStationary()

See Coupler.isStationary().

setMPIComm(mpicomm)

(Optional) Provide the MPI communicator to be used by the code for parallel computations.

This method must be called before initialize(). The communicator should include all the processes to be used by the code. For a sequential code, the call to setMPIComm() is optional or mpicomm should be None.

Parameters:

mpicomm (mpi4py.MPI.Comm) – mpi4py communicator.

Raises:

AssertionError – If called multiple times or after initialize().