| The Gaudi Framework v32r1 (f65d50dc)

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 ()=delete
| TimingAuditor (const TimingAuditor &)=delete
TimingAuditor & | operator= (const TimingAuditor &)=delete
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
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...
Public Member Functions inherited from Auditor
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| Auditor (const Auditor &a)=delete
Auditor & | operator= (const Auditor &rhs)=delete
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 override
| 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 | setProperties ()
| Set the auditor's properties. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const 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...

## 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...
GaudiUtils::HashMap< std::string, int > | m_mapUser
| map used to record user timing events More...
bool | m_histoSaved = false
Gaudi::Property< bool > | m_goodForDOD {this, "OptimizedForDOD", false, "enable optimization for Data-On-Demand Service"}

## 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
using | Factory = Gaudi::PluginService::Factory< IAuditor *(const std::string &, ISvcLocator *)>
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
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 PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
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 27 of file TimingAuditor.cpp.

## Constructor & Destructor Documentation

## ◆ TimingAuditor() [1/2]

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

## ◆ TimingAuditor() [2/2]

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

## Member Function Documentation

## ◆ after() [1/6]

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

Definition at line 169 of file TimingAuditor.cpp.

169 {
170 switch ( evt ) {
171 case IAuditor::Initialize:
172 i_afterInitialize( alg );
173 break;
174 case IAuditor::Execute:
175 i_afterExecute( alg );
176 break;
177 default:
178 break;
179 }
180 }
TimingAuditor::i_afterInitialize
void i_afterInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:209
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
IAuditor::Initialize
Definition: IAuditor.h:24
IAuditor::Execute
Definition: IAuditor.h:24
IOTest.evt
evt
Definition: IOTest.py:94
TimingAuditor::i_afterExecute
void i_afterExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:232

## ◆ after() [2/6]

void Auditor::after
| override

Definition at line 103 of file Auditor.cpp.

103 {
104 switch ( evt ) {
105 case Initialize:
106 afterInitialize( obj );
107 break;
108 case ReInitialize:
109 afterReinitialize( obj );
110 break;
111 case Execute:
112 afterExecute( obj, sc );
113 break;
114 case BeginRun:
115 afterBeginRun( obj );
116 break;
117 case EndRun:
118 afterEndRun( obj );
119 break;
120 case Finalize:
121 afterFinalize( obj );
122 break;
123 case Start:
124 break;
125 case Stop:
126 break;
127 case ReStart:
128 break;
129 default:
130 break; // do nothing
131 }
132 }
Auditor::afterEndRun
void afterEndRun(INamedInterface *) override
Definition: Auditor.cpp:147
Auditor::afterBeginRun
void afterBeginRun(INamedInterface *) override
Definition: Auditor.cpp:145
Auditor::afterExecute
void afterExecute(INamedInterface *, const StatusCode &) override
Definition: Auditor.cpp:143
Auditor::afterInitialize
void afterInitialize(INamedInterface *) override
Definition: Auditor.cpp:139
Auditor::afterFinalize
void afterFinalize(INamedInterface *) override
Definition: Auditor.cpp:149
IOTest.evt
evt
Definition: IOTest.py:94
Auditor::afterReinitialize
void afterReinitialize(INamedInterface *) override
Definition: Auditor.cpp:141

## ◆ after() [3/6]

void Auditor::after
| override

Definition at line 133 of file Auditor.cpp.

133 {}

## ◆ after() [4/6]

void Auditor::after
| override

Definition at line 135 of file Auditor.cpp.

135 {}

## ◆ after() [5/6]

void Auditor::after
| override

Definition at line 136 of file Auditor.cpp.

136 {}

## ◆ after() [6/6]

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

Definition at line 259 of file TimingAuditor.cpp.

259 {
260 // Ignore obvious mistakes
261 if ( name.empty() && evt.empty() ) { return; }
262
263 // look for the user timer in the map
264 std::string nick = name + ":" + evt;
265 auto found = m_mapUser.find( nick );
266
267 // We cannot do much if the timer is not available
268 if ( m_mapUser.end() == found ) {
269 warning() << "Trying to stop the measure of the timing for '" << nick
270 << "' but it was never started. Check the code" << endmsg;
271 return;
272 }
273 m_timer->stop( found->second );
274 }
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:76
std::string::empty
T empty(T... args)
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
std::string
STL class.
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
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:192
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ before() [1/6]

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

