3.1.4.18. c3po.mpi.MPIWorker module
Contain the class MPIWorker.
- class c3po.mpi.MPIWorker.MPIWorker(physicsDrivers, exchangers, dataManagers, masterProcess, isCollective=False)
Bases:
objectMPIWorkerdefines the behavior of workers in a master/workers MPI paradimg.- __init__(physicsDrivers, exchangers, dataManagers, masterProcess, isCollective=False)
Build a
MPIWorkerobject.- Parameters:
physicsDrivers (list[PhysicsDriver]) – List of
c3po.PhysicsDriver.PhysicsDriver. Only one should not be aMPIRemoteProcess: it is the one the worker is responsible for.exchangers (list[Exchanger]) – List of
c3po.Exchanger.Exchanger. The indices in this list are the numbers identifying thec3po.Exchanger.Exchangerfor the master.dataManagers (list[DataManager]) – List of
c3po.DataManager.DataManager. The indices of this list are the numbers identifying thec3po.DataManager.DataManagerfor the master.masterProcess (MPIRemoteProcess) – A
MPIRemoteProcessidentifying the master process.isCollective (bool) – Put True if the master process uses collective MPI methods (if it has been initialized with a
c3po.mpi.MPICollectiveProcess.MPICollectiveProcessobject as worker).
- answer(data, collectiveOperator=mpi4py.MPI.MIN)
INTERNAL
- checkDataID(idList)
INTERNAL
- getIdNewData()
INTERNAL
- listen()
Make the worker waits for instructions from the master.
The worker gets out of this waiting mode when the master call the terminate method of the related
c3po.mpi.MPIMasterPhysicsDriver.MPIMasterPhysicsDriver.