| The Gaudi Framework v32r1 (f65d50dc)

Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
IntelProfilerAuditor Class Reference
Inheritance diagram for IntelProfilerAuditor:
[legend]
Collaboration diagram for IntelProfilerAuditor:
[legend]

## Classes
struct | stack_entity

## Public Member Functions
StatusCode | initialize () override
void | handle (const Incident &incident) override
void | before (StandardEventType type, INamedInterface *i) override
void | after (StandardEventType type, INamedInterface *i, const StatusCode &sc) override
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
virtual StatusCode | finalize ()
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 | start_profiling_component (const std::string &name)
void | skip_profiling_component (const std::string &name)
void | start ()
void | pause ()
void | resume ()
void | stop ()
bool | hasIncludes () const
bool | isIncluded (const std::string &name) const
bool | isExcluded (const std::string &name) const
bool | isRunning () const
int | stackLevel () const
std::string | stackIndent (bool newLevel=false) const
std::string | taskTypeName (const std::string &component_name) const

## Private Attributes
Gaudi::Property< std::vector< std::string > > | m_included {this, "IncludeAlgorithms", {}, "Names of included algorithms."}
Gaudi::Property< std::vector< std::string > > | m_excluded {this, "ExcludeAlgorithms", {}, "Names of excluded algorithms."}
Gaudi::Property< int > | m_nStartFromEvent
Gaudi::Property< int > | m_nStopAtEvent
Gaudi::Property< std::vector< std::string > > | m_algs_for_tasktypes
Gaudi::Property< std::string > | m_alg_delim
Gaudi::Property< bool > | m_enable_frames
Gaudi::Property< int > | m_frames_rate
int | m_nEvents = 0
__itt_domain * | domain = nullptr
bool | m_isStarted = false
std::vector< stack_entity > | m_stack
TaskTypes | m_tasktypes

## 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

Definition at line 31 of file IntelProfilerAuditor.cpp.

## Member Function Documentation

## ◆ after() [1/5]

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() [2/5]

void Auditor::after
| override

Definition at line 133 of file Auditor.cpp.

133 {}

## ◆ after() [3/5]

void Auditor::after
| override

Definition at line 135 of file Auditor.cpp.

135 {}

## ◆ after() [4/5]

void Auditor::after
| override

Definition at line 136 of file Auditor.cpp.

136 {}

## ◆ after() [5/5]

void IntelProfilerAuditor::after | ( | StandardEventType | type,
|  | INamedInterface * | i,
|  | const StatusCode & | sc
| ) |  |
| override

Definition at line 318 of file IntelProfilerAuditor.cpp.

318 {
319 // Skip unnecessary event types
320 if ( !( ( type == IAuditor::Execute ) && m_isStarted ) ) return;
321
322 if ( ( m_nEvents + 1 ) % m_frames_rate == 0 ) { __itt_frame_end_v3( domain, NULL ); }
323
324 // Name of the current component
325 const std::string& name = i->name();
326 stack_entity state = m_stack.back();
327 // Remove component from stack.
328 m_stack.pop_back();
329
330 if ( state.event != 0 ) {
331 debug() << stackIndent( true ) << "End event for " << name << endmsg;
332 __itt_event_end( state.event );
333
334 if ( state.parent_event != 0 ) {
335 debug() << stackIndent() << "Resume event for " << state.parent_event << endmsg;
336 __itt_event_start( state.parent_event );
337 }
338 }
339
340 if ( m_stack.empty() ) {
341 // Pause if there are no parent components (top algorithm).
342 pause();
343 } else if ( state.status ) {
344 // If the profiling is running and we have parent component that is
345 // paused then pause the profiling.
346 if ( !m_stack.back().status ) { pause(); }
347 } else {
348 // If the profiling was stopped, but the parent component should be profiled
349 // then resume profiling.
350 if ( m_stack.back().status ) { resume(); }
351 }
352 }
IntelProfilerAuditor::resume
void resume()
Definition: IntelProfilerAuditor.cpp:166
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:92
IntelProfilerAuditor::m_frames_rate
Gaudi::Property< int > m_frames_rate
Definition: IntelProfilerAuditor.cpp:79
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:90
gaudirun.type
type
Definition: gaudirun.py:142
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
IntelProfilerAuditor::pause
void pause()
Definition: IntelProfilerAuditor.cpp:172
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96
IAuditor::Execute
Definition: IAuditor.h:24
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ before() [1/5]