Definition at line 153 of file TimingAuditor.cpp.

153 {
154 switch ( evt ) {
155 case IAuditor::Initialize:
156 i_beforeInitialize( alg );
157 break;
158 case IAuditor::Execute:
159 i_beforeExecute( alg );
160 break;
161 case IAuditor::Finalize:
162 i_beforeFinalize( alg );
163 break;
164 default:
165 break;
166 }
167 }
TimingAuditor::i_beforeInitialize
void i_beforeInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:190
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
TimingAuditor::i_beforeExecute
void i_beforeExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:214
IAuditor::Finalize
Definition: IAuditor.h:24
IAuditor::Initialize
Definition: IAuditor.h:24
TimingAuditor::i_beforeFinalize
void i_beforeFinalize(INamedInterface *alg)
Definition: TimingAuditor.cpp:182
IAuditor::Execute
Definition: IAuditor.h:24
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ before() [2/6]

void Auditor::before
| override

Definition at line 100 of file Auditor.cpp.

100 {}

## ◆ before() [3/6]

void Auditor::before
| override

Definition at line 99 of file Auditor.cpp.

99 {}

## ◆ before() [4/6]

void Auditor::before
| override

The following methods are meant to be implemented by the child class...

Definition at line 67 of file Auditor.cpp.

67 {
68 switch ( evt ) {
69 case Initialize:
70 beforeInitialize( obj );
71 break;
72 case ReInitialize:
73 beforeReinitialize( obj );
74 break;
75 case Execute:
76 beforeExecute( obj );
77 break;
78 case BeginRun:
79 beforeBeginRun( obj );
80 break;
81 case EndRun:
82 beforeEndRun( obj );
83 break;
84 case Finalize:
85 beforeFinalize( obj );
86 break;
87 case Start:
88 break;
89 case Stop:
90 break;
91 case ReStart:
92 break;
93 default:
94 break; // do nothing
95 }
96 }
Auditor::beforeInitialize
void beforeInitialize(INamedInterface *) override
Definition: Auditor.cpp:138
Auditor::beforeBeginRun
void beforeBeginRun(INamedInterface *) override
Definition: Auditor.cpp:144
Auditor::beforeExecute
void beforeExecute(INamedInterface *) override
Definition: Auditor.cpp:142
Auditor::beforeReinitialize
void beforeReinitialize(INamedInterface *) override
Definition: Auditor.cpp:140
Auditor::beforeFinalize
void beforeFinalize(INamedInterface *) override
Definition: Auditor.cpp:148
Auditor::beforeEndRun
void beforeEndRun(INamedInterface *) override
Definition: Auditor.cpp:146
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ before() [5/6]

void Auditor::before
| override

Definition at line 97 of file Auditor.cpp.

97 {}

## ◆ before() [6/6]

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

Definition at line 240 of file TimingAuditor.cpp.

240 {
241 // Ignore obvious mistakes
242 if ( name.empty() && evt.empty() ) { return; }
243
244 // look for the user timer in the map
245 int timer = 0;
246 std::string nick = name + ":" + evt;
247 auto found = m_mapUser.find( nick );
248
249 if ( m_mapUser.end() == found ) {
250 // add a new timer if not yet available
251 timer = m_timer->addTimer( nick );
252 m_mapUser[nick] = timer;
253 } else {
254 timer = found->second;
255 }
256 m_timer->start( timer );
257 }
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:76
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.
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ finalize()

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

Reimplemented from Auditor.

Definition at line 132 of file TimingAuditor.cpp.

