| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | List of all members
TimingAuditor Class Reference

Simple auditor which uses SequencerTimerTool for ALL algorithms, including the algorithm from main Gaudi "TopAlg" list and algorithms managed by Data-On-Demand Service. More...

Inheritance diagram for TimingAuditor:
[legend]
Collaboration diagram for TimingAuditor:
[legend]

## Public Member Functions
void | before (StandardEventType evt, INamedInterface *alg) override
void | after (StandardEventType evt, INamedInterface *alg, const StatusCode &sc) override
void | before (CustomEventTypeRef evt, const std::string &name) override
void | after (CustomEventTypeRef evt, const std::string &name, const StatusCode &sc) override
void | handle (const Incident &) override
| Inform that a new incident has occurred. More...
StatusCode | initialize () override
| factory: More...
StatusCode | finalize () override
| TimingAuditor (const std::string &name, ISvcLocator *pSvc)
| standard constructor More...
| ~TimingAuditor () override=default
| destructor More...
| TimingAuditor ()=delete
| TimingAuditor (const TimingAuditor &)=delete
TimingAuditor & | operator= (const TimingAuditor &)=delete
Public Member Functions inherited from extends< Auditor, IIncidentListener >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Auditor
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| ~Auditor () override=default
| Destructor. More...
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysFinalize () override
| Finalization method invoked by the framework. More...
void | before (StandardEventType, INamedInterface *) override
| The following methods are meant to be implemented by the child class... More...
void | before (StandardEventType, const std::string &) override
void | before (CustomEventTypeRef, INamedInterface *) override
void | before (CustomEventTypeRef, const std::string &) override
void | after (StandardEventType, INamedInterface *, const StatusCode &) override
void | after (StandardEventType, const std::string &, const StatusCode &) override
void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override
void | beforeInitialize (INamedInterface *) override
void | afterInitialize (INamedInterface *) override
void | beforeReinitialize (INamedInterface *) override
void | afterReinitialize (INamedInterface *) override
void | beforeExecute (INamedInterface *) override
void | afterExecute (INamedInterface *, const StatusCode &) override
void | beforeFinalize (INamedInterface *) override
void | afterFinalize (INamedInterface *) override
void | beforeBeginRun (INamedInterface *) override
void | afterBeginRun (INamedInterface *) override
void | beforeEndRun (INamedInterface *) override
void | afterEndRun (INamedInterface *) override
const std::string & | name () const override
bool | isEnabled () const override
SmartIF< ISvcLocator > & | serviceLocator () const
| The standard service locator. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T = IService>
SmartIF< T > | service (const std::string &name, bool createIf=false) const
StatusCode | setProperty (const Property &p) override
| Set a value of a property of an auditor. More...
StatusCode | setProperty (const std::string &s) override
| Implementation of IProperty::setProperty. More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| Implementation of IProperty::setProperty. More...
StatusCode | getProperty (Property *p) const override
| Get the value of a property. More...
const Property & | getProperty (const std::string &name) const override
| Get the property by name. More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| Implementation of IProperty::getProperty. More...
const std::vector< Property * > & | getProperties () const override
| Get all properties. More...
bool | hasProperty (const std::string &name) const override
| Implementation of IProperty::hasProperty. More...
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | setProperties ()
| Set the auditor's properties. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## Private Member Functions
void | i_beforeInitialize (INamedInterface *alg)
void | i_afterInitialize (INamedInterface *alg)
void | i_beforeFinalize (INamedInterface *alg)
void | i_beforeExecute (INamedInterface *alg)
void | i_afterExecute (INamedInterface *alg)

