Configuration reference¶
Simulation user Operator developer
The configuration block of an input file sets the Onika runtime: logging,
profiling, debugging, threads, GPU, plugins. It does not change the physics
(except the default unit system and random seed, see Physics).
This page lists every item.
Two forms of each item¶
Every item can be set in two equivalent ways: a YAML key under
configuration in an input file, or a command-line option. The option name
is the YAML path below configuration, joined with -:
- A boolean option given without a value is set to
true:--debug-graphis the same as--debug-graph true. - Command-line options are merged last, so they override the input file.
- The
configurationblock of an included file, or ofmain-config.msp, is merged like any other map (see Includes and merging). Applications built on Onika use this to change the defaults.
To see the items and the values actually used:
$ onika-exec --help default-config # the full block below, with defaults, as YAML
$ onika-exec --help command-line # the same items, as command-line options
$ onika-exec input.msp --debug-config # values used for this run
The full block¶
Output of onika-exec --help default-config (Onika main). Each line gives
the default value, the type and the description from the sources
(include/onika/app/default_app_config.h). Defaults written as names
(ONIKA_TASKS_PER_CORE...) are build-time constants, see
CMake options.
configuration: # Application configuration
logging: # log streams configuration
parallel: false # (bool) Allows all processes (not only rank 0) to output to log streams
debug: false # (bool) Enable debug stream
log_file: "" # (std::string) write logs to file instead of standard output stream
err_file: "" # (std::string) write errors to file instead standard error stream
dbg_file: "" # (std::string) write debug messages to file instead of standard output
profiling: # enables and configure profiling and execution traces
resmem: false # (bool) profile resident memory increase
exectime: false # (bool) Write execution time of each operator to standard output
summary: false # (bool) Prints a summuray of execution times at end of simulation
filter: {} # (StringVector) if non empty, limits profiling to operators whose pathname matches one of the regex in list
gpu_filter: {} # (StringVector) if non empty, GPU profiling tools will trace only operators whose pathname matches one of the regex in list
trace: # enables and configure execution traces
enable: false # (bool) if true enables trace output with given parameters
format: "yaml" # (std::string) available formats are 'vite' and 'dot'
file: "trace" # (std::string) Enables VITE format trace output if non-empty. Value is file name to use
color: "operator" # (std::string) task coloring scheme : 'operator', 'duration' or 'tag'
total: false # (bool) outputs total time per task in a separate file
idle: true # (bool) outputs idle amount plot into a separate file
trigger: "" # (std::string) starts output after the first occurence of this event
trigger_interval: {} # (IntVector) filter trace betwwen two trigger markers with given indices
idle_resolution: 8192 # (long) sampling resolution for idle ratio plot
idle_smoothing: 32 # (long) sampling smoothing for idle ratio plot
debug: # debuggin and introspection features
plugins: false # (bool) print loaded plugins
config: false # (bool) print configuration block values
yaml: false # (bool) print flattened (after include resolution) yaml config
graph: false # (bool) print operator graph
ompt: false # (bool) ompt internal debug messages
graph_addr: false # (bool) print operators' addresses
graph_lod: 1 # (int) level of detail for operator graph
graph_fmt: "console" # (std::string) graph output format
graph_rsc: false # (bool) output operator resource nodes
files: false # (bool) print loaded input files
rng: "" # (std::string) random number generator state dump file name
graph_filter: {} # (StringVector) list of regular experessions to select operators to exclude from graph output
filter: {} # (StringVector) list of regular expression to select operators taht have debug output enabled
particle: {} # (UInt64Vector) particle id list for particles to debug
particle_nbh: false # (bool) enable particle neighborhood debugging
particle_ghost: false # (bool) enable ghost particles debugging
fpe: false # (bool) enable floating point exceptions
verbose: 0 # (int) verbosity level
graph_exec: false # (bool) component graph execution debug traces
strict_slots: false # (bool) unknown keys in an operator definition are fatal errors instead of warnings
onika: # Onika sub-system configuration
parallel_task_core_mult: ONIKA_TASKS_PER_CORE # (int) Number of OpenMP tasks per core when using task mode
parallel_task_core_add: 0 # (int) Additional number of OpenMP tasks when using task mode
gpu_sm_mult: ONIKA_CU_MIN_BLOCKS_PER_SM # (int) GPU number of blocks per SM
gpu_sm_add: 0 # (int) GPU number of blocks added to grid size
gpu_block_size: ONIKA_CU_MAX_THREADS_PER_BLOCK # (int) GPU kernel block size, in threads, for 1D kernels
gpu_block_dims: DEFAULT_GPU_BLOCK_DIMS # (IntVector) GPU kernel block preferred dimensions for ND kernels
gpu_disable_filter: {} # (StringVector) list of regular expressions matching paths of operators whose access to the GPU is disabled
gpu_enable_filter: {} # (StringVector) list of regular expressions matching paths of operators with GPU enabled, regardless of gpu_disable_filter settings
physics: # Physics parameters and constants
units: onika::physics::SI # (onika::physics::UnitSystem) Default unit system for conversions to internal real values
rngseed: 1812433253 # (long) Default random number generator seed for function 'rand()' used in value expressions
nogpu: false # (bool) globally disables GPU usage, even if some are present, and prevent any call to Cuda or HIP libraries
mpimt: true # (bool) enables MPI_THREAD_MULTIPLE feature if available
pinethreads: false # (bool) try to pine OpenMP thread
threadrotate: 0 # (int) rotate thread pinning (use OpenMP thread index + threadrotate modulus number of threads as a reference)
omp_num_threads: -1 # (int) number of OpenMP threads (-1 means default)
omp_max_nesting: -1 # (int) maximum nesting level for OpenMP nested parallelism
omp_nested: false # (bool) enables OpenMP nesting
omp_max_threads_filter: {} # (StringIntMap) list of regular expressions matching paths of operators with forbidden access to the GPU
plugin_dir: onika::plugin_path_env() # (std::string) plugin search path
plugin_db: "" # (std::string) plugin dictionary file
plugins: {} # (StringVector) list of plugins forced to load
generate_plugins_db: false # (bool) generate plugin data base and exit
help: "" # (std::string) print help and exit
run_unit_tests: false # (bool) run unit tests and exit
set: # (YAML::Node) override configuration items with those in this map
Some descriptions of the sources are imprecise; the sections below give the
exact behavior. For example omp_max_threads_filter limits the number of
threads, it has nothing to do with the GPU.
Lists (StringVector, IntVector...) are written as YAML lists:
filter: [ ".*compute_loop.*" ], or --profiling-filter "[.*compute_loop.*]"
on the command line. StringIntMap is a map: { ".*print.*": 1 }.
logging¶
logging.parallel·--logging-parallel(bool, default: false)- Every MPI process writes to the log streams, instead of rank 0 only.
logging.debug·--logging-debug(bool, default: false)- Enables the debug stream (
ldbg). logging.log_file·--logging-log_file(string, default: "")- File where the standard log output is written. Empty: standard output.
logging.err_file·--logging-err_file(string, default: "")- File where errors are written. Empty: standard error.
logging.dbg_file·--logging-dbg_file(string, default: "")- File where debug messages are written. Empty: with the standard log output.
profiling¶
profiling.resmem·--profiling-resmem(bool, default: false)- Measures the resident memory increase of each operator (shown by
memory_stats). profiling.exectime·--profiling-exectime(bool, default: false)-
Prints the execution time of each operator call, when it finishes. Handy to find the last operator that ran before a crash. With
print_loop.msp: profiling.summary·--profiling-summary(bool, default: false)- Prints a time table at the end of the run, following the structure of the graph (see Where does the time go?).
profiling.filter·--profiling-filter(list of regex, default: [])- If not empty, profiles only the operators whose path name matches one of the regular expressions.
profiling.gpu_filter·--profiling-gpu_filter(list of regex, default: [])- If not empty, GPU profiling tools trace only the operators whose path name matches one of the regular expressions.
profiling.trace¶
Execution traces, see Execution traces.
profiling.trace.enable·--profiling-trace-enable(bool, default: false)- Writes an execution trace.
profiling.trace.format·--profiling-trace-format(string, default: "yaml")- Trace format:
yaml,viteordot. profiling.trace.file·--profiling-trace-file(string, default: "trace")- Base name of the trace file.
profiling.trace.color·--profiling-trace-color(string, default: "operator")- Coloring of trace entries:
operator,durationortag. profiling.trace.total·--profiling-trace-total(bool, default: false)- Writes the total time per task in a separate file.
profiling.trace.idle·--profiling-trace-idle(bool, default: true)- Writes the idle ratio plot in a separate file.
profiling.trace.trigger·--profiling-trace-trigger(string, default: "")- Starts recording after the first occurrence of this event.
profiling.trace.trigger_interval·--profiling-trace-trigger_interval(list of integers, default: [])- Records only between the two trigger occurrences of given indices.
profiling.trace.idle_resolution·--profiling-trace-idle_resolution(long, default: 8192)- Sampling resolution of the idle ratio plot.
profiling.trace.idle_smoothing·--profiling-trace-idle_smoothing(long, default: 32)- Smoothing of the idle ratio plot, in samples.
debug¶
See also Debugging and profiling.
debug.plugins·--debug-plugins(bool, default: false)- Prints which plugins are loaded and why.
debug.config·--debug-config(bool, default: false)- Prints the values of this
configurationblock used for the run. debug.yaml·--debug-yaml(bool, default: false)- Prints the merged YAML input, after includes.
debug.graph·--debug-graph(bool, default: false)- Prints the simulation graph, with the slots of each operator (example in Your first run).
debug.ompt·--debug-ompt(bool, default: false)- Internal debug messages of the OpenMP tools (OMPT) interface.
debug.graph_addr·--debug-graph_addr(bool, default: false)- Adds operator addresses to the printed graph.
debug.graph_lod·--debug-graph_lod(int, default: 1)- Level of detail of the printed graph.
debug.graph_fmt·--debug-graph_fmt(string, default: "console")- Graph output format:
console, ordotto writesim_graph.dot(see The graph as a picture). debug.graph_rsc·--debug-graph_rsc(bool, default: false)- Adds the slot resources (where values are stored) to the graph.
debug.files·--debug-files(bool, default: false)- Prints the input files loaded.
debug.rng·--debug-rng(string, default: "")- File name where the random number generator state is dumped.
debug.graph_filter·--debug-graph_filter(list of regex, default: [])- Operators to exclude from the printed graph.
debug.filter·--debug-filter(list of regex, default: [])- Operators whose debug output (
ldbg) is enabled. debug.particle·--debug-particle(list of unsigned integers, default: [])- Particle ids to debug. Used by particle applications (exaNBody...).
debug.particle_nbh·--debug-particle_nbh(bool, default: false)- Particle neighborhood debugging. Used by particle applications.
debug.particle_ghost·--debug-particle_ghost(bool, default: false)- Ghost particle debugging. Used by particle applications.
debug.fpe·--debug-fpe(bool, default: false)- Traps floating point exceptions: the run stops at the first one. Not available on macOS (ignored with a warning).
debug.verbose·--debug-verbose(int, default: 0)- Verbosity level of debug output.
debug.graph_exec·--debug-graph_exec(bool, default: false)- Prints each operator when it starts and ends.
debug.strict_slots·--debug-strict_slots(bool, default: false)- Makes unknown keys in an operator definition fatal errors instead of warnings, to catch misspelled slot names.
onika: task and GPU parameters¶
onika.parallel_task_core_mult·--onika-parallel_task_core_mult(int, default:ONIKA_TASKS_PER_CORE, 4)- Number of OpenMP tasks per core in task mode.
onika.parallel_task_core_add·--onika-parallel_task_core_add(int, default: 0)- Additional number of OpenMP tasks in task mode.
onika.gpu_sm_mult·--onika-gpu_sm_mult(int, default:ONIKA_CU_MIN_BLOCKS_PER_SM, 4)- GPU blocks per streaming multiprocessor, for fixed-size grids.
onika.gpu_sm_add·--onika-gpu_sm_add(int, default: 0)- GPU blocks added to the grid size.
onika.gpu_block_size·--onika-gpu_block_size(int, default:ONIKA_CU_MAX_THREADS_PER_BLOCK, 128)- GPU block size, in threads, of 1D kernels.
onika.gpu_block_dims·--onika-gpu_block_dims(list of integers, default: [8,8,4])- Preferred GPU block dimensions of 2D/3D kernels.
onika.gpu_disable_filter·--onika-gpu_disable_filter(list of regex, default: [])- Operators that must not use the GPU.
onika.gpu_enable_filter·--onika-gpu_enable_filter(list of regex, default: [])- Operators that use the GPU even if they match
gpu_disable_filter.
physics¶
physics.units·--physics-units(unit system, default: SI)- Internal unit system, set before the graph is built (see The internal unit system).
physics.rngseed·--physics-rngseed(long, default: 1812433253)- Seed of
rand()in arithmetic expressions.
Top-level items¶
nogpu·--nogpu(bool, default: false)- Disables the GPU, even if one is present: no call to CUDA or HIP is made.
init_cudathen printsvgpu disabled. mpimt·--mpimt(bool, default: true)- Initializes MPI with
MPI_THREAD_MULTIPLEif available (MPI_Initotherwise). pinethreads·--pinethreads(bool, default: false)- Pins OpenMP threads to cores. Not available on macOS.
threadrotate·--threadrotate(int, default: 0)- Rotation of thread pinning: thread
iis pinned using(i + threadrotate) % nthreads. omp_num_threads·--omp_num_threads(int, default: -1)- Number of OpenMP threads.
-1: OpenMP default (usually all cores, which is not always the fastest). omp_max_nesting·--omp_max_nesting(int, default: -1)- Maximum level of nested OpenMP parallelism (
omp_set_max_active_levels), used only if greater than 1.-1keeps the OpenMP default, which with GCC is no nesting. Set it to 2 for batches withparallel: true, see Running operators concurrently. omp_nested·--omp_nested(bool, default: false)- Also calls the older
omp_set_nested(1). Used only ifomp_max_nestingis greater than 1. omp_max_threads_filter·--omp_max_threads_filter(map regex → int, default: {})- Maximum number of OpenMP threads of the operators whose path matches, e.g.
--omp_max_threads_filter '{ ".*print.*": 1 }'. plugin_dir·--plugin_dir(string, default:ONIKA_PLUGIN_PATH)- Plugin search path (see Plugins).
plugin_db·--plugin_db(string, default: "")- Plugin database file. Empty:
plugins.dbin the current directory. plugins·--plugins(list, default: [])- Plugins to load explicitly. The value is read but not used by Onika
main: use--generate_plugins_db trueto load all plugins. generate_plugins_db·--generate_plugins_db(bool, default: false)- Regenerates the plugin database (loading every plugin).
help·--help(string, default: "")- Prints help and exits:
--help <operator>,--help plugins,--help default-config,--help command-line. run_unit_tests·--run_unit_tests(bool, default: false)- Runs the embedded unit tests and exits (see Testing).
set·--set-<path> <value>(map)-
Overrides values of the input file, outside the
configurationblock:--set-global-nsteps 100is the same as
Environment variables¶
bin/setup-env.sh sets the variables Onika needs. You can extend them:
| Variable | Meaning |
|---|---|
ONIKA_PLUGIN_PATH |
:-separated list of directories searched for plugins (default of plugin_dir). |
ONIKA_CONFIG_PATH |
Directory of the default input files (main-config.msp...). |
ONIKA_DATA_PATH |
:-separated list of directories searched for data files. |
ONIKA_DEBUG |
If set (and not 0 / false), turns on the debug stream and startup diagnostics, as --logging-debug --debug-plugins --debug-files --debug-verbose 2. |
In C++¶
ApplicationConfiguration, its declaration with ONIKA_APP_CONFIG_* macros
and how to add an item are described in
Framework internals.