132 {
133 if ( m_incSvc ) {
134 m_incSvc->removeListener( this, IncidentType::BeginEvent );
135 m_incSvc->removeListener( this, IncidentType::EndEvent );
136 m_incSvc.reset();
137 }
138 if ( m_toolSvc ) {
139 // the 2 following line are commented out: it is
140 // is a temporary hack which prevent a crash due to a problem in
141 // the reference counting
142 // if ( 0 != m_timer )
143 // { m_toolSvc -> releaseTool ( m_timer ) . ignore() ; m_timer = 0 ; }
144 m_toolSvc.reset();
145 }
146 m_appMgr.reset();
147 // clear the map
148 m_map.clear();
149 // finalize the base class
150 return Auditor::finalize();
151 }
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:191
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:68
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:64
GaudiUtils::VectorMap::clear
void clear()
clear the container
Definition: VectorMap.h:466
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:62
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.

## ◆ handle()

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

Inform that a new incident has occurred.

Definition at line 276 of file TimingAuditor.cpp.

276 {
277 if ( IncidentType::BeginEvent == i.type() ) {
278 m_timer->start( m_map[m_appMgr.get()] );
279 ++m_indent;
280 m_inEvent = true;
281 } else if ( IncidentType::EndEvent == i.type() ) {
282 m_timer->stop( m_map[m_appMgr.get()] );
283 --m_indent;
284 m_inEvent = false;
285 }
286 }
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:38
TimingAuditor::m_inEvent
bool m_inEvent
"In event" flag
Definition: TimingAuditor.cpp:74
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:72
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:68
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:66
ISequencerTimerTool::stop
virtual double stop(int index)=0
stop the counter, return the elapsed time

## ◆ i_afterExecute()

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

Definition at line 232 of file TimingAuditor.cpp.

