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 athena.py
using for example a transform-written runargs.RAWtoALL.py
file or a smaller config file like CaloRec/CaloRecoConfig.py
. In general, the options described here can be also invoked from the transform (like Reco_tf.py
) using the --athenaopts=
argument. Keep in mind that a transform may run more than one athena job!
Athena has a --help
option that explains all command-line options as well as available flags. The basic help is simply athena --help
.
To see all flag categories, run athena --help flags
. To see the help for a specific category use athena --help Input
.
It is possible to set (overwrite) any configuration flag from the command line using a syntax like athena.py runargs.RAWtoALL.py 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.
Syntax: athena.py --evtMax=2 runargs.RAWtoALL.py
Equivant to setting the config flag Exec.MaxEvents
Syntax athena.py --skipEvents=3 runargs.RAWtoALL.py
Equivant to setting the configuration flag Exec.SkipEvents
Syntax: athena.py --filesInput <file1>,<file2>
Wildcards are supported. Equivant to setting the configuration flag Input.Files
Syntax: athena.py --loglevel=<level> runargs.RAWtoALL.py
Possible log-levels are (as always in athena): “ALL”,”VERBOSE”,”DEBUG”,”INFO”,”WARNING”,”ERROR” or “FATAL”
Syntax: athena.py --perfmon=<type> runargs.RAWtoALL.py
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
)
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: athena.py --config-only=myConfig.pkl
Running: athena.py 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.
Syntax: athena.py --debug=<stage> runargs.RAWtoALL.py
With this option, the dbg
debugger will be attached to the job just before entering <stage>
. Possible stages are init
, exec
and fini
.
Syntax: athena.py --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:
Syntax: athena.py --profile-python=pprof.[txt,pkl] runargs.RAWtoALL.py
This option is based on python’s cProfile
module and either writes a text or pickle file with the profiling information.
Syntax: athena --interactive=<stage> runargs.RAWtoALL.py
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.