3.1.4.6. c3po.mpi.MPICoupler module
Contain the class MPICoupler.
- class c3po.mpi.MPICoupler.MPICoupler(physics, exchangers, dataManagers=[], mpiComm=None)
Bases:
CouplerMPICoupleris the MPI collaborative version ofc3po.Coupler.Coupler.The MPI functionalities are used for some collective operations.
Can replace, without impact, a
c3po.Coupler.Couplerfor a calculation on a single process, if the MPI environment is available.- __init__(physics, exchangers, dataManagers=[], mpiComm=None)
Build a
MPICouplerobject.Has the same form than
Coupler.__init__()but can also containMPIRemote(andMPICollectiveProcess) objects.When at least one
MPIRemoteis present,MPICoupleruses 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:
physics (list[PhysicsDriver], dict) – List (or dictionary) of
c3po.PhysicsDriver.PhysicsDriverobjects to be coupled.exchangers (list[Exchanger], dict) – List (or dictionary) of
c3po.Exchanger.Exchangerfor the coupling.dataManagers (list[DataManager], dict) – List (or dictionary) of
c3po.DataManager.DataManagerused in the coupling.mpiComm – If not None, forces
MPICouplerto make MPI communications and to use this communicator (can also be done withsetMPIComm()).
- computeTimeStep()
- getIterateStatus()
- getMEDCouplingMajorVersion()
- getMPIComm()
(Optional) Return the MPI communicator used by the code for parallel computations.
- Returns:
mpi4py communicator.
- Return type:
- getSolveStatus()
- getStationaryMode()
- initTimeStep(dt)
- initialize()
See
Coupler.initialize().
- isMEDCoupling64Bits()
- 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 tosetMPIComm()is optional ormpicommshould be None.- Parameters:
mpicomm (mpi4py.MPI.Comm) – mpi4py communicator.
- Raises:
AssertionError – If called multiple times or after
initialize().