ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
VTuneAuditor Class Reference

#include <VTuneAuditor.h>

Inheritance diagram for VTuneAuditor:
Collaboration diagram for VTuneAuditor:

Public Member Functions

 VTuneAuditor (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
virtual StatusCode initialize () override
 Gaudi hooks. More...
 
void before (StandardEventType, INamedInterface *) override
 Implement inherited methods from Auditor. 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
 

Private Attributes

ServiceHandle< IVTuneProfilerSvcm_vtuneProfilerSvc
 Handle to VTuneProfilerSvc. More...
 
std::vector< std::string > m_algs
 Property: List of algorithms to profile. More...
 

Detailed Description

Definition at line 17 of file VTuneAuditor.h.

Constructor & Destructor Documentation

◆ VTuneAuditor()

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

Constructor.

Definition at line 14 of file VTuneAuditor.cxx.

15  :
16  Auditor( name, pSvcLocator ),
17  m_vtuneProfilerSvc( "VTuneProfilerService", name )
18 {
19 
20  declareProperty( "ProfiledAlgs", m_algs,
21  "List of profiled algorithms." );
22 
23 }

Member Function Documentation

◆ after() [1/4]

void VTuneAuditor::after ( CustomEventTypeRef  ,
const std::string &  ,
const StatusCode &   
)
inlineoverride

Definition at line 39 of file VTuneAuditor.h.

39 { return; }

◆ after() [2/4]

void VTuneAuditor::after ( CustomEventTypeRef  ,
INamedInterface *  ,
const StatusCode &   
)
inlineoverride

Definition at line 38 of file VTuneAuditor.h.

38 { return; }

◆ after() [3/4]

void VTuneAuditor::after ( StandardEventType  ,
const std::string &  ,
const StatusCode &   
)
inlineoverride

Definition at line 36 of file VTuneAuditor.h.

36 { return; }

◆ after() [4/4]

void VTuneAuditor::after ( StandardEventType  etype,
INamedInterface *  component,
const StatusCode &   
)
override

Definition at line 77 of file VTuneAuditor.cxx.

77  {
78 
79  for( auto& val : m_algs ) {
80  if ( etype == StandardEventType::Execute && component->name() == val ) {
81  if ( m_vtuneProfilerSvc->pauseProfiling().isFailure() ) {
82  msgStream() << MSG::ERROR
83  << "Could not pause the profiling from the auditor"
84  << endmsg;
85  }
86  break;
87  }
88  }
89  return;
90 
91 }

◆ before() [1/4]

void VTuneAuditor::before ( CustomEventTypeRef  ,
const std::string &   
)
inlineoverride

Definition at line 33 of file VTuneAuditor.h.

33 { return; }

◆ before() [2/4]

void VTuneAuditor::before ( CustomEventTypeRef  ,
INamedInterface *   
)
inlineoverride

Definition at line 32 of file VTuneAuditor.h.

32 { return; }

◆ before() [3/4]

void VTuneAuditor::before ( StandardEventType  ,
const std::string &   
)
inlineoverride

Definition at line 30 of file VTuneAuditor.h.

30 { return; }

◆ before() [4/4]

void VTuneAuditor::before ( StandardEventType  etype,
INamedInterface *  component 
)
override

Implement inherited methods from Auditor.

Definition at line 61 of file VTuneAuditor.cxx.

61  {
62 
63  for( auto& val : m_algs ) {
64  if ( etype == StandardEventType::Execute && component->name() == val ) {
65  if ( m_vtuneProfilerSvc->resumeProfiling().isFailure() ) {
66  msgStream() << MSG::ERROR
67  << "Could not resume the profiling from the auditor"
68  << endmsg;
69  }
70  break;
71  }
72  }
73  return;
74 
75 }

◆ initialize()

StatusCode VTuneAuditor::initialize ( )
overridevirtual

Gaudi hooks.

Definition at line 28 of file VTuneAuditor.cxx.

29 {
30 
31  if( !m_vtuneProfilerSvc.retrieve().isSuccess() ) {
32  return StatusCode::FAILURE;
33  }
34 
35  // Copy algorithms from the service
36  const IProperty* vtuneProfSvcProp = dynamic_cast<const IProperty*>(&(*m_vtuneProfilerSvc));
37  if ( !vtuneProfSvcProp ) {
38  msgStream() << MSG::ERROR
39  << "Could not retrieve IProperty interface to VTuneProfilerService."
40  << endmsg;
41  return StatusCode::FAILURE;
42  }
43 
44  std::vector<std::string> props2Copy = { "ProfiledAlgs" };
45  for(auto& prop : props2Copy) {
46  if ( !setProperty(vtuneProfSvcProp->getProperty(prop)) ) {
47  msgStream() << MSG::ERROR
48  << "Cannot set " << prop << " property."
49  << endmsg;
50  return StatusCode::FAILURE;
51  }
52  }
53 
54  return StatusCode::SUCCESS;
55 
56 }

Member Data Documentation

◆ m_algs

std::vector<std::string> VTuneAuditor::m_algs
private

Property: List of algorithms to profile.

Definition at line 47 of file VTuneAuditor.h.

◆ m_vtuneProfilerSvc

ServiceHandle< IVTuneProfilerSvc > VTuneAuditor::m_vtuneProfilerSvc
private

Handle to VTuneProfilerSvc.

Definition at line 44 of file VTuneAuditor.h.


The documentation for this class was generated from the following files:
VTuneAuditor::m_algs
std::vector< std::string > m_algs
Property: List of algorithms to profile.
Definition: VTuneAuditor.h:47
LArPulseShapeRunConfig.Execute
Execute
Definition: LArPulseShapeRunConfig.py:62
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
VTuneAuditor::m_vtuneProfilerSvc
ServiceHandle< IVTuneProfilerSvc > m_vtuneProfilerSvc
Handle to VTuneProfilerSvc.
Definition: VTuneAuditor.h:44
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14