armi.tests.test_mpiFeatures module

Tests for featurest that need MPI, and thus require special testing.

These tests will be generally ignored by pytest if you are trying to run them in an environment without MPI installed.

To run these tests from the commandline, install MPI, mpi4py, and do:

mpiexec -n 2 python -m pytest armi/tests/test_mpiFeatures.py or mpiexec.exe -n 2 python -m pytest armi/tests/test_mpiFeatures.py

class armi.tests.test_mpiFeatures.FailingInterface1(r, cs)[source]

Bases: armi.interfaces.Interface

utility classes to make sure the logging system fails properly.

Construct an interface.

The r and cs arguments are required, but may be None, where appropriate for the specific Interface implementation.

Parameters
  • r (Reactor) – A reactor to attach to

  • cs (Settings) – Settings object to use

Raises

RuntimeError – Interfaces derived from Interface must define their name

name: Optional[str] = 'failer'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

interactEveryNode(cycle, node)[source]
class armi.tests.test_mpiFeatures.FailingInterface2(r, cs)[source]

Bases: armi.interfaces.Interface

utility class to make sure the logging system fails properly.

Construct an interface.

The r and cs arguments are required, but may be None, where appropriate for the specific Interface implementation.

Parameters
  • r (Reactor) – A reactor to attach to

  • cs (Settings) – Settings object to use

Raises

RuntimeError – Interfaces derived from Interface must define their name

name: Optional[str] = 'failer'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

interactEveryNode(cycle, node)[source]
class armi.tests.test_mpiFeatures.FailingInterface3(r, cs)[source]

Bases: armi.interfaces.Interface

fails on worker operate.

Construct an interface.

The r and cs arguments are required, but may be None, where appropriate for the specific Interface implementation.

Parameters
  • r (Reactor) – A reactor to attach to

  • cs (Settings) – Settings object to use

Raises

RuntimeError – Interfaces derived from Interface must define their name

name: Optional[str] = 'failer'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

fail()[source]
interactEveryNode(c, n)[source]
workerOperate(cmd)[source]
class armi.tests.test_mpiFeatures.MpiOperatorTests(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing the MPI parallelization operator.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_basicOperatorMPI()[source]
test_primaryException()[source]
test_primaryCritical()[source]
class armi.tests.test_mpiFeatures.BcastAction1[source]

Bases: armi.mpiActions.MpiAction

invokeHook()[source]
class armi.tests.test_mpiFeatures.BcastAction2[source]

Bases: armi.mpiActions.MpiAction

invokeHook()[source]
class armi.tests.test_mpiFeatures.MpiDistributeStateTests(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_distributeSettings()[source]

Under normal circumstances, we would not test “private” methods; however, distributeState is quite complicated.

test_distributeReactor()[source]

Under normal circumstances, we would not test “private” methods; however, distributeState is quite complicated.

test_distributeInterfaces()[source]

Under normal circumstances, we would not test “private” methods; however, distributeState is quite complicated.

test_distributeState()[source]
test_compileResults()[source]
class armi.tests.test_mpiFeatures.MpiPathToolsTests(methodName='runTest')[source]

Bases: unittest.case.TestCase

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_cleanPathMpi()[source]