Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::PapiPerformanceService Class Reference

Profiling service using the PAPI library. More...

#include <arcane/std/PapiPerformanceService.h>

Inheritance diagram for Arcane::PapiPerformanceService:
Collaboration diagram for Arcane::PapiPerformanceService:

Public Member Functions

 PapiPerformanceService (const ServiceBuildInfo &sbi)
void initialize () override
 Initializes the profiling service.
bool isInitialized () const override
 Indicates if initialize() has already been called.
void startProfiling () override
 Starts profiling.
void switchEvent () override
void stopProfiling () override
 Stops profiling.
void printInfos (bool dump_file) override
 Displays profiling information.
void getInfos (Int64Array &) override
void dumpJSON (JSONWriter &writer) override
 Writes the profiling information to the writer writer.
void reset () override
 Resets the counters.
ITimerMngtimerMng () override
 Timer using the features of this service if they exist. Can be null.
Public Member Functions inherited from Arcane::AbstractService
 ~AbstractService () override
 Destructor.
virtual void build ()
 Build-level construction of the service.
IServiceInfoserviceInfo () const override
 Access to service information. See IServiceInfo for details.
IBaseserviceParent () const override
 Access to the base interface of main Arcane objects.
IServiceserviceInterface () override
 Returns the low-level IService interface of the service.
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
Public Member Functions inherited from Arcane::IService
virtual ~IService ()
 Releases resources.

Private Member Functions

void _printFlops ()
bool _addEvent (int event_code, int event_index)

Static Private Member Functions

static void arcane_papi_handler (int EventSet, void *address, long_long overflow_vector, void *context)

Private Attributes

int m_period = 0
int m_event_set = 0
bool m_only_flops = false
bool m_is_running = false
bool m_is_initialized = false
ITimerMngm_timer_mng = nullptr
IApplicationm_application = nullptr

Additional Inherited Members

Protected Member Functions inherited from Arcane::AbstractService
 AbstractService (const ServiceBuildInfo &)
 Constructor from a ServiceBuildInfo.
Protected Member Functions inherited from Arcane::TraceAccessor
void _setLocalVerboseLevel (Int32 v)
Int32 _localVerboseLevel () const
Protected Member Functions inherited from Arcane::IService
 IService ()
 Constructor.

Detailed Description

Profiling service using the PAPI library.

Definition at line 35 of file PapiPerformanceService.h.

Constructor & Destructor Documentation

◆ PapiPerformanceService()

Arcane::PapiPerformanceService::PapiPerformanceService ( const ServiceBuildInfo & sbi)
explicit

Definition at line 77 of file PapiPerformanceService.cc.

◆ ~PapiPerformanceService()

Arcane::PapiPerformanceService::~PapiPerformanceService ( )
override

Definition at line 89 of file PapiPerformanceService.cc.

Member Function Documentation

◆ _addEvent()

bool Arcane::PapiPerformanceService::_addEvent ( int event_code,
int event_index )
private

Definition at line 137 of file PapiPerformanceService.cc.

◆ _printFlops()

void Arcane::PapiPerformanceService::_printFlops ( )
private

Definition at line 304 of file PapiPerformanceService.cc.

◆ arcane_papi_handler()

void Arcane::PapiPerformanceService::arcane_papi_handler ( int EventSet,
void * address,
long_long overflow_vector,
void * context )
staticprivate

Definition at line 107 of file PapiPerformanceService.cc.

◆ dumpJSON()

void Arcane::PapiPerformanceService::dumpJSON ( JSONWriter & writer)
overridevirtual

Writes the profiling information to the writer writer.

Implements Arcane::IProfilingService.

Definition at line 369 of file PapiPerformanceService.cc.

◆ getInfos()

void Arcane::PapiPerformanceService::getInfos ( Int64Array & array)
overridevirtual

Implements Arcane::IProfilingService.

Definition at line 379 of file PapiPerformanceService.cc.

◆ initialize()

void Arcane::PapiPerformanceService::initialize ( )
overridevirtual

Initializes the profiling service.

This method can only be called once.

Implements Arcane::IProfilingService.

Definition at line 156 of file PapiPerformanceService.cc.

References ARCANE_FATAL, Arcane::TraceAccessor::fatal(), Arcane::platform::getEnvironmentVariable(), Arcane::TraceAccessor::info(), Arcane::String::localstr(), Arcane::math::min(), Arcane::String::null(), Arcane::TraceAccessor::pwarning(), Arcane::AbstractArray< T >::size(), Arcane::String::split(), and Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

◆ isInitialized()

bool Arcane::PapiPerformanceService::isInitialized ( ) const
inlineoverridevirtual

Indicates if initialize() has already been called.

Reimplemented from Arcane::IProfilingService.

Definition at line 47 of file PapiPerformanceService.h.

◆ printInfos()

void Arcane::PapiPerformanceService::printInfos ( bool dump_file)
overridevirtual

Displays profiling information.

Profiling must be stopped. If dump_file is true, file outputs containing the information are generated, which may take time.

Implements Arcane::IProfilingService.

Definition at line 359 of file PapiPerformanceService.cc.

◆ reset()

void Arcane::PapiPerformanceService::reset ( )
overridevirtual

Resets the counters.

Profiling must be stopped for this.

Implements Arcane::IProfilingService.

Definition at line 389 of file PapiPerformanceService.cc.

◆ startProfiling()

void Arcane::PapiPerformanceService::startProfiling ( )
overridevirtual

Starts profiling.

Implements Arcane::IProfilingService.

Definition at line 277 of file PapiPerformanceService.cc.

References ARCANE_CHECK_POINTER, and ARCANE_FATAL.

◆ stopProfiling()

void Arcane::PapiPerformanceService::stopProfiling ( )
overridevirtual

Stops profiling.

Implements Arcane::IProfilingService.

Definition at line 333 of file PapiPerformanceService.cc.

References ARCANE_FATAL.

◆ switchEvent()

void Arcane::PapiPerformanceService::switchEvent ( )
overridevirtual

Implements Arcane::IProfilingService.

Definition at line 296 of file PapiPerformanceService.cc.

◆ timerMng()

ITimerMng * Arcane::PapiPerformanceService::timerMng ( )
overridevirtual

Timer using the features of this service if they exist. Can be null.

Implements Arcane::IProfilingService.

Definition at line 565 of file PapiPerformanceService.cc.

References Arcane::TraceAccessor::traceMng().

Here is the call graph for this function:

Member Data Documentation

◆ m_application

IApplication* Arcane::PapiPerformanceService::m_application = nullptr
private

Definition at line 65 of file PapiPerformanceService.h.

◆ m_event_set

int Arcane::PapiPerformanceService::m_event_set = 0
private

Definition at line 60 of file PapiPerformanceService.h.

◆ m_is_initialized

bool Arcane::PapiPerformanceService::m_is_initialized = false
private

Definition at line 63 of file PapiPerformanceService.h.

◆ m_is_running

bool Arcane::PapiPerformanceService::m_is_running = false
private

Definition at line 62 of file PapiPerformanceService.h.

◆ m_only_flops

bool Arcane::PapiPerformanceService::m_only_flops = false
private

Definition at line 61 of file PapiPerformanceService.h.

◆ m_period

int Arcane::PapiPerformanceService::m_period = 0
private

Definition at line 59 of file PapiPerformanceService.h.

◆ m_timer_mng

ITimerMng* Arcane::PapiPerformanceService::m_timer_mng = nullptr
private

Definition at line 64 of file PapiPerformanceService.h.


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