Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::PapiPerformanceCounterService Class Reference
Inheritance diagram for Arcane::PapiPerformanceCounterService:
Collaboration diagram for Arcane::PapiPerformanceCounterService:

Public Member Functions

 PapiPerformanceCounterService (const ServiceBuildInfo &sbi)
void build ()
void initialize () override
 Initializes the service.
void _addEvent (int event)
void start () final
 Starts tracking performance counters.
void stop () final
 Stops tracking performance counters.
bool isStarted () const final
 Indicates if the service has started (start() has been called).
Integer getCounters (Int64ArrayView counters, bool do_substract) final
 Retrieves the current values of the counters.
Int64 getCycles () final
 Value of the counter for the number of CPU cycles.
Public Member Functions inherited from Arcane::TraceAccessor
 TraceAccessor (ITraceMng *m)
 Constructs an accessor via the trace manager m.
 TraceAccessor (const TraceAccessor &rhs)
 Copy constructor.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () const
 Trace manager.
TraceMessage info () const
 Flow for an information message.
TraceMessage pinfo () const
 Flow for a parallel information message.
TraceMessage info (char category) const
 Flow for an information message of a given category.
TraceMessage pinfo (char category) const
 Flow for a parallel information message of a given category.
TraceMessage info (bool v) const
 Flow for an information message.
TraceMessage warning () const
 Flow for a warning message.
TraceMessage pwarning () const
TraceMessage error () const
 Flow for an error message.
TraceMessage perror () const
TraceMessage log () const
 Flow for a log message.
TraceMessage plog () const
 Flow for a log message.
TraceMessage logdate () const
 Flow for a log message preceded by the date.
TraceMessage fatal () const
 Flow for a fatal error message.
TraceMessage pfatal () const
 Flow for a parallel fatal error message.
TraceMessageDbg debug (Trace::eDebugLevel=Trace::Medium) const
 Flow for a debug message.
Trace::eDebugLevel configDbgLevel () const
 Debug level of the configuration file.
TraceMessage info (Int32 verbose_level) const
 Flow for an information message of a given level.
TraceMessage linfo () const
 Flow for an information message with the local information level of this instance.
TraceMessage linfo (Int32 relative_level) const
 Flow for an information message with the local information level of this instance.
void fatalMessage (const StandaloneTraceMessage &o) const

Private Attributes

int m_nb_event = 0
int m_event_set = 0
bool m_is_started = false

Additional Inherited Members

Static Public Attributes inherited from Arcane::IPerformanceCounterService
static const int MIN_COUNTER_SIZE = 8
 Minimum size of the view for getCounters().
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const

Detailed Description

Definition at line 579 of file PapiPerformanceService.cc.

Constructor & Destructor Documentation

◆ PapiPerformanceCounterService()

Arcane::PapiPerformanceCounterService::PapiPerformanceCounterService ( const ServiceBuildInfo & sbi)
inline

Definition at line 585 of file PapiPerformanceService.cc.

◆ ~PapiPerformanceCounterService()

Arcane::PapiPerformanceCounterService::~PapiPerformanceCounterService ( )
inline

Definition at line 592 of file PapiPerformanceService.cc.

Member Function Documentation

◆ _addEvent()

void Arcane::PapiPerformanceCounterService::_addEvent ( int event)
inline

Definition at line 624 of file PapiPerformanceService.cc.

◆ build()

void Arcane::PapiPerformanceCounterService::build ( )
inline

Definition at line 600 of file PapiPerformanceService.cc.

◆ getCounters()

Integer Arcane::PapiPerformanceCounterService::getCounters ( Int64ArrayView counters,
bool do_substract )
inlinefinalvirtual

Retrieves the current values of the counters.

This method must only be called if isStarted() is true.

If do_substract is false, fills counters with the current values of the counters. If do_substract is true, fills counters with the difference between the current values and those in counters during the call.

Int64ArrayView counters = ...;
p->getCounters(counters,false);
... // Operation.
p->getCounters(counters,true);
info() << "Nb cycle=" << counters[0].
Interface of a service for accessing performance counters.
virtual Int32 getCounters(Int64ArrayView counters, bool do_substract)=0
Retrieves the current values of the counters.
TraceMessage info() const
Flow for an information message.
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451

The counter at index 0 is always the number of cycles. counters must have enough elements to provide at least MIN_COUNTER_SIZE counters.

Return values
thenumber of counters provided.
Precondition
isStarted()==true

Implements Arcane::IPerformanceCounterService.

Definition at line 656 of file PapiPerformanceService.cc.

References Arcane::TraceAccessor::error(), and Arcane::IPerformanceCounterService::MIN_COUNTER_SIZE.

Referenced by getCycles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCycles()

Int64 Arcane::PapiPerformanceCounterService::getCycles ( )
inlinefinalvirtual

Value of the counter for the number of CPU cycles.

Precondition
isStarted()==true

Implements Arcane::IPerformanceCounterService.

Definition at line 674 of file PapiPerformanceService.cc.

References getCounters().

Here is the call graph for this function:

◆ initialize()

void Arcane::PapiPerformanceCounterService::initialize ( )
inlineoverridevirtual

Initializes the service.

Implements Arcane::IPerformanceCounterService.

Definition at line 604 of file PapiPerformanceService.cc.

References ARCANE_FATAL.

◆ isStarted()

bool Arcane::PapiPerformanceCounterService::isStarted ( ) const
inlinefinalvirtual

Indicates if the service has started (start() has been called).

Implements Arcane::IPerformanceCounterService.

Definition at line 651 of file PapiPerformanceService.cc.

◆ start()

void Arcane::PapiPerformanceCounterService::start ( )
inlinefinalvirtual

Starts tracking performance counters.

Precondition
isStarted()==false.
Postcondition
isStarted()==true.

Implements Arcane::IPerformanceCounterService.

Definition at line 633 of file PapiPerformanceService.cc.

References ARCANE_FATAL.

◆ stop()

void Arcane::PapiPerformanceCounterService::stop ( )
inlinefinalvirtual

Stops tracking performance counters.

Precondition
isStarted()==true.
Postcondition
isStarted()==false.

Implements Arcane::IPerformanceCounterService.

Definition at line 642 of file PapiPerformanceService.cc.

References ARCANE_FATAL.

Member Data Documentation

◆ m_event_set

int Arcane::PapiPerformanceCounterService::m_event_set = 0
private

Definition at line 685 of file PapiPerformanceService.cc.

◆ m_is_started

bool Arcane::PapiPerformanceCounterService::m_is_started = false
private

Definition at line 686 of file PapiPerformanceService.cc.

◆ m_nb_event

int Arcane::PapiPerformanceCounterService::m_nb_event = 0
private

Definition at line 684 of file PapiPerformanceService.cc.


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