232 {
233 if ( !alg ) { return; }
234 auto found = m_map.find( alg );
235 if ( m_map.end() == found ) { return; }
236 m_timer->stop( found->second );
237 --m_indent;
238 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:188
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:72
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:430
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
ISequencerTimerTool::stop
virtual double stop(int index)=0
stop the counter, return the elapsed time

## ◆ i_afterInitialize()

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

Definition at line 209 of file TimingAuditor.cpp.

209 {
210 if ( m_goodForDOD || !alg ) { return; }
211 --m_indent;
212 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:72
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:81

## ◆ i_beforeExecute()

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

Definition at line 214 of file TimingAuditor.cpp.

214 {
215 if ( !alg ) { return; }
216 ++m_indent;
217 auto found = m_map.find( alg );
218 if ( m_map.end() == found ) {
219 debug() << "Insert non-structural component '" << alg->name() << "' of type '"
220 << System::typeinfoName( typeid( *alg ) ) << "' at level " << m_indent << endmsg;
221 std::string nick = alg->name();
222 if ( 0 < m_indent ) { nick = std::string( m_indent, ' ' ) + nick; }
223 if ( !m_goodForDOD ) { nick[0] = '*'; }
224 int timer = m_timer->addTimer( nick );
225 m_map.insert( alg, timer );
226 m_timer->start( timer );
227 return;
228 }
229 m_timer->start( found->second );
230 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:188
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:302
std::string
STL class.
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:72
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:430
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:81
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ i_beforeFinalize()

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

Definition at line 182 of file TimingAuditor.cpp.

182 {
183 if ( !m_histoSaved ) {
184 m_timer->saveHistograms();
185 m_histoSaved = true;
186 }
187 }
ISequencerTimerTool::saveHistograms
virtual void saveHistograms()=0
prepares and saves the timing histograms
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
TimingAuditor::m_histoSaved
bool m_histoSaved
Definition: TimingAuditor.cpp:79

## ◆ i_beforeInitialize()

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

Definition at line 190 of file TimingAuditor.cpp.

190 {
191 if ( m_goodForDOD ) { return; }
192 //
193 if ( !alg ) { return; }
194 auto found = m_map.find( alg );
195 if ( m_map.end() != found ) { return; }
196 ++m_indent;
197 std::string nick = alg->name();
198 if ( 0 < m_indent ) { nick = std::string( m_indent, ' ' ) + nick; }
199 if ( m_inEvent ) {
200 nick[0] = '*';
201 debug() << "Insert non-structural component '" << alg->name() << "' of type '"
202 << System::typeinfoName( typeid( *alg ) ) << "' at level " << m_indent << endmsg;
203 }
204 int timer = m_timer->addTimer( nick );
205 m_map.insert( alg, timer );
206 m_timer->start( timer );
207 }
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
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:74
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:188
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:302
std::string
STL class.
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:72
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
ISequencerTimerTool::start
virtual void start(int index)=0
start the counter, i.e.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:430
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:81
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ initialize()

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

factory:

Reimplemented from Auditor.

Definition at line 88 of file TimingAuditor.cpp.

88 {
89 StatusCode sc = Auditor::initialize();
90 if ( sc.isFailure() ) { return sc; } // RETURN
91
92 // get tool service
93 if ( !m_toolSvc ) {
94 m_toolSvc = Auditor::service( "ToolSvc", true );
95 if ( !m_toolSvc ) {
96 error() << "Could not retrieve 'ToolSvc' " << endmsg;
97 return StatusCode::FAILURE; // RETURN
98 }
99 if ( !m_timer ) {
100 sc = m_toolSvc->retrieveTool( "SequencerTimerTool/TIMER", m_timer, this, true );
101 if ( sc.isFailure() ) {
102 error() << "Could not retrieve ISequencerTimerTool" << endmsg;
103 return sc;
104 }
105 }
106 }
107 // get incident service
108 if ( !m_incSvc ) {
109 m_incSvc = Auditor::service( "IncidentSvc", true );
110 if ( !m_incSvc ) {
111 error() << "Could not retrieve 'IncidentSvc'" << endmsg;
112 return StatusCode::FAILURE;
113 }
114 m_incSvc->addListener( this, IncidentType::BeginEvent );
115 m_incSvc->addListener( this, IncidentType::EndEvent );
116 }
117 // get the application manager
118 if ( !m_appMgr ) {
119 m_appMgr = Auditor::service( "ApplicationMgr" );
120 if ( !m_appMgr ) {
121 error() << "Could not retrieve 'ApplicationMgr'" << endmsg;
122 return sc;
123 }
124 if ( m_map.end() == m_map.find( m_appMgr.get() ) ) {
125 m_map.insert( m_appMgr.get(), m_timer->addTimer( "EVENT LOOP" ) );
126 }
127 }
128 //
129 return StatusCode::SUCCESS;
130 }
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:105
ISequencerTimerTool::addTimer
virtual int addTimer(const std::string &name)=0
add a timer entry with the specified name
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:70
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:188
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
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:302
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
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:138
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:68
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:64
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:62
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:430
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:66
Auditor::initialize
virtual StatusCode initialize()
Definition: Auditor.cpp:64
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ operator=()

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

## Member Data Documentation

## ◆ m_appMgr

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

ApplicationManager.

Definition at line 68 of file TimingAuditor.cpp.

## ◆ m_goodForDOD

Gaudi::Property<bool> TimingAuditor::m_goodForDOD {this, "OptimizedForDOD", false, "enable optimization for Data-On-Demand Service"}
| private

Definition at line 81 of file TimingAuditor.cpp.

## ◆ m_histoSaved

bool TimingAuditor::m_histoSaved = false
| private

Definition at line 79 of file TimingAuditor.cpp.

## ◆ m_incSvc

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

incident service

Definition at line 64 of file TimingAuditor.cpp.

## ◆ m_indent

int TimingAuditor::m_indent = 0
| private

indentation level

Definition at line 72 of file TimingAuditor.cpp.

## ◆ m_inEvent

bool TimingAuditor::m_inEvent = false
| private

"In event" flag

Definition at line 74 of file TimingAuditor.cpp.

## ◆ m_map

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

Definition at line 70 of file TimingAuditor.cpp.

## ◆ m_mapUser

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

map used to record user timing events

Definition at line 76 of file TimingAuditor.cpp.

## ◆ m_timer

ISequencerTimerTool* TimingAuditor::m_timer = nullptr
| private

the timer tool

Definition at line 66 of file TimingAuditor.cpp.

## ◆ m_toolSvc

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

tool service

Definition at line 62 of file TimingAuditor.cpp.

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

- GaudiAlg/src/components/TimingAuditor.cpp