void Auditor::before
| override

Definition at line 97 of file Auditor.cpp.

97 {}

## ◆ before() [2/5]

void Auditor::before
| override

Definition at line 100 of file Auditor.cpp.

100 {}

## ◆ before() [3/5]

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() [4/5]

void Auditor::before
| override

Definition at line 99 of file Auditor.cpp.

99 {}

## ◆ before() [5/5]

void IntelProfilerAuditor::before | ( | StandardEventType | type,
|  | INamedInterface * | i
| ) |  |
| override

Definition at line 274 of file IntelProfilerAuditor.cpp.

274 {
275 // Skip unnecessary event types.
276 if ( !( ( type == IAuditor::Execute ) && m_isStarted ) ) return;
277
278 // Name of the current component.
279 const std::string& name = i->name();
280 // debug() << "Before: " << name << " " << type << endmsg;
281
282 if ( isRunning() ) {
283 if ( isExcluded( name ) ) {
284 // If profiling is running and component is explicitly excluded
285 // then skip component.
286 skip_profiling_component( name );
287 } else {
288 // If profiling is running and component is'not explicitly excluded
289 // then start profiling for component (add to stack).
290 start_profiling_component( name );
291 }
292 } else {
293 if ( hasIncludes() ) {
294 // If the profiling is not running and "includes" is explicitly defined ...
295 if ( isIncluded( name ) ) {
296 // and the current component is in the include's list then start the
297 // component profiling.
298 start_profiling_component( name );
299 } else {
300 // and the current component is not in the includes list then skip
301 // a profiling of the component.
302 skip_profiling_component( name );
303 }
304 } else {
305 // If "Includes" property isn't present and the component is ...
306 if ( isExcluded( name ) ) {
307 // in the excludes list then skip a profiling
308 skip_profiling_component( name );
309 } else {
310 // not in the exclude list then start a profiling
311 start_profiling_component( name );
312 }
313 }
314 }
315 if ( m_nEvents % m_frames_rate == 0 ) { __itt_frame_begin_v3( domain, NULL ); }
316 }
IntelProfilerAuditor::start_profiling_component
void start_profiling_component(const std::string &name)
Definition: IntelProfilerAuditor.cpp:125
IntelProfilerAuditor::skip_profiling_component
void skip_profiling_component(const std::string &name)
Definition: IntelProfilerAuditor.cpp:178
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:92
IntelProfilerAuditor::m_frames_rate
Gaudi::Property< int > m_frames_rate
Definition: IntelProfilerAuditor.cpp:79
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
IntelProfilerAuditor::isRunning
bool isRunning() const
Definition: IntelProfilerAuditor.cpp:200
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:90
gaudirun.type
type
Definition: gaudirun.py:142
IntelProfilerAuditor::isExcluded
bool isExcluded(const std::string &name) const
Definition: IntelProfilerAuditor.cpp:196
IntelProfilerAuditor::hasIncludes
bool hasIncludes() const
Definition: IntelProfilerAuditor.cpp:190
IAuditor::Execute
Definition: IAuditor.h:24
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
IntelProfilerAuditor::isIncluded
bool isIncluded(const std::string &name) const
Definition: IntelProfilerAuditor.cpp:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ handle()

void IntelProfilerAuditor::handle | ( | const Incident & | incident | ) |
| override

Definition at line 258 of file IntelProfilerAuditor.cpp.

258 {
259 if ( IncidentType::BeginEvent != incident.type() ) return;
260 // Increment the event counter
261 ++m_nEvents;
262
263 if ( m_nStartFromEvent == m_nEvents ) {
264 info() << "Start profiling (event #" << m_nEvents << ")" << endmsg;
265 start();
266 }
267
268 if ( m_nStopAtEvent == m_nEvents ) {
269 info() << "Stop profiling (event #" << m_nEvents << ")" << endmsg;
270 stop();
271 }
272 }
IntelProfilerAuditor::m_nStartFromEvent
Gaudi::Property< int > m_nStartFromEvent
Definition: IntelProfilerAuditor.cpp:63
IntelProfilerAuditor::m_nStopAtEvent
Gaudi::Property< int > m_nStopAtEvent
Definition: IntelProfilerAuditor.cpp:65
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:38
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:90
IntelProfilerAuditor::start
void start()
Definition: IntelProfilerAuditor.cpp:120
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::stop
void stop()
Definition: IntelProfilerAuditor.cpp:184

## ◆ hasIncludes()

