ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual StatusCode initialize () override
 Gaudi hooks.
virtual void before (const std::string &event, const std::string &name, const EventContext &) override
 Implement inherited methods from Auditor.
virtual void after (const std::string &event, const std::string &name, const EventContext &, const StatusCode &) override

Private Attributes

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

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}
std::vector< std::string > m_algs
Property: List of algorithms to profile.
ServiceHandle< IVTuneProfilerSvc > m_vtuneProfilerSvc
Handle to VTuneProfilerSvc.

Member Function Documentation

◆ after()

void VTuneAuditor::after ( const std::string & event,
const std::string & name,
const EventContext & ,
const StatusCode &  )
overridevirtual

Definition at line 77 of file VTuneAuditor.cxx.

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

◆ before()

void VTuneAuditor::before ( const std::string & event,
const std::string & name,
const EventContext &  )
overridevirtual

Implement inherited methods from Auditor.

Definition at line 61 of file VTuneAuditor.cxx.

61 {
62
63 for( auto& val : m_algs ) {
64 if ( event == IAuditor::Execute && 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}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)

Member Data Documentation

◆ m_algs

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

Property: List of algorithms to profile.

Definition at line 41 of file VTuneAuditor.h.

◆ m_vtuneProfilerSvc

ServiceHandle< IVTuneProfilerSvc > VTuneAuditor::m_vtuneProfilerSvc
private

Handle to VTuneProfilerSvc.

Definition at line 38 of file VTuneAuditor.h.


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