ATLAS Offline Software
|
This package contains several classes that facilitate the use of valgrind tools within the Atlas software. The following sections describe different use cases. General information about using valgrind in Atlas can be found on the UsingValgrind TWiki.
Since code profilers like callgrind collect a huge amount of data and since you are most likely only interested in your particular algorithm it is not a good idea to simply run the profiler on an athena job. Using ValgrindSvc it is possible to profile specific algorithms only. For a typical CA-job this can be configured via setting the following flags:
python -m AthExHelloWorld.HelloWorldConfig PerfMon.Valgrind.ProfiledAlgs=["HelloWorld"]
and then running the job within valgrind:
valgrind --tool=callgrind --trace-children=yes --instr-atstart=no [CMD]
Add your other favorite valgrind options but make sure that the instrumentation at start is turned off, since ValgrindSvc will take care of enabling it at the right time. The algorithm names in ProfiledAlgs
can contain regular expressions (Perl synatx) to match several instances of one algorithm. For example,
ProfiledAlgs = ["MyAlg_.*"]
will profile all algorithms matching this regular expression. If ProfiledAlgs
is empty (the default) the entire event loop, i.e. everything between BeginEvent/EndEvent, will be profiled.
It is possible to profile arbitrary intervals in the lifetime of a Gaudi component. For example, you may want to profile only the initialize method of your algorithms, or anything that is executed between initialize and finalize, or anything in between the initialize of two algorithms. You can use the ProfiledIntervals
property for this. Examples:
ProfiledIntervals = ["MyAlg.initialize:MyAlg.finalize"]
ProfiledIntervals = ["MyAlg.initialize:YourAlg.initialize"]
ProfiledIntervals = ["MyAlg.initialize:xxx.yyy"]
ProfiledIntervals = ["MyAlg.initialize"]
["MyAlg.initialize:MyAlg.initialize"]
, i.e. profile initialize of MyAlg ProfiledIntervals = ["MyAlg.initialize:YourAlg.initialize", "MyAlg.finalize"]
As above, the algorithm name can contain a regular expression:
ProfiledIntervals = ["MyAlg_.*.initialize"]
Finally, a special notation can be used to steer the profiling based on incidents (no regular expressions allowed):
ProfiledIntervals = ["BeginRun.incident:EndRun.incident"]
In all cases the intervals are closed intervals in the mathematical sense, i.e. the profile always includes the start and end point.
The following properties can be set to control whether a new profile is being dumped after each event and interval, respectively. The default values are:
DumpAfterEachEvent = False DumpAfterEachInterval = True
Additonal profiles can be dumped on any "Incident" by setting:
DumpAfterIncident = ["BeginRun","EndRun","MyIncident"]