bool IntelProfilerAuditor::hasIncludes | ( |  | ) | const
| private

Definition at line 190 of file IntelProfilerAuditor.cpp.

190 { return !m_included.empty(); }
IntelProfilerAuditor::m_included
Gaudi::Property< std::vector< std::string > > m_included
Definition: IntelProfilerAuditor.cpp:61

## ◆ initialize()

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

Reimplemented from Auditor.

Definition at line 220 of file IntelProfilerAuditor.cpp.

220 {
221 info() << "Initialised" << endmsg;
222
223 IIncidentSvc* inSvc = NULL;
224 const StatusCode sc = serviceLocator()->service( "IncidentSvc", inSvc );
225 if ( sc.isFailure() ) return sc;
226 // Useful to start profiling only after some event, we don't need profile
227 // initialization stage. For that we need to count events with BeginEvent
228 // listener.
229 inSvc->addListener( this, IncidentType::BeginEvent );
230 // If the end event number don't setup we finish profiling at the end
231 // of loop. We don't need profiling finalization stage.
232 inSvc->addListener( this, IncidentType::EndProcessing );
233
234 std::string str_excluded, str_included, str_eventtypes;
235 for ( const auto& name : m_excluded ) { str_excluded += " " + name; }
236 for ( const auto& name : m_included ) { str_included += " " + name; }
237 for ( const auto& name : m_algs_for_tasktypes ) { str_eventtypes += " " + name; }
238
239 if ( !m_included.empty() ) {
240 info() << "Included algorithms (" << m_included.size() << "): " << str_included << endmsg;
241 }
242
243 if ( !m_excluded.empty() ) {
244 info() << "Excluded algorithms (" << m_excluded.size() << "): " << str_excluded << endmsg;
245 }
246
247 if ( !m_algs_for_tasktypes.empty() ) {
248 info() << "Event types (" << m_algs_for_tasktypes.size() << "): " << str_eventtypes << endmsg;
249 }
250
251 // Create a profiler domain for detection of slow events.
252 domain = __itt_domain_create( "Event loop" );
253 domain->flags = m_enable_frames;
254
255 return StatusCode::SUCCESS;
256 }
IntelProfilerAuditor::m_algs_for_tasktypes
Gaudi::Property< std::vector< std::string > > m_algs_for_tasktypes
Definition: IntelProfilerAuditor.cpp:68
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
IntelProfilerAuditor::m_included
Gaudi::Property< std::vector< std::string > > m_included
Definition: IntelProfilerAuditor.cpp:61
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:92
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:197
std::string
STL class.
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IntelProfilerAuditor::m_excluded
Gaudi::Property< std::vector< std::string > > m_excluded
Definition: IntelProfilerAuditor.cpp:62
IntelProfilerAuditor::m_enable_frames
Gaudi::Property< bool > m_enable_frames
Definition: IntelProfilerAuditor.cpp:77
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
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
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23

## ◆ isExcluded()

bool IntelProfilerAuditor::isExcluded | ( | const std::string & | name | ) | const
| private

Definition at line 196 of file IntelProfilerAuditor.cpp.

