Command line options

Last update: 13 Feb 2024 [History] [Edit]

Command line options for athena with CA

ComponentAccumulator-configured athena jobs have a number of command line options useful for debugging. For these options to work, the __main__ method of the top-level configuration file has to call flags.fillFromArgs() on the configuration flags before they get locked. This is the case for all commonly used top-level configuration files, including the ones created by the transforms. Most of the options described here existed also in the old-style configuration but in a slightly different form.

Here, we assume you are working directly with using for example a transform-written file or a smaller config file like CaloRec/ In general, the options described here can be also invoked from the transform (like using the --athenaopts= argument. Keep in mind that a transform may run more than one athena job!

Help on options and flags

Athena has a --help option that explains all command-line options as well as available flags. Without any additional parameters, it prints the list of flag-categories (such as Input, Exec, etc). Running athena --CA -- help <flag-category> lists all flags in that category.

Setting individual flags form the command line

It is possible to set (overwrite) any configuration flag from the command line using a syntax like --CA Debug.DumpEvtStore=True. Every argument matching the keyword=value pattern will be interpreted as attempt to set a flag. Note that the keyword in this case is just the flag-name without the name of the flag-container.

Setting number of events to be processed

Syntax: --CA --evtMax=2

Equivant to setting the config flag Exec.MaxEvents

Skipping a number of events at the beginning of the input file

Syntax --CA -skipEvents=3

Equivant to setting the configuration flag Exec.SkipEvents

Setting the input file(s)

Syntax: --CA --filesInput <file1>,<file2>

Wildcards are supported. Equivant to setting the configuration flag Input.Files

Setting the log output level

Syntax: --CA --loglevel=<level>

Possible log-levels are (as always in athena): “ALL”,”VERBOSE”,”DEBUG”,”INFO”,”WARNING”,”ERROR” or “FATAL”

Syntax: --CA --pmon=<type>

Activate performance monitoring. Possible types are fastmon or fullmon.

--threads=<n> Set the number of worker threads. 0 means running with the old (serial) event-loop manager. --concurrent-events=<n> Set the number of events processed concurrently. By default equal to the number of threads. --nproc=<n> Set the number of concurrent processes (for AthenaMP)

Store the config in a pickle file

The ComponentAccumulator object holding the final configuration can be stored in a python pickle file and later executed from there. This is useful when running with valgrind or in a profiler without profiling the python configuration stage, or in general to run the same job over and over gain without re-ding the configuration step. Storing: --CA --config-only=myConfig.pkl

Running: --CA myConfig.pkl

The ComponentAccumulator instance stored in the pickle behaves in the same way as one returned by a configuration-method. One can merge it with other ComponentAccumulator instances, modify properties and call run() on it.

Attaching the debugger

Syntax: --CA --debug=<stage>

With this option, the dbg debugger will be attached to the job just before entering <stage>. Possible stages are init, exec and fini.

Tracing the configuration step

Syntax: --CA --tracelevel=<level>

The python code executed during the configuration step can be traced (printed) as it is executed. This feature is based on python’s trace module. There are three pre-defined levels to exclude tracing of core-modules that would otherwise flood the output:

  • level 0: Trace everything
  • level 1: Exclude system and ROOT modules
  • level 2: Exclude also the internals of GaudiConfig2
  • level 3 (default): Exclude also the internals of ComponentAccumulator

Invoking the python profiler

Syntax: --CA --profile-python=pprof.txt

This option is based on python’s cProfile module. Writes a table of number of calls and execution times to the given text file.

Interactive athena

Syntax: athena --CA --interactive=<stage>

There are two fundamentally different types of interactive athena. The first one (stage “init” allows to inspect (and modify) the ComponentAccumulator instance just before execution starts. The second type (stage “run”) is an interactive prompt inside the event loop. This allow to execute one event and inspect for example the transient event store. This functionality is rather fragile and considered expert level.