| The Gaudi Framework v29r1 (5cd95fa2)

- 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 () 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 (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
| ~PropertyHolder () override=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, TYPE &value, const std::string &doc="none") const
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
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
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...
MSG::Level | msgLevel () const
| get the cached level (originally extracted 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...
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
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
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 ()
| 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::~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 177 of file TimingAuditor.cpp.

178 {
179 switch ( evt ) {
180 case IAuditor::Initialize:
181 i_afterInitialize( alg );
182 break;
183 case IAuditor::Execute:
184 i_afterExecute( alg );
185 break;
186 default:
187 break;
188 }
189 }
TimingAuditor::i_afterInitialize
void i_afterInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:228
IAuditor::Initialize
Definition: IAuditor.h:25
IAuditor::Execute
Definition: IAuditor.h:25
IOTest.evt
evt
Definition: IOTest.py:96
TimingAuditor::i_afterExecute
void i_afterExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:261

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

Definition at line 296 of file TimingAuditor.cpp.

297 {
298 // Ignore obvious mistakes
299 if ( name.empty() && evt.empty() ) {
300 return;
301 }
302
303 // look for the user timer in the map
304 std::string nick = name + ":" + evt;
305 auto found = m_mapUser.find( nick );
306
307 // We cannot do much if the timer is not available
308 if ( m_mapUser.end() == found ) {
309 warning() << "Trying to stop the measure of the timing for '" << nick
310 << "' but it was never started. Check the code" << endmsg;
311 return;
312 }
313 m_timer->stop( found->second );
314 }
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:79
std::string::empty
T empty(T...args)
std::string
STL class.
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:109
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
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:209
IOTest.evt
evt
Definition: IOTest.py:96

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

Definition at line 160 of file TimingAuditor.cpp.

161 {
162 switch ( evt ) {
163 case IAuditor::Initialize:
164 i_beforeInitialize( alg );
165 break;
166 case IAuditor::Execute:
167 i_beforeExecute( alg );
168 break;
169 case IAuditor::Finalize:
170 i_beforeFinalize( alg );
171 break;
172 default:
173 break;
174 }
175 }
TimingAuditor::i_beforeInitialize
void i_beforeInitialize(INamedInterface *alg)
Definition: TimingAuditor.cpp:200
TimingAuditor::i_beforeExecute
void i_beforeExecute(INamedInterface *alg)
Definition: TimingAuditor.cpp:236
IAuditor::Finalize
Definition: IAuditor.h:25
IAuditor::Initialize
Definition: IAuditor.h:25
TimingAuditor::i_beforeFinalize
void i_beforeFinalize(INamedInterface *alg)
Definition: TimingAuditor.cpp:191
IAuditor::Execute
Definition: IAuditor.h:25
IOTest.evt
evt
Definition: IOTest.py:96

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

Definition at line 274 of file TimingAuditor.cpp.

275 {
276 // Ignore obvious mistakes
277 if ( name.empty() && evt.empty() ) {
278 return;
279 }
280
281 // look for the user timer in the map
282 int timer = 0;
283 std::string nick = name + ":" + evt;
284 auto found = m_mapUser.find( nick );
285
286 if ( m_mapUser.end() == found ) {
287 // add a new timer if not yet available
288 timer = m_timer->addTimer( nick );
289 m_mapUser[nick] = timer;
290 } else {
291 timer = found->second;
292 }
293 m_timer->start( timer );
294 }
TimingAuditor::m_mapUser
GaudiUtils::HashMap< std::string, int > m_mapUser
map used to record user timing events
Definition: TimingAuditor.cpp:79
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:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
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:69
IOTest.evt
evt
Definition: IOTest.py:96

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

Reimplemented from Auditor.

Definition at line 138 of file TimingAuditor.cpp.

139 {
140 if ( m_incSvc ) {
141 m_incSvc->removeListener( this, IncidentType::BeginEvent );
142 m_incSvc->removeListener( this, IncidentType::EndEvent );
143 m_incSvc.reset();
144 }
145 if ( m_toolSvc ) {
146 // the 2 following line are commented out: it is
147 // is a temporary hack which prevent a crash due to a problem in
148 // the reference counting
149 // if ( 0 != m_timer )
150 // { m_toolSvc -> releaseTool ( m_timer ) . ignore() ; m_timer = 0 ; }
151 m_toolSvc.reset();
152 }
153 m_appMgr.reset();
154 // clear the map
155 m_map.clear();
156 // finalize the base class
157 return Auditor::finalize();
158 }
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:200
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:73
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:71
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:67
GaudiUtils::VectorMap::clear
void clear()
clear the container
Definition: VectorMap.h:488
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:65
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.

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

Inform that a new incident has occurred.

Definition at line 316 of file TimingAuditor.cpp.

317 {
318 if ( IncidentType::BeginEvent == i.type() ) {
319 m_timer->start( m_map[m_appMgr.get()] );
320 ++m_indent;
321 m_inEvent = true;
322 } else if ( IncidentType::EndEvent == i.type() ) {
323 m_timer->stop( m_map[m_appMgr.get()] );
324 --m_indent;
325 m_inEvent = false;
326 }
327 }
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:77
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:73
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:75
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:71
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:69
ISequencerTimerTool::stop
virtual double stop(int index)=0
stop the counter, return the elapsed time

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

Definition at line 261 of file TimingAuditor.cpp.

262 {
263 if ( !alg ) {
264 return;
265 }
266 auto found = m_map.find( alg );
267 if ( m_map.end() == found ) {
268 return;
269 }
270 m_timer->stop( found->second );
271 --m_indent;
272 }
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:73
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:449
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:75
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:191
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
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 228 of file TimingAuditor.cpp.

229 {
230 if ( m_goodForDOD || !alg ) {
231 return;
232 }
233 --m_indent;
234 }
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:75
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:84

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

Definition at line 236 of file TimingAuditor.cpp.

237 {
238 if ( !alg ) {
239 return;
240 }
241 ++m_indent;
242 auto found = m_map.find( alg );
243 if ( m_map.end() == found ) {
244 debug() << "Insert non-structural component '" << alg->name() << "' of type '"
245 << System::typeinfoName( typeid( *alg ) ) << "' at level " << m_indent << endmsg;
246 std::string nick = alg->name();
247 if ( 0 < m_indent ) {
248 nick = std::string( m_indent, ' ' ) + nick;
249 }
250 if ( !m_goodForDOD ) {
251 nick[0] = '*';
252 }
253 int timer = m_timer->addTimer( nick );
254 m_map.insert( alg, timer );
255 m_timer->start( timer );
256 return;
257 }
258 m_timer->start( found->second );
259 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
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:73
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:312
std::string
STL class.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:449
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:75
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:191
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:115
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:84
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.

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

Definition at line 191 of file TimingAuditor.cpp.

192 {
193 if ( !m_histoSaved ) {
194 m_timer->saveHistograms();
195 m_histoSaved = true;
196 }
197 }
ISequencerTimerTool::saveHistograms
virtual void saveHistograms()=0
prepares and saves the timing histograms
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
TimingAuditor::m_histoSaved
bool m_histoSaved
Definition: TimingAuditor.cpp:82

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

Definition at line 200 of file TimingAuditor.cpp.

201 {
202 if ( m_goodForDOD ) {
203 return;
204 }
205 //
206 if ( !alg ) {
207 return;
208 }
209 auto found = m_map.find( alg );
210 if ( m_map.end() != found ) {
211 return;
212 }
213 ++m_indent;
214 std::string nick = alg->name();
215 if ( 0 < m_indent ) {
216 nick = std::string( m_indent, ' ' ) + nick;
217 }
218 if ( m_inEvent ) {
219 nick[0] = '*';
220 debug() << "Insert non-structural component '" << alg->name() << "' of type '"
221 << System::typeinfoName( typeid( *alg ) ) << "' at level " << m_indent << endmsg;
222 }
223 int timer = m_timer->addTimer( nick );
224 m_map.insert( alg, timer );
225 m_timer->start( timer );
226 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
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:77
TimingAuditor::m_map
GaudiUtils::VectorMap< const INamedInterface *, int > m_map
Definition: TimingAuditor.cpp:73
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:312
std::string
STL class.
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:449
TimingAuditor::m_indent
int m_indent
indentation level
Definition: TimingAuditor.cpp:75
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:191
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:115
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
TimingAuditor::m_goodForDOD
Gaudi::Property< bool > m_goodForDOD
Definition: TimingAuditor.cpp:84
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.

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

factory:

Reimplemented from Auditor.

Definition at line 91 of file TimingAuditor.cpp.

92 {
93 StatusCode sc = Auditor::initialize();
94 if ( sc.isFailure() ) {
95 return sc;
96 } // RETURN
97
98 // get tool service
99 if ( !m_toolSvc ) {
100 m_toolSvc = Auditor::service( "ToolSvc" );
101 if ( !m_toolSvc ) {
102 error() << "Could not retrieve 'ToolSvc' " << endmsg;
103 return StatusCode::FAILURE; // RETURN
104 }
105 if ( !m_timer ) {
106 sc = m_toolSvc->retrieveTool( "SequencerTimerTool/TIMER", m_timer, this, true );
107 if ( sc.isFailure() ) {
108 error() << "Could not retrieve ISequencerTimerTool" << endmsg;
109 return sc;
110 }
111 }
112 }
113 // get incident service
114 if ( !m_incSvc ) {
115 m_incSvc = Auditor::service( "IncidentSvc" );
116 if ( !m_incSvc ) {
117 error() << "Could not retrieve 'IncidentSvc'" << endmsg;
118 return StatusCode::FAILURE;
119 }
120 m_incSvc->addListener( this, IncidentType::BeginEvent );
121 m_incSvc->addListener( this, IncidentType::EndEvent );
122 }
123 // get the application manager
124 if ( !m_appMgr ) {
125 m_appMgr = Auditor::service( "ApplicationMgr" );
126 if ( !m_appMgr ) {
127 error() << "Could not retrieve 'ApplicationMgr'" << endmsg;
128 return sc;
129 }
130 if ( m_map.end() == m_map.find( m_appMgr.get() ) ) {
131 m_map.insert( m_appMgr.get(), m_timer->addTimer( "EVENT LOOP" ) );
132 }
133 }
134 //
135 return StatusCode::SUCCESS;
136 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
Auditor::service
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Auditor.h:109
StatusCode::FAILURE
Definition: StatusCode.h:31
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:73
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:312
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:139
GaudiUtils::VectorMap::find
iterator find(const key_type &key) const
find the element by key
Definition: VectorMap.h:449
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
GaudiUtils::VectorMap::end
iterator end() const
"end" iterator for sequential access (const-only version!)
Definition: VectorMap.h:191
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:106
TimingAuditor::m_appMgr
SmartIF< INamedInterface > m_appMgr
ApplicationManager.
Definition: TimingAuditor.cpp:71
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
TimingAuditor::m_incSvc
SmartIF< IIncidentSvc > m_incSvc
incident service
Definition: TimingAuditor.cpp:67
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
TimingAuditor::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
tool service
Definition: TimingAuditor.cpp:65
TimingAuditor::m_timer
ISequencerTimerTool * m_timer
the timer tool
Definition: TimingAuditor.cpp:69
Auditor::initialize
virtual StatusCode initialize()
Definition: Auditor.cpp:70
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

## Member Data Documentation

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

ApplicationManager.

Definition at line 71 of file TimingAuditor.cpp.

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

Definition at line 84 of file TimingAuditor.cpp.

bool TimingAuditor::m_histoSaved = false
| private

Definition at line 82 of file TimingAuditor.cpp.

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

incident service

Definition at line 67 of file TimingAuditor.cpp.

int TimingAuditor::m_indent = 0
| private

indentation level

Definition at line 75 of file TimingAuditor.cpp.

bool TimingAuditor::m_inEvent = false
| private

"In event" flag

Definition at line 77 of file TimingAuditor.cpp.

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

Definition at line 73 of file TimingAuditor.cpp.

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

map used to record user timing events

Definition at line 79 of file TimingAuditor.cpp.

ISequencerTimerTool* TimingAuditor::m_timer = nullptr
| private

the timer tool

Definition at line 69 of file TimingAuditor.cpp.

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

tool service

Definition at line 65 of file TimingAuditor.cpp.

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

- GaudiAlg/src/components/TimingAuditor.cpp