| The Gaudi Framework v27r1

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

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

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
| IntelProfilerAuditor (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode | initialize ()
void | handle (const Incident &incident)
| Inform that a new incident has occurred. More...
void | before (StandardEventType type, INamedInterface *i)
void | after (StandardEventType type, INamedInterface *i, const StatusCode &sc)
Public Member Functions inherited from Auditor
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| ~Auditor () override=default
| Destructor. More...
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysFinalize () override
| Finalization method invoked by the framework. More...
void | before (StandardEventType, INamedInterface *) override
| The following methods are meant to be implemented by the child class... More...
void | before (StandardEventType, const std::string &) override
void | before (CustomEventTypeRef, INamedInterface *) override
void | before (CustomEventTypeRef, const std::string &) override
void | after (StandardEventType, INamedInterface *, const StatusCode &) override
void | after (StandardEventType, const std::string &, const StatusCode &) override
void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override
void | beforeInitialize (INamedInterface *) override
void | afterInitialize (INamedInterface *) override
void | beforeReinitialize (INamedInterface *) override
void | afterReinitialize (INamedInterface *) override
void | beforeExecute (INamedInterface *) override
void | afterExecute (INamedInterface *, const StatusCode &) override
void | beforeFinalize (INamedInterface *) override
void | afterFinalize (INamedInterface *) override
void | beforeBeginRun (INamedInterface *) override
void | afterBeginRun (INamedInterface *) override
void | beforeEndRun (INamedInterface *) override
void | afterEndRun (INamedInterface *) override
virtual StatusCode | finalize ()
const std::string & | name () const override
bool | isEnabled () const override
SmartIF< ISvcLocator > & | serviceLocator () const
| The standard service locator. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T = IService>
SmartIF< T > | service (const std::string &name, bool createIf=false) const
StatusCode | setProperty (const Property &p) override
| Set a value of a property of an auditor. More...
StatusCode | setProperty (const std::string &s) override
| Implementation of IProperty::setProperty. More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| Implementation of IProperty::setProperty. More...
StatusCode | getProperty (Property *p) const override
| Get the value of a property. More...
const Property & | getProperty (const std::string &name) const override
| Get the property by name. More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| Implementation of IProperty::getProperty. More...
const std::vector< Property * > & | getProperties () const override
| Get all properties. More...
bool | hasProperty (const std::string &name) const override
| Implementation of IProperty::hasProperty. More...
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | setProperties ()
| Set the auditor's properties. More...
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from IIncidentListener
| DeclareInterfaceID (IIncidentListener, 2, 0)
| InterfaceID. More...
Public Member Functions inherited from IInterface
virtual void * | i_cast (const InterfaceID &) const =0
| main cast function More...
virtual std::vector< std::string > | getInterfaceNames () const =0
| Returns a vector of strings containing the names of all the implemented interfaces. More...
virtual unsigned long | addRef ()=0
| Increment the reference count of Interface instance. More...
virtual unsigned long | release ()=0
| Release Interface instance. More...
virtual unsigned long | refCount () const =0
| Current reference count. More...
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)=0
| Set the void** to the pointer to the requested interface of the instance. More...
virtual | ~IInterface ()=default
| Virtual destructor. 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
int | m_nStartFromEvent
int | m_nStopAtEvent
std::vector< std::string > | m_excluded
std::vector< std::string > | m_included
std::vector< std::string > | m_algs_for_tasktypes
std::string | m_alg_delim
bool | m_enable_frames
int | m_frames_rate
int | m_nEvents
__itt_domain * | domain
bool | m_isStarted
std::vector< stack_entity > | m_stack
TaskTypes | m_tasktypes

## Additional Inherited Members
Public Types inherited from Auditor
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using | base_class = CommonMessaging
Public Types inherited from IInterface
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
| Return status. More...
using | iid = Gaudi::InterfaceId< IInterface, 0, 0 >
| Interface ID. More...
using | ext_iids = Gaudi::interface_list< iid >
| Extra interfaces. More...
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface. More...
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

