23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Athena</strong><br />

Chapter 13 Framework services Version/Issue: 2.0.0<br />

13.7 The Auditor Service<br />

The Auditor Service provides a set of auditors that can be used to provide monitoring of various<br />

characteristics of the execution of Algorithms. Each auditor is called immediately before and after each<br />

call to each Algorithm instance, and can track some resource usage of the Algorithm. Calls that are thus<br />

monitored are initialize(), execute() and finalize(), although monitoring can be<br />

disabled for any of these for particular Algorithm instances. Only the execute() function monitoring<br />

is enabled by default.<br />

Several examples of auditors are provided. These are:<br />

• NameAuditor. This just emits the name of the Algorithm to the Standard Message Service<br />

immediately before and after each call. It therefore acts as a diagnostic tool to trace program<br />

execution.<br />

• ChronoAuditor. This monitors the cpu usage of each algorithm and reports both the total and<br />

per event average at the end of job.<br />

• MemoryAuditor. This monitors the state of memory usage during execution of each<br />

Algorithm, and will warn when memory is allocated within a call without being released on<br />

exit. Unfortunately this will in fact be the general case for Algorithms that are creating new<br />

data and registering them with the various transient stores. Such Algorithms will therefore<br />

cause warning messages to be emitted. However, for Algorithms that are just reading data<br />

from the transient stores, these warnings will provide an indication of a possible memory leak.<br />

Note that currently the MemoryAuditor is only available for Linux.<br />

• MemStatAuditor. The same as MemoryAudotor, but prints a table of memory usage statistics<br />

at the end.<br />

13.7.1 Enabling the Auditor Service and specifying the enabled Auditors<br />

The Auditor Service is enabled by the following line in the Job Options file:<br />

// Enable the Auditor Service<br />

ApplicationMgr.DLLs += { "GaudiAud" };<br />

Specifying which auditors are enabled is illustrated by the following example:<br />

// Enable the NameAuditor and ChronoAuditor<br />

AuditorSvc.Auditors = { "NameAuditor", "ChronoAuditor" };<br />

page 113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!