## Private Attributes
SmartIF< IToolSvc > | m_toolSvc = nullptr
| tool service More...
SmartIF< IIncidentSvc > | m_incSvc = nullptr
| incident service More...
ISequencerTimerTool * | m_timer = nullptr
| the timer tool More...
SmartIF< INamedInterface > | m_appMgr = nullptr
| ApplicationManager. More...
GaudiUtils::VectorMap< const INamedInterface *, int > | m_map
int | m_indent = 0
| indentation level More...
bool | m_inEvent = false
| "In event" flag More...
bool | m_goodForDOD = false
| "optimized for DOD" More...
GaudiUtils::HashMap< std::string, int > | m_mapUser
| map used to record user timing events More...
bool | m_histoSaved = false

## Additional Inherited Members
Public Types inherited from extends< Auditor, IIncidentListener >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
Public Types inherited from Auditor
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

Simple auditor which uses SequencerTimerTool for ALL algorithms, including the algorithm from main Gaudi "TopAlg" list and algorithms managed by Data-On-Demand Service.

Author
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

Date
  2007-01-31

Definition at line 28 of file TimingAuditor.cpp.

## Constructor & Destructor Documentation

TimingAuditor::TimingAuditor | ( | const std::string & | name,
|  | ISvcLocator * | pSvc
| ) |  |
| inline

standard constructor

Definition at line 57 of file TimingAuditor.cpp.

58 : base_class ( name , pSvc )
59 {
60 declareProperty ( "OptimizedForDOD" , m_goodForDOD ) ;
61 }
extends< Auditor, IIncidentListener >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
Auditor::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
TimingAuditor::m_goodForDOD
bool m_goodForDOD
"optimized for DOD"
Definition: TimingAuditor.cpp:85

TimingAuditor::~TimingAuditor | ( |  | ) |
| override default

destructor

TimingAuditor::TimingAuditor | ( |  | ) |
| delete

TimingAuditor::TimingAuditor | ( | const TimingAuditor & |  | ) |
| delete

## Member Function Documentation

void TimingAuditor::after | ( | StandardEventType | evt,
|  | INamedInterface * | alg,
|  | const StatusCode & | sc
| ) |  |
| override

Definition at line 189 of file TimingAuditor.cpp.

190 {
191 switch (evt) {
192 case IAuditor::Initialize : i_afterInitialize( alg ); break;
193 case IAuditor::Execute : i_afterExecute( alg ); break;
194 default: break;
195 }
196 }
TimingAuditor::i_afterInitialize
void i_afterInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:231
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
IAuditor::Initialize
Definition: IAuditor.h:25
IAuditor::Execute
Definition: IAuditor.h:27
TimingAuditor::i_afterExecute
void i_afterExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:259

void TimingAuditor::after | ( | CustomEventTypeRef | evt,
|  | const std::string & | name,
|  | const StatusCode & | sc
| ) |  |
| override

Definition at line 288 of file TimingAuditor.cpp.

289 {
290 // Ignore obvious mistakes
291 if ( name.empty() && evt.empty() ) { return; }
292
293 // look for the user timer in the map
294 std::string nick = name + ":" + evt;
295 auto found = m_mapUser.find( nick );
296
297 // We cannot do much if the timer is not available
298 if ( m_mapUser.end() == found ) {
299 warning() << "Trying to stop the measure of the timing for '"
300 << nick << "' but it was never started. Check the code"
301 << endmsg;
302 return;
303 }
304 m_timer->stop( found->second );
305 }
std::string::empty
T empty(T...args)
std::string
STL class.
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:87
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
ISequencerTimerTool::stop
virtual double stop(int index)=0
stop the counter, return the elapsed time
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void TimingAuditor::before | ( | StandardEventType | evt,
|  | INamedInterface * | alg
| ) |  |
| override

Definition at line 179 of file TimingAuditor.cpp.