Definition at line 31 of file IntelProfilerAuditor.cpp.

## Constructor & Destructor Documentation

IntelProfilerAuditor::IntelProfilerAuditor | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator
| ) |  |

Definition at line 117 of file IntelProfilerAuditor.cpp.

118 : Auditor(name, pSvcLocator)
119 ,m_nEvents(0), m_isStarted(false) {
120 // ## Properties
121 declareProperty("IncludeAlgorithms", m_included,
122 "Names of included algorithms."
123 );
124 declareProperty("ExcludeAlgorithms", m_excluded,
125 "Names of excluded algorithms."
126 );
127 declareProperty("StartFromEventN", m_nStartFromEvent = 1,
128 "After what event we stop profiling. "
129 "If 0 than we also profile finalization stage."
130 );
131 declareProperty("StopAtEventN", m_nStopAtEvent = 0,
132 "After what event we stop profiling. "
133 "If 0 than we also profile finalization stage. Default = 0."
134 );
135 declareProperty("ComponentsForTaskTypes", m_algs_for_tasktypes,
136 "Algorithm name, for which intel amplifier task type will be created."
137 "By default all algorithms have a corresponding task type.");
138 declareProperty("TaskTypeNameDelimeter", m_alg_delim = " ",
139 "The String delimiter between sequences/algorithms names in "
140 "\"Task Type\" grouping at Amplifier. Default=\" \"."
141 );
142 declareProperty("EnableFrames", m_enable_frames = false,
143 "Enable frames (needed for detecting slow events). Default=false."
144 );
145 declareProperty("FramesRate", m_frames_rate = 100,
146 "Frames rate. The recommended maximum rate for calling the Frame API is "
147 "1000 frames (events) per second. A higher rate may result in large product"
148 " memory consumption and slow finalization. "
149 "You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" "
150 "parameters of amplxe-cl tool to separate slow, medium and fast events. "
151 "For use frames you need to switch on \"EnableFrames\". "
152 "Default=100"
153 );
154 }
IntelProfilerAuditor::m_nStartFromEvent
int m_nStartFromEvent
Definition: IntelProfilerAuditor.cpp:64
IntelProfilerAuditor::m_algs_for_tasktypes
std::vector< std::string > m_algs_for_tasktypes
Definition: IntelProfilerAuditor.cpp:73
IntelProfilerAuditor::m_nStopAtEvent
int m_nStopAtEvent
Definition: IntelProfilerAuditor.cpp:67
IntelProfilerAuditor::m_frames_rate
int m_frames_rate
Definition: IntelProfilerAuditor.cpp:84
IntelProfilerAuditor::m_excluded
std::vector< std::string > m_excluded
Definition: IntelProfilerAuditor.cpp:69
Auditor::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
Auditor::Auditor
Auditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
Definition: Auditor.cpp:12
IntelProfilerAuditor::m_enable_frames
bool m_enable_frames
Definition: IntelProfilerAuditor.cpp:78
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:87
IntelProfilerAuditor::m_alg_delim
std::string m_alg_delim
Definition: IntelProfilerAuditor.cpp:76
IntelProfilerAuditor::m_included
std::vector< std::string > m_included
Definition: IntelProfilerAuditor.cpp:71
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

## Member Function Documentation

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

Definition at line 386 of file IntelProfilerAuditor.cpp.

