armi.operators.operatorMPI module

The MPI-aware variant of the standard ARMI operator.

See Operator for the parent class.

This sets up the main Operator on the primary MPI node and initializes worker processes on all other MPI nodes. At certain points in the run, particular interfaces might call into action all the workers. For example, a depletion or subchannel T/H module may ask the MPI pool to perform a few hundred independent physics calculations in parallel. In many cases, this can speed up the overall execution of an analysis manyfold, if a big enough computer or computer cluster is available.

Notes

This is not yet smart enough to use shared memory when the MPI tasks are on the same machine. Everything goes through MPI. This can be optimized as needed.

class armi.operators.operatorMPI.OperatorMPI(cs)[source]

Bases: armi.operators.operator.Operator

MPI-aware Operator.

operate()[source]

Operate method for all nodes.

Calls _mainOperate or workerOperate depending on which MPI rank we are, and handles errors.

workerOperate()[source]

The main loop on any worker MPI nodes.

Notes

This method is what worker nodes are in while they wait for instructions from the primary node in a parallel run. The nodes will sit, waiting for a “worker command”. When this comes (from a bcast from the primary), a set of if statements are evaluated, with specific behaviors defined for each command. If the operator doesn’t understand the command, it loops through the interface stack to see if any of the interfaces understand it.

Originally, “magic strings” were broadcast, which were handled either here or in one of the interfaces’ workerOperate methods. Since then, the mpiActions system has been devised which just broadcasts MpiAction objects. Both methods are still supported.

See also

armi.mpiActions

MpiAction information

armi.interfaces.workerOperate

interface-level handling of worker commands.

static workerQuit()[source]
collapseAllStderrs()[source]

Takes all the individual stderr files from each processor and arranges them nicely into one file