3.1.4.8. c3po.mpi.MPIExchanger module

Inheritance diagram of c3po.mpi.MPIExchanger

Contain the classes MPIExchanger and MPIShortcutToData. MPIShortcutToData is for internal use only.

class c3po.mpi.MPIExchanger.MPIExchanger(method, fieldsToGet, fieldsToSet, valuesToGet=[], valuesToSet=[], exchangeWithFiles=False, mpiComm=None)

Bases: LocalExchanger

MPIExchanger is the MPI version of c3po.LocalExchanger.LocalExchanger.

MPIExchanger can replace, without impact, a c3po.LocalExchanger.LocalExchanger for a calculation on a single process, if the MPI environment is available.

__init__(method, fieldsToGet, fieldsToSet, valuesToGet=[], valuesToSet=[], exchangeWithFiles=False, mpiComm=None)

Build a MPIExchanger object.

The constructor has the same form than LocalExchanger.__init__() with two additional optionnal parameters: exchangeWithFiles and mpiComm.

MPIExchanger must be built in the same way for all the processes involved in the exchanges. Likewise, the exchange() method must be called at the same time by all processes.

The first parameter, method, can be either a c3po.mpi.mpiExchangeMethods.MPIExchangeMethod.MPIExchangeMethod or not:

  • In the first case, the exchange method has to deal with data exchanges between MPI processes (in addition to local data processing such as unit change). MPIRemoteProcess and MPIRemoteProcesses are accepted, but not MPICollectiveProcess.

  • In the second case, these exchanges between MPI processes are done by MPIExchanger. The class manages MPI exchanges and then uses the local exchange method with the mother class. In this case, it is assumed that an object is either held by a single process (and is replace by a MPIRemoteProcess in others), or collectively (MPICollectiveProcess). When there is an MPICollectiveProcess on the set side, all the processes of the communicator of this object must be involved in the exchanges. MPIRemoteProcesses are accepted only if no exchange are required.

Parameters:
clean()

See c3po.Exchanger.clean().

exchange()

Trigger the exchange of data.

Must be called at the same time by all processes.

class c3po.mpi.MPIExchanger.MPIShortcutToData(containerToSet)

Bases: object

INTERNAL

__init__(containerToSet)

INTERNAL

clean()

INTERNAL

get()

INTERNAL

getFieldTemplate()

INTERNAL

set(something)

INTERNAL

store(something)

INTERNAL