387 {
388 // Skip unnecessary event types
389 if (!((type == IAuditor::Execute) && m_isStarted)) return;
390
391 if ((m_nEvents+1) % m_frames_rate == 0) {
392 __itt_frame_end_v3(domain, NULL);
393 }
394
395 // Name of the current component
396 const std::string& name = i->name();
397 stack_entity state = m_stack.back();
398 // Remove component from stack.
399 m_stack.pop_back();
400
401
402 if (state.event != 0) {
403 debug() << stackIndent(true) << "End event for "
404 << name << endmsg;
405 __itt_event_end(state.event);
406
407 if (state.parent_event != 0) {
408 debug() << stackIndent() << "Resume event for "
409 << state.parent_event << endmsg;
410 __itt_event_start(state.parent_event);
411 }
412 }
413
414 if (m_stack.empty()) {
415 // Pause if there are no parent components (top algorithm).
416 pause();
417 } else if (state.status) {
418 // If the profiling is running and we have parent component that is
419 // paused then pause the profiling.
420 if (!m_stack.back().status) {
421 pause();
422 }
423 }else {
424 // If the profiling was stopped, but the parent component should be profiled
425 // then resume profiling.
426 if (m_stack.back().status) {
427 resume();
428 }
429 }
430 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
IntelProfilerAuditor::resume
void resume()
Definition: IntelProfilerAuditor.cpp:207
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:89
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
IntelProfilerAuditor::m_frames_rate
int m_frames_rate
Definition: IntelProfilerAuditor.cpp:84
gaudirun.type
string type
Definition: gaudirun.py:151
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:87
IntelProfilerAuditor::pause
void pause()
Definition: IntelProfilerAuditor.cpp:213
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:254
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
IAuditor::Execute
Definition: IAuditor.h:27
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 339 of file IntelProfilerAuditor.cpp.

339 {
340 // Skip unnecessary event types.
341 if (!((type == IAuditor::Execute) && m_isStarted)) return;
342
343 // Name of the current component.
344 const std::string& name = i->name();
345 //debug() << "Before: " << name << " " << type << endmsg;
346
347 if (isRunning()) {
348 if (isExcluded(name)) {
349 // If profiling is running and component is explicitly excluded
350 // then skip component.
351 skip_profiling_component(name);
352 }else{
353 // If profiling is running and component is'not explicitly excluded
354 // then start profiling for component (add to stack).
355 start_profiling_component(name);
356 }
357 }else {
358 if (hasIncludes()) {
359 // If the profiling is not running and "includes" is explicitly defined ...
360 if (isIncluded(name)) {
361 // and the current component is in the include's list then start the
362 // component profiling.
363 start_profiling_component(name);
364 } else{
365 // and the current component is not in the includes list then skip
366 // a profiling of the component.
367 skip_profiling_component(name);
368 }
369 }else {
370 // If "Includes" property isn't present and the component is ...
371 if (isExcluded(name)) {
372 // in the excludes list then skip a profiling
373 skip_profiling_component(name);
374 }else{
375 // not in the exclude list then start a profiling
376 start_profiling_component(name);
377 }
378 }
379 }
380 if (m_nEvents % m_frames_rate == 0) {
381 __itt_frame_begin_v3(domain, NULL);
382 }
383
384 }
IntelProfilerAuditor::start_profiling_component
void start_profiling_component(const std::string &name)
Definition: IntelProfilerAuditor.cpp:161
IntelProfilerAuditor::skip_profiling_component
void skip_profiling_component(const std::string &name)
Definition: IntelProfilerAuditor.cpp:219
IntelProfilerAuditor::isRunning
bool isRunning() const
Definition: IntelProfilerAuditor.cpp:246
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:89
IntelProfilerAuditor::isExcluded
bool isExcluded(const std::string &name) const
Definition: IntelProfilerAuditor.cpp:241
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
std::string
STL class.
IntelProfilerAuditor::m_frames_rate
int m_frames_rate
Definition: IntelProfilerAuditor.cpp:84
gaudirun.type
string type
Definition: gaudirun.py:151
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:87
IntelProfilerAuditor::hasIncludes
bool hasIncludes() const
Definition: IntelProfilerAuditor.cpp:232
IAuditor::Execute
Definition: IAuditor.h:27
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
IntelProfilerAuditor::isIncluded
bool isIncluded(const std::string &name) const
Definition: IntelProfilerAuditor.cpp:236
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

void IntelProfilerAuditor::handle | ( | const Incident & |  | ) |
| virtual

Inform that a new incident has occurred.

Implements IIncidentListener.

Definition at line 321 of file IntelProfilerAuditor.cpp.

321 {
322 if (IncidentType::BeginEvent != incident.type()) return;
323 // Increment the event counter
324 ++m_nEvents;
325
326 if (m_nStartFromEvent == m_nEvents) {
327 info() << "Start profiling (event #" << m_nEvents << ")"
328 << endmsg;
329 start();
330 }
331
332 if (m_nStopAtEvent == m_nEvents) {
333 info() << "Stop profiling (event #" << m_nEvents << ")"
334 << endmsg;
335 stop();
336 }
337 }
IntelProfilerAuditor::m_nStartFromEvent
int m_nStartFromEvent
Definition: IntelProfilerAuditor.cpp:64
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
IntelProfilerAuditor::m_nStopAtEvent
int m_nStopAtEvent
Definition: IntelProfilerAuditor.cpp:67
IntelProfilerAuditor::m_nEvents
int m_nEvents
Definition: IntelProfilerAuditor.cpp:87
IntelProfilerAuditor::start
void start()
Definition: IntelProfilerAuditor.cpp:156
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IntelProfilerAuditor::stop
void stop()
Definition: IntelProfilerAuditor.cpp:226

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

Definition at line 232 of file IntelProfilerAuditor.cpp.

232 {
233 return !m_included.empty();
234 }
std::vector::empty
T empty(T...args)
IntelProfilerAuditor::m_included
std::vector< std::string > m_included
Definition: IntelProfilerAuditor.cpp:71

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

Reimplemented from Auditor.

Definition at line 271 of file IntelProfilerAuditor.cpp.

271 {
272 info() << "Initialised" << endmsg;
273
274 IIncidentSvc * inSvc = NULL;
275 const StatusCode sc = serviceLocator()->service("IncidentSvc", inSvc);
276 if (sc.isFailure())
277 return sc;
278 // Useful to start profiling only after some event, we don't need profile
279 // initialization stage. For that we need to count events with BeginEvent
280 // listener.
281 inSvc->addListener(this, IncidentType::BeginEvent);
282 // If the end event number don't setup we finish profiling at the end
283 // of loop. We don't need profiling finalization stage.
284 inSvc->addListener(this, IncidentType::EndProcessing);
285
286 std::string str_excluded, str_included, str_eventtypes;
287 for (const auto& name : m_excluded) {
288 str_excluded += " " + name;
289 }
290 for (const auto& name : m_included) {
291 str_included += " " + name;
292 }
293 for (const auto& name : m_algs_for_tasktypes) {
294 str_eventtypes += " " + name;
295 }
296
297 if (!m_included.empty()) {
298 info() << "Included algorithms (" << m_included.size()
299 << "): " << str_included << endmsg;
300 }
301
302 if (!m_excluded.empty()){
303 info() << "Excluded algorithms (" << m_excluded.size()
304 << "): " << str_excluded << endmsg;
305 }
306
307 if (!m_algs_for_tasktypes.empty()){
308 info() << "Event types (" << m_algs_for_tasktypes.size()
309 << "): " << str_eventtypes << endmsg;
310 }
311
312 // Create a profiler domain for detection of slow events.
313 domain = __itt_domain_create("Event loop");
314 domain->flags = m_enable_frames;
315
316 return StatusCode::SUCCESS;
317 }
IntelProfilerAuditor::m_algs_for_tasktypes
std::vector< std::string > m_algs_for_tasktypes
Definition: IntelProfilerAuditor.cpp:73
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
IntelProfilerAuditor::domain
__itt_domain * domain
Definition: IntelProfilerAuditor.cpp:89
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::string
STL class.
IntelProfilerAuditor::m_excluded
std::vector< std::string > m_excluded
Definition: IntelProfilerAuditor.cpp:69
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:78
IntelProfilerAuditor::m_enable_frames
bool m_enable_frames
Definition: IntelProfilerAuditor.cpp:78
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:211
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:202
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
IntelProfilerAuditor::m_included
std::vector< std::string > m_included
Definition: IntelProfilerAuditor.cpp:71

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

Definition at line 241 of file IntelProfilerAuditor.cpp.

241 {
242 return std::find(m_excluded.begin(), m_excluded.end(), name) !=
243 m_excluded.end();
244 }
std::vector::end
T end(T...args)
IntelProfilerAuditor::m_excluded
std::vector< std::string > m_excluded
Definition: IntelProfilerAuditor.cpp:69
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202

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

Definition at line 236 of file IntelProfilerAuditor.cpp.

236 {
237 return std::find(m_included.begin(), m_included.end(), name) !=
238 m_included.end();
239 }
std::vector::end
T end(T...args)
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
IntelProfilerAuditor::m_included
std::vector< std::string > m_included
Definition: IntelProfilerAuditor.cpp:71

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

Definition at line 246 of file IntelProfilerAuditor.cpp.

246 {
247 return !m_stack.empty() && m_stack.back().status;
248 }
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93

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

Definition at line 213 of file IntelProfilerAuditor.cpp.

213 {
214 if (!m_isStarted) return;
215 debug() << stackIndent() << "Pause" << endmsg;
216 __itt_pause();
217 }
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:254
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 207 of file IntelProfilerAuditor.cpp.

207 {
208 if (!m_isStarted) return;
209 debug() << stackIndent() << "Resume" << endmsg;
210 __itt_resume();
211 }
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:254
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 219 of file IntelProfilerAuditor.cpp.

219 {
220 if (!m_isStarted) return;
221 m_stack.push_back(stack_entity(name, false));
222 debug() << stackIndent() << "Skip component "
223 << name << endmsg;
224 }
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:254
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 254 of file IntelProfilerAuditor.cpp.

254 {
255 std::stringstream indent(std::stringstream::out);
256 indent << std::setw(stackLevel()*2+(newLevel?2:0)) << " ";
257 return indent.str();
258 }
std::stringstream
STL class.
std::setw
T setw(T...args)
IntelProfilerAuditor::stackLevel
int stackLevel() const
Definition: IntelProfilerAuditor.cpp:250
project_manifest.indent
def indent
Definition: project_manifest.py:11

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

Definition at line 250 of file IntelProfilerAuditor.cpp.

250 {
251 return m_stack.size();
252 }
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93

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

Definition at line 156 of file IntelProfilerAuditor.cpp.

156 {
157 m_isStarted = true;
158 __itt_resume();
159 }
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 161 of file IntelProfilerAuditor.cpp.

161 {
162 if (!m_isStarted) return;
163 std::string typeName = taskTypeName(name);
164 __itt_event taskId = 0;
165 TaskTypes::const_iterator iter = m_tasktypes.find(typeName);
166 if( iter != m_tasktypes.end()) {
167 taskId = iter->second;
168 }
169
170 if(!taskId && m_algs_for_tasktypes.empty()) {
171 // Create event
172 taskId = __itt_event_create(typeName.c_str(), typeName.size());
173 m_tasktypes.insert(TaskTypes::value_type(typeName, taskId));
174 }
175
176 stack_entity state = stack_entity(name, true, taskId);
177 stack_entity* parent = !m_stack.empty()?&m_stack.back():NULL;
178
179 if (parent != NULL) {
180 if (parent->event) {
181 state.parent_event = parent->event;
182 } else {
183 state.parent_event = parent->parent_event;
184 }
185 }
186
187 if (taskId && state.parent_event) {
188 debug() << stackIndent() << "Pause event " <<
189 state.parent_event << endmsg;
190 __itt_event_end(state.parent_event);
191 }
192 m_stack.push_back(state);
193
194 debug() << stackIndent() << "Start profiling component "
195 << typeName << endmsg;
196
197 if (taskId) {
198 // Start event
199 debug() << stackIndent() << "Start event type "
200 << state.event << " for " << typeName << endmsg;
201 __itt_event_start(state.event);
202 }
203
204 __itt_resume();
205 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
std::vector::empty
T empty(T...args)
IntelProfilerAuditor::m_algs_for_tasktypes
std::vector< std::string > m_algs_for_tasktypes
Definition: IntelProfilerAuditor.cpp:73
std::map::end
T end(T...args)
std::string
STL class.
IntelProfilerAuditor::m_tasktypes
TaskTypes m_tasktypes
Definition: IntelProfilerAuditor.cpp:95
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93
IntelProfilerAuditor::stackIndent
std::string stackIndent(bool newLevel=false) const
Definition: IntelProfilerAuditor.cpp:254
std::map::insert
T insert(T...args)
std::map::find
T find(T...args)
IntelProfilerAuditor::taskTypeName
std::string taskTypeName(const std::string &component_name) const
Definition: IntelProfilerAuditor.cpp:261
std::string::size
T size(T...args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
std::string::c_str
T c_str(T...args)
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:244
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 226 of file IntelProfilerAuditor.cpp.

226 {
227 if (!m_isStarted) return;
228 m_isStarted = false;
229 __itt_pause();
230 }
IntelProfilerAuditor::m_isStarted
bool m_isStarted
Definition: IntelProfilerAuditor.cpp:91

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

Definition at line 261 of file IntelProfilerAuditor.cpp.

261 {
262 std::string result;
263 std::string delim = "";
264 for (const auto& value : m_stack) {
265 result += delim+value.name;
266 delim = m_alg_delim;
267 }
268 return result+m_alg_delim+component_name;
269 }
std::string
STL class.
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
IntelProfilerAuditor::m_alg_delim
std::string m_alg_delim
Definition: IntelProfilerAuditor.cpp:76
IntelProfilerAuditor::m_stack
std::vector< stack_entity > m_stack
Definition: IntelProfilerAuditor.cpp:93

## Member Data Documentation

__itt_domain* IntelProfilerAuditor::domain
| private

Definition at line 89 of file IntelProfilerAuditor.cpp.

std::string IntelProfilerAuditor::m_alg_delim
| private

Definition at line 76 of file IntelProfilerAuditor.cpp.

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

Definition at line 73 of file IntelProfilerAuditor.cpp.

bool IntelProfilerAuditor::m_enable_frames
| private

Definition at line 78 of file IntelProfilerAuditor.cpp.

std::vector<std::string> IntelProfilerAuditor::m_excluded
| private

Definition at line 69 of file IntelProfilerAuditor.cpp.

int IntelProfilerAuditor::m_frames_rate
| private

Definition at line 84 of file IntelProfilerAuditor.cpp.

std::vector<std::string> IntelProfilerAuditor::m_included
| private

Definition at line 71 of file IntelProfilerAuditor.cpp.

bool IntelProfilerAuditor::m_isStarted
| private

Definition at line 91 of file IntelProfilerAuditor.cpp.

int IntelProfilerAuditor::m_nEvents
| private

Definition at line 87 of file IntelProfilerAuditor.cpp.

int IntelProfilerAuditor::m_nStartFromEvent
| private

Definition at line 64 of file IntelProfilerAuditor.cpp.

int IntelProfilerAuditor::m_nStopAtEvent
| private

Definition at line 67 of file IntelProfilerAuditor.cpp.

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

Definition at line 93 of file IntelProfilerAuditor.cpp.

TaskTypes IntelProfilerAuditor::m_tasktypes
| private

Definition at line 95 of file IntelProfilerAuditor.cpp.

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

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