armi package

Welcome to the Advanced Reactor Modeling Interface (ARMI).

This module initializes the ARMI platform. The bootstrap process is broken into several phases:

  • Import fundamental dependencies in Python library and some third-party libs

  • Investigate environment: Check Python version, check code version, check MPI situation, check for TTY/GUI/interactivity,

  • Set up temp dirs

  • Set up printout table formats (in preparation of logging info)

  • Initialize all possible nuclide objects in the nuclide directory

  • Discover and register available built-in plugins (custom ones registered after input available)

  • Discover and define all potential configuration settings from available plugins

  • Read input files

  • Update nuclide directory with depletion info based on config

  • Discover and define all state Parameters on data model (possibly dependent on config)

  • Discover Entry points from plugins

  • Choose entry point based on user command

If using the run entry point, additional work is done:

  • Build reactor model based on input

  • Build operator object with specific calculation loop

  • Build ordered interface stack based on configuration settings

  • Begin looping over interface stack, operating upon data model according to operator design

  • Loop until complete

  • Wrap up

  • Quit

armi.isStableReleaseVersion(version=None)[source]

Determine if the version should be considered a stable release

armi.disconnectAllHdfDBs()[source]

Forcibly disconnect all instances of HdfDB objects

Notes

This is a hack to help ARMI exit gracefully when the garbage collector and h5py have issues destroying objects. After lots of investigation, the root cause for why this was having issues was never identified. It appears that when several HDF5 files are open in the same run (e.g. when calling armi.init() multiple times from a post-processing script), when these h5py File objects were closed, the garbage collector would raise an exception related to the repr’ing the object. We get around this by using the garbage collector to manually disconnect all open HdfDB objects.

armi.cleanTempDirs(olderThanDays=None)[source]

Clean up temporary files after a run.

Parameters
  • olderThanDays (int, optional) – If provided, deletes other ARMI directories if they are older than the requested time.

  • Windows HPC system sends a SIGBREAK signal when the user cancels a job, which (The) –

  • NOT handled by atexit. Notably SIGBREAK doesn't exist off Windows. (is) –

  • the SIGBREAK signal to work with a Microsoft HPC, the TaskCancelGracePeriod (For) –

  • must be configured to be non-zero. This sets the period between SIGBREAK (option) –

  • SIGTERM/SIGINT. To do cleanups in this case, we must use the signal module. (and) –

  • even then it does not work because MS mpiexec does not pass signals (Actually,) –

  • through.

armi.init(choice=None, fName=None, cs=None)[source]

Scan a directory for armi inputs and load one to interact with.

Parameters
  • choice (int, optional) – Automatically run with this item out of the menu that would be produced of existing xml files.

  • fName (str, optional) – An actual case name to load. e.g. ntTwr1.xml

  • cs (object, optional) – If supplied, supercede the other case input methods and use the object directly

Examples

>>> o = armi.init()
armi.getDefaultPlugins() → List[Type[armi.plugins.ArmiPlugin]][source]

Return a list containing the default set of ARMI Framework plugins.

This is useful for an application to fold all of the ARMI Framework’s capabilities into its own set of plugins.

armi.getDefaultPluginManager() → pluggy.manager.PluginManager[source]

Return a plugin manager containing the default set of ARMI Framework plugins.

This is useful when using standalone facilities of ARMI without a specific application.

armi.getPluginManager() → Optional[pluggy.manager.PluginManager][source]

Return the plugin manager, if there is one.

armi.getPluginManagerOrFail() → pluggy.manager.PluginManager[source]

Return the plugin manager. Raise an error if there is none.

armi.configure(app: armi.apps.App)[source]

Set the plugin manager for the Framework and configure internals to those plugins.

Subpackages