180 {
181 switch (evt) {
182 case IAuditor::Initialize : i_beforeInitialize( alg ); break;
183 case IAuditor::Execute : i_beforeExecute( alg ); break;
184 case IAuditor::Finalize : i_beforeFinalize( alg ); break;
185 default: break;
186 }
187 }
TimingAuditor::i_beforeInitialize
void i_beforeInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:208
TimingAuditor::i_beforeExecute
void i_beforeExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:237
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
IAuditor::Finalize
Definition: IAuditor.h:30
IAuditor::Initialize
Definition: IAuditor.h:25
TimingAuditor::i_beforeFinalize
void i_beforeFinalize(INamedInterface *alg)
Definition: TimingAuditor.cpp:198
IAuditor::Execute
Definition: IAuditor.h:27

void TimingAuditor::before | ( | CustomEventTypeRef | evt,
|  | const std::string & | name
| ) |  |
| override

Definition at line 268 of file TimingAuditor.cpp.

269 {
270 // Ignore obvious mistakes
271 if ( name.empty() && evt.empty() ) { return; }
272
273 // look for the user timer in the map
274 int timer = 0;
275 std::string nick = name + ":" + evt;
276 auto found = m_mapUser.find( nick );
277
278 if ( m_mapUser.end() == found ) {
279 // add a new timer if not yet available
280 timer = m_timer->addTimer( nick ) ;
281 m_mapUser[nick] = timer;
282 } else {
283 timer = found->second;
284 }
285 m_timer->start( timer );
286 }
std::string::empty
T empty(T...args)
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
std::string
STL class.
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:87
GaudiUtils::Map::end
iterator end()
Definition: Map.h:132
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:149
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75

StatusCode TimingAuditor::finalize | ( |  | ) |
| override virtual

Reimplemented from Auditor.

Definition at line 155 of file TimingAuditor.cpp.

156 {
157 if ( m_incSvc )
158 {
159 m_incSvc -> removeListener ( this , IncidentType::BeginEvent ) ;
160 m_incSvc -> removeListener ( this , IncidentType::EndEvent ) ;
161 m_incSvc.reset();
162 }
163 if ( m_toolSvc )
164 {
165 // the 2 following line are commented out: it is
166 // is a temporary hack which prevent a crash due to a problem in
167 // the reference counting
168 // if ( 0 != m_timer )
169 // { m_toolSvc -> releaseTool ( m_timer ) . ignore() ; m_timer = 0 ; }
170 m_toolSvc.reset();
171 }
172 m_appMgr.reset();
173 // clear the map
174 m_map.clear() ;
175 // finalize the base class
176 return Auditor::finalize () ;
177 }
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:198
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:77
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:73
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
GaudiUtils::VectorMap::clear
void clear()
clear the container
Definition: VectorMap.h:497
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:71
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88

void TimingAuditor::handle | ( | const Incident & | i | ) |
| override

Inform that a new incident has occurred.

Definition at line 307 of file TimingAuditor.cpp.

308 {
309 if ( IncidentType::BeginEvent == i.type () ) {
310 m_timer -> start ( m_map[ m_appMgr.get() ] ) ;
311 ++m_indent ;
312 m_inEvent = true ;
313 } else if ( IncidentType::EndEvent == i.type () ) {
314 m_timer -> stop ( m_map[ m_appMgr.get() ] ) ;
315 --m_indent ;
316 m_inEvent = false ;
317 }
318 }
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:41
TimingAuditor::m_inEvent
bool m_inEvent
"In event" flag
Definition: TimingAuditor.cpp:83
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:81
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:77
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
IOTest.start
tuple start
Definition: IOTest.py:88

void TimingAuditor::i_afterExecute | ( | INamedInterface * | alg | ) |
| private

Definition at line 259 of file TimingAuditor.cpp.

260 {
261 if ( !alg ) { return ; }
262 auto found = m_map.find( alg ) ;
263 if ( m_map.end() == found ) { return ; }
264 m_timer->stop( found->second ) ;
265 --m_indent ;
266 }
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:455
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:81
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:198
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
ISequencerTimerTool::stop
virtual double stop(int index)=0
stop the counter, return the elapsed time

void TimingAuditor::i_afterInitialize | ( | INamedInterface * | alg | ) |
| private

Definition at line 231 of file TimingAuditor.cpp.

