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 master 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.

Constructor for operator.

Parameters

cs (CaseSettings object) – Global settings that define the run.

Raises

OSError – If unable to create the FAST_PATH directory.

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 master node in a parallel run. The nodes will sit, waiting for a “worker command”. When this comes (from a bcast from the master), 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.

_resetWorker()[source]

Clear out the reactor on the workers to start anew.

Notes

This was made to help minimize the amount of RAM that is used during some gigantic long-running cases. Resetting after building copies of reactors or transforming their geometry is one approach. We hope to implement more efficient solutions in the future.

Warning

This should build empty non-core systems too.

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

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