196 {
197 return std::find( m_excluded.begin(), m_excluded.end(), name ) != m_excluded.end();
198 }
IntelProfilerAuditor::m_excluded
Gaudi::Property< std::vector< std::string > > m_excluded
Definition: IntelProfilerAuditor.cpp:62
std::find
T find(T... args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193

## ◆ isIncluded()

bool IntelProfilerAuditor::isIncluded | ( | const std::string & | name | ) | const
| private

Definition at line 192 of file IntelProfilerAuditor.cpp.

192 {
193 return std::find( m_included.begin(), m_included.end(), name ) != m_included.end();
194 }
IntelProfilerAuditor::m_included
Gaudi::Property< std::vector< std::string > > m_included
Definition: IntelProfilerAuditor.cpp:61
std::find
T find(T... args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193

## ◆ isRunning()

bool IntelProfilerAuditor::isRunning | ( |  | ) | const
| private

Definition at line 200 of file IntelProfilerAuditor.cpp.

200 { return !m_stack.empty() && m_stack.back().status; }
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96

## ◆ pause()

void IntelProfilerAuditor::pause | ( |  | ) |
| private

Definition at line 172 of file IntelProfilerAuditor.cpp.

172 {
173 if ( !m_isStarted ) return;
174 debug() << stackIndent() << "Pause" << endmsg;
175 __itt_pause();
176 }
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ resume()

void IntelProfilerAuditor::resume | ( |  | ) |
| private

Definition at line 166 of file IntelProfilerAuditor.cpp.

166 {
167 if ( !m_isStarted ) return;
168 debug() << stackIndent() << "Resume" << endmsg;
169 __itt_resume();
170 }
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ skip_profiling_component()

void IntelProfilerAuditor::skip_profiling_component | ( | const std::string & | name | ) |
| private

Definition at line 178 of file IntelProfilerAuditor.cpp.

178 {
179 if ( !m_isStarted ) return;
180 m_stack.push_back( stack_entity( name, false ) );
181 debug() << stackIndent() << "Skip component " << name << endmsg;
182 }
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:204
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ stackIndent()

std::string IntelProfilerAuditor::stackIndent | ( | bool | newLevel = `false` | ) | const
| private

Definition at line 204 of file IntelProfilerAuditor.cpp.

204 {
205 std::stringstream indent( std::stringstream::out );
206 indent << std::setw( stackLevel() * 2 + ( newLevel ? 2 : 0 ) ) << " ";
207 return indent.str();
208 }
IntelProfilerAuditor::stackLevel
int stackLevel() const
Definition: IntelProfilerAuditor.cpp:202
std::stringstream
STL class.
std::setw
T setw(T... args)

## ◆ stackLevel()

int IntelProfilerAuditor::stackLevel | ( |  | ) | const
| private

Definition at line 202 of file IntelProfilerAuditor.cpp.

202 { return m_stack.size(); }
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96

## ◆ start()

void IntelProfilerAuditor::start | ( |  | ) |
| private

Definition at line 120 of file IntelProfilerAuditor.cpp.

120 {
121 m_isStarted = true;
122 __itt_resume();
123 }
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ start_profiling_component()

void IntelProfilerAuditor::start_profiling_component | ( | const std::string & | name | ) |
| private

Definition at line 125 of file IntelProfilerAuditor.cpp.

125 {
126 if ( !m_isStarted ) return;
127 std::string typeName = taskTypeName( name );
128 __itt_event taskId = 0;
129 TaskTypes::const_iterator iter = m_tasktypes.find( typeName );
130 if ( iter != m_tasktypes.end() ) { taskId = iter->second; }
131
132 if ( !taskId && m_algs_for_tasktypes.empty() ) {
133 // Create event
134 taskId = __itt_event_create( typeName.c_str(), typeName.size() );
135 m_tasktypes.insert( TaskTypes::value_type( typeName, taskId ) );
136 }
137
138 stack_entity state = stack_entity( name, true, taskId );
139 stack_entity* parent = !m_stack.empty() ? &m_stack.back() : NULL;
140
141 if ( parent != NULL ) {
142 if ( parent->event ) {
143 state.parent_event = parent->event;
144 } else {
145 state.parent_event = parent->parent_event;
146 }
147 }
148
149 if ( taskId && state.parent_event ) {
150 debug() << stackIndent() << "Pause event " << state.parent_event << endmsg;
151 __itt_event_end( state.parent_event );
152 }
153 m_stack.push_back( state );
154
155 debug() << stackIndent() << "Start profiling component " << typeName << endmsg;
156
157 if ( taskId ) {
158 // Start event
159 debug() << stackIndent() << "Start event type " << state.event << " for " << typeName << endmsg;
160 __itt_event_start( state.event );
161 }
162
163 __itt_resume();
164 }
IntelProfilerAuditor::m_algs_for_tasktypes
Gaudi::Property< std::vector< std::string > > m_algs_for_tasktypes
Definition: IntelProfilerAuditor.cpp:68
std::map::end
T end(T... args)
std::string
STL class.
IntelProfilerAuditor::m_tasktypes
TaskTypes m_tasktypes
Definition: IntelProfilerAuditor.cpp:98
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96
std::map::insert
T insert(T... args)
std::map::find
T find(T... args)
std::string::size
T size(T... args)
std::string::c_str
T c_str(T... args)
IntelProfilerAuditor::taskTypeName
std::string taskTypeName(const std::string &component_name) const
Definition: IntelProfilerAuditor.cpp:210
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:204
GaudiDict::typeName
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:21
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ stop()

void IntelProfilerAuditor::stop | ( |  | ) |
| private

Definition at line 184 of file IntelProfilerAuditor.cpp.

184 {
185 if ( !m_isStarted ) return;
186 m_isStarted = false;
187 __itt_pause();
188 }
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:94

## ◆ taskTypeName()

std::string IntelProfilerAuditor::taskTypeName | ( | const std::string & | component_name | ) | const
| private

Definition at line 210 of file IntelProfilerAuditor.cpp.

210 {
211 std::string result;
212 std::string delim = "";
213 for ( const auto& value : m_stack ) {
214 result += delim + value.name;
215 delim = m_alg_delim;
216 }
217 return result + m_alg_delim + component_name;
218 }
std::string
STL class.
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:96
IntelProfilerAuditor::m_alg_delim
Gaudi::Property< std::string > m_alg_delim
Definition: IntelProfilerAuditor.cpp:74

## Member Data Documentation

## ◆ domain

__itt_domain* IntelProfilerAuditor::domain = nullptr
| private

Definition at line 92 of file IntelProfilerAuditor.cpp.

## ◆ m_alg_delim

Gaudi::Property<std::string> IntelProfilerAuditor::m_alg_delim
| private

Initial value:
{this, "TaskTypeNameDelimeter", " ",
"The String delimiter between sequences/algorithms names in "
"\"Task Type\" grouping at Amplifier. Default=\" \"."}

Definition at line 74 of file IntelProfilerAuditor.cpp.

## ◆ m_algs_for_tasktypes

Gaudi::Property<std::vector<std::string> > IntelProfilerAuditor::m_algs_for_tasktypes
| private

Initial value:
{
this,
"ComponentsForTaskTypes",
{},
"Algorithm name, for which intel amplifier task type will be created."
"By default all algorithms have a corresponding task type."}

Definition at line 68 of file IntelProfilerAuditor.cpp.

## ◆ m_enable_frames

Gaudi::Property<bool> IntelProfilerAuditor::m_enable_frames
| private

Initial value:
{this, "EnableFrames", false,
"Enable frames (needed for detecting slow events). Default=false."}

Definition at line 77 of file IntelProfilerAuditor.cpp.

## ◆ m_excluded

Gaudi::Property<std::vector<std::string> > IntelProfilerAuditor::m_excluded {this, "ExcludeAlgorithms", {}, "Names of excluded algorithms."}
| private

Definition at line 62 of file IntelProfilerAuditor.cpp.

## ◆ m_frames_rate

Gaudi::Property<int> IntelProfilerAuditor::m_frames_rate
| private

Initial value:
{this, "FramesRate", 100,
"Frames rate. The recommended maximum rate for calling the Frame API is "
"1000 frames (events) per second. A higher rate may result in large product"
" memory consumption and slow finalization. "
"You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" "
"parameters of amplxe-cl tool to separate slow, medium and fast events. "
"For use frames you need to switch on \"EnableFrames\". "
"Default=100"}

Definition at line 79 of file IntelProfilerAuditor.cpp.

## ◆ m_included

Gaudi::Property<std::vector<std::string> > IntelProfilerAuditor::m_included {this, "IncludeAlgorithms", {}, "Names of included algorithms."}
| private

Definition at line 61 of file IntelProfilerAuditor.cpp.

## ◆ m_isStarted

bool IntelProfilerAuditor::m_isStarted = false
| private

Definition at line 94 of file IntelProfilerAuditor.cpp.

## ◆ m_nEvents

int IntelProfilerAuditor::m_nEvents = 0
| private

Definition at line 90 of file IntelProfilerAuditor.cpp.

## ◆ m_nStartFromEvent

Gaudi::Property<int> IntelProfilerAuditor::m_nStartFromEvent
| private

Initial value:
{
this, "StartFromEventN", 1, "After what event we stop profiling. If 0 than we also profile finalization stage."}

Definition at line 63 of file IntelProfilerAuditor.cpp.

## ◆ m_nStopAtEvent

Gaudi::Property<int> IntelProfilerAuditor::m_nStopAtEvent
| private

Initial value:
{
this, "StopAtEventN", 0,
"After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."}

Definition at line 65 of file IntelProfilerAuditor.cpp.

## ◆ m_stack

std::vector<stack_entity> IntelProfilerAuditor::m_stack
| private

Definition at line 96 of file IntelProfilerAuditor.cpp.

## ◆ m_tasktypes

TaskTypes IntelProfilerAuditor::m_tasktypes
| private

Definition at line 98 of file IntelProfilerAuditor.cpp.

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

- GaudiProfiling/src/component/intel/IntelProfilerAuditor.cpp