232 {
233 if ( m_goodForDOD || !alg ) { return ; }
234 --m_indent ;
235 }
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:81
TimingAuditor::m_goodForDOD
bool m_goodForDOD
"optimized for DOD"
Definition: TimingAuditor.cpp:85

void TimingAuditor::i_beforeExecute | ( | INamedInterface * | alg | ) |
| private

Definition at line 237 of file TimingAuditor.cpp.

238 {
239 if ( !alg ) { return ; }
240 ++m_indent ;
241 auto found = m_map.find( alg ) ;
242 if ( m_map.end() == found )
243 {
244 debug() << "Insert non-structural component '"
245 << alg->name() << "' of type '"
246 << System::typeinfoName(typeid(*alg)) << "' at level "
247 << m_indent << endmsg ;
248 std::string nick = alg->name() ;
249 if ( 0 < m_indent ) { nick = std::string ( m_indent , ' ') + nick ; }
250 if ( !m_goodForDOD ) { nick[0]='*' ;}
251 int timer = m_timer->addTimer( nick ) ;
252 m_map.insert ( alg , timer ) ;
253 m_timer->start( timer ) ;
254 return ;
255 }
256 m_timer->start( found->second ) ;
257 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
GaudiUtils::VectorMap::insert
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:317
std::string
STL class.
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:455
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:81
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:198
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
TimingAuditor::m_goodForDOD
bool m_goodForDOD
"optimized for DOD"
Definition: TimingAuditor.cpp:85
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void TimingAuditor::i_beforeFinalize | ( | INamedInterface * | alg | ) |
| private

Definition at line 198 of file TimingAuditor.cpp.

199 {
200 if (!m_histoSaved)
201 {
202 m_timer->saveHistograms();
203 m_histoSaved = true;
204 }
205 }
ISequencerTimerTool::saveHistograms
virtual void saveHistograms()=0
prepares and saves the timing histograms
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
TimingAuditor::m_histoSaved
bool m_histoSaved
Definition: TimingAuditor.cpp:90

void TimingAuditor::i_beforeInitialize | ( | INamedInterface * | alg | ) |
| private

Definition at line 208 of file TimingAuditor.cpp.

209 {
210 if ( m_goodForDOD ) { return ; }
211 //
212 if ( !alg ) { return ; }
213 auto found = m_map.find( alg ) ;
214 if ( m_map.end() != found ) { return ; }
215 ++m_indent ;
216 std::string nick = alg->name() ;
217 if ( 0 < m_indent ) { nick = std::string ( m_indent , ' ') + nick ; }
218 if ( m_inEvent )
219 {
220 nick[0] = '*' ;
221 debug() << "Insert non-structural component '"
222 << alg->name() << "' of type '"
223 << System::typeinfoName(typeid(*alg)) << "' at level "
224 << m_indent << endmsg ;
225 }
226 int timer = m_timer->addTimer( nick ) ;
227 m_map.insert ( alg , timer ) ;
228 m_timer->start( timer ) ;
229 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
TimingAuditor::m_inEvent
bool m_inEvent
"In event" flag
Definition: TimingAuditor.cpp:83
GaudiUtils::VectorMap::insert
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:317
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:455
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:81
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:198
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
TimingAuditor::m_goodForDOD
bool m_goodForDOD
"optimized for DOD"
Definition: TimingAuditor.cpp:85
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode TimingAuditor::initialize | ( |  | ) |
| override virtual

factory:

Reimplemented from Auditor.

Definition at line 99 of file TimingAuditor.cpp.

100 {
101 StatusCode sc = Auditor::initialize() ;
102 if ( sc.isFailure() ) { return sc ; } // RETURN
103
104
105 // get tool service
106 if ( ! m_toolSvc )
107 {
108 m_toolSvc = Auditor::service ( "ToolSvc" );
109 if ( !m_toolSvc )
110 {
111 error() << "Could not retrieve 'ToolSvc' " << endmsg ;
112 return StatusCode::FAILURE ; // RETURN
113 }
114 if ( !m_timer )
115 {
116 sc = m_toolSvc->retrieveTool
117 ( "SequencerTimerTool/TIMER" , m_timer , this , true ) ;
118 if ( sc.isFailure() )
119 {
120 error() << "Could not retrieve ISequencerTimerTool" << endmsg ;
121 return sc ;
122 }
123 }
124 }
125 // get incident service
126 if ( !m_incSvc )
127 {
128 m_incSvc = Auditor::service ( "IncidentSvc" );
129 if ( !m_incSvc )
130 {
131 error() << "Could not retrieve 'IncidentSvc'" << endmsg ;
132 return StatusCode::FAILURE ;
133 }
134 m_incSvc -> addListener ( this , IncidentType::BeginEvent ) ;
135 m_incSvc -> addListener ( this , IncidentType::EndEvent ) ;
136 }
137 // get the application manager
138 if ( !m_appMgr )
139 {
140 m_appMgr = Auditor::service ( "ApplicationMgr" );
141 if ( !m_appMgr )
142 {
143 error() << "Could not retrieve 'ApplicationMgr'" << endmsg ;
144 return sc ;
145 }
146 if ( m_map.end() == m_map.find( m_appMgr.get() ) )
147 {
148 m_map.insert ( m_appMgr.get() , m_timer->addTimer( "EVENT LOOP" ) ) ;
149 }
150 }
151 //
152 return StatusCode::SUCCESS ;
153 }
Auditor::service
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn't already exist.
Definition: Auditor.h:110
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
GaudiUtils::VectorMap::insert
result_type insert(const key_type &key, const mapped_type &mapped)
insert the (key,value) pair into the container
Definition: VectorMap.h:317
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
IToolSvc::retrieveTool
StatusCode retrieveTool(const std::string &type, T *&tool, const IInterface *parent=nullptr, bool createIf=true)
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned...
Definition: IToolSvc.h:145
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:455
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:198
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:77
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:73
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:79
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:71
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:75
Auditor::initialize
virtual StatusCode initialize()
Definition: Auditor.cpp:82
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

TimingAuditor& TimingAuditor::operator= | ( | const TimingAuditor & |  | ) |
| delete

## Member Data Documentation

SmartIF<INamedInterface> TimingAuditor::m_appMgr = nullptr
| private

ApplicationManager.

Definition at line 77 of file TimingAuditor.cpp.

bool TimingAuditor::m_goodForDOD = false
| private

"optimized for DOD"

Definition at line 85 of file TimingAuditor.cpp.

bool TimingAuditor::m_histoSaved = false
| private

Definition at line 90 of file TimingAuditor.cpp.

SmartIF<IIncidentSvc> TimingAuditor::m_incSvc = nullptr
| private

incident service

Definition at line 73 of file TimingAuditor.cpp.

int TimingAuditor::m_indent = 0
| private

indentation level

Definition at line 81 of file TimingAuditor.cpp.

bool TimingAuditor::m_inEvent = false
| private

"In event" flag

Definition at line 83 of file TimingAuditor.cpp.

GaudiUtils::VectorMap<const INamedInterface*,int> TimingAuditor::m_map
| private

Definition at line 79 of file TimingAuditor.cpp.

GaudiUtils::HashMap<std::string,int> TimingAuditor::m_mapUser
| private

map used to record user timing events

Definition at line 87 of file TimingAuditor.cpp.

ISequencerTimerTool* TimingAuditor::m_timer = nullptr
| private

the timer tool

Definition at line 75 of file TimingAuditor.cpp.

SmartIF<IToolSvc> TimingAuditor::m_toolSvc = nullptr
| private

tool service

Definition at line 71 of file TimingAuditor.cpp.

The documentation for this class was generated from the following file:

- GaudiAlg/src/components/TimingAuditor.cpp