openmc.run

openmc.run(particles=None, threads=None, geometry_debug=False, restart_file=None, tracks=False, output=True, cwd='.', openmc_exec='openmc', mpi_args=None, event_based=False, path_input=None)[source]

Run an OpenMC simulation.

Parameters
  • particles (int, optional) – Number of particles to simulate per generation.

  • threads (int, optional) – Number of OpenMP threads. If OpenMC is compiled with OpenMP threading enabled, the default is implementation-dependent but is usually equal to the number of hardware threads available (or a value set by the OMP_NUM_THREADS environment variable).

  • geometry_debug (bool, optional) – Turn on geometry debugging during simulation. Defaults to False.

  • restart_file (str or PathLike) – Path to restart file to use

  • tracks (bool, optional) – Enables the writing of particles tracks. The number of particle tracks written to tracks.h5 is limited to 1000 unless Settings.max_tracks is set. Defaults to False.

  • output (bool) – Capture OpenMC output from standard out

  • cwd (str, optional) – Path to working directory to run in. Defaults to the current working directory.

  • openmc_exec (str, optional) – Path to OpenMC executable. Defaults to ‘openmc’.

  • mpi_args (list of str, optional) – MPI execute command and any additional MPI arguments to pass, e.g., [‘mpiexec’, ‘-n’, ‘8’].

  • event_based (bool, optional) –

    Turns on event-based parallelism, instead of default history-based

    New in version 0.12.

  • path_input (str or PathLike) –

    Path to a single XML file or a directory containing XML files for the OpenMC executable to read.

    New in version 0.13.3.

Raises

RuntimeError – If the openmc executable returns a non-zero status