geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
geopm::ApplicationSampler Class Referenceabstract

#include <ApplicationSampler.hpp>

Inheritance diagram for geopm::ApplicationSampler:
Inheritance graph
[legend]

Public Member Functions

virtual ~ApplicationSampler ()=default
 
virtual void update (const geopm_time_s &curr_time)=0
 Update the record buffer by clearing out old records and providing a new cache for subsequent calls to the get_records() method. Also update cache of application status for use by hint and progress APIs. More...
 
virtual std::vector< record_sget_records (void) const =0
 Get all of the application events that have been recorded since the last call to update_records(). More...
 
virtual short_region_s get_short_region (uint64_t event_signal) const =0
 
virtual uint64_t cpu_region_hash (int cpu_idx) const =0
 Get the region hash associated with a CPU. More...
 
virtual uint64_t cpu_hint (int cpu_idx) const =0
 Get the hint associated with a CPU. More...
 
virtual double cpu_hint_time (int cpu_idx, uint64_t hint) const =0
 Get the amount of time a CPU has been measured running with a hint. More...
 
virtual double cpu_progress (int cpu_idx) const =0
 Get the progress reported on a CPU. More...
 
virtual void connect (const std::vector< int > &client_pids)=0
 Connect with an application using a key. More...
 
virtual std::vector< int > client_pids (void) const =0
 
virtual std::set< int > client_cpu_set (int client_pid) const =0
 
virtual bool do_shutdown (void) const =0
 
virtual double total_time (void) const =0
 
virtual double overhead_time (void) const =0
 

Static Public Member Functions

static ApplicationSamplerapplication_sampler (void)
 Singleton accessor for the application sampler. More...
 
static std::set< uint64_t > region_hash_network (void)
 Returns set of region hashes associated with application network functions. More...
 

Protected Member Functions

 ApplicationSampler ()=default
 

Constructor & Destructor Documentation

◆ ~ApplicationSampler()

virtual geopm::ApplicationSampler::~ApplicationSampler ( )
virtualdefault

◆ ApplicationSampler()

geopm::ApplicationSampler::ApplicationSampler ( )
protecteddefault

Member Function Documentation

◆ application_sampler()

ApplicationSampler & geopm::ApplicationSampler::application_sampler ( void  )
static

Singleton accessor for the application sampler.

◆ client_cpu_set()

virtual std::set<int> geopm::ApplicationSampler::client_cpu_set ( int  client_pid) const
pure virtual

◆ client_pids()

virtual std::vector<int> geopm::ApplicationSampler::client_pids ( void  ) const
pure virtual

◆ connect()

virtual void geopm::ApplicationSampler::connect ( const std::vector< int > &  client_pids)
pure virtual

Connect with an application using a key.

Called by the Controller to set up all channels of communication with the application using the provided string as a key.

Implemented in geopm::ApplicationSamplerImp.

◆ cpu_hint()

virtual uint64_t geopm::ApplicationSampler::cpu_hint ( int  cpu_idx) const
pure virtual

Get the hint associated with a CPU.

Returns the most recently sampled value for the hint associated with the Linux logical CPU specified by the user. An exception is raised if the value of cpu_idx is negative or greater or equal to platform_topo().num_domain(GEOPM_DOMAIN_CPU).

Parameters
[in]cpu_idxThe index of the linux logical CPU to query.
Returns
The hint associated with the CPU.

Implemented in geopm::ApplicationSamplerImp.

◆ cpu_hint_time()

virtual double geopm::ApplicationSampler::cpu_hint_time ( int  cpu_idx,
uint64_t  hint 
) const
pure virtual

Get the amount of time a CPU has been measured running with a hint.

Returns a total amount of time in seconds that a CPU was measured to be running with the hint value on the Linux logical CPU specified by the user. An exception is raised if the value of cpu_idx is negative or greater or equal to platform_topo().num_domain(GEOPM_DOMAIN_CPU) or if the specified hint is invalid.

Parameters
[in]cpu_idxThe index of the linux logical CPU to query.
Returns
The total time in seconds since the applications started.

Implemented in geopm::ApplicationSamplerImp.

◆ cpu_progress()

virtual double geopm::ApplicationSampler::cpu_progress ( int  cpu_idx) const
pure virtual

Get the progress reported on a CPU.

Returns the most recently sampled value for the fraction of the work units completed by the thread running on the specified CPU. If the CPU queried is not currently executing a thread that is reporting progress, then the value NAN is returned. An exception is raised if the value of cpu_idx is negative or greater or equal to platform_topo().num_domain(GEOPM_DOMAIN_CPU).

Parameters
[in]cpu_idxThe index of the linux logical CPU to query.
Returns
Value between 0.0 and 1.0 representing the fraction of work completed, or NAN.

Implemented in geopm::ApplicationSamplerImp.

◆ cpu_region_hash()

virtual uint64_t geopm::ApplicationSampler::cpu_region_hash ( int  cpu_idx) const
pure virtual

Get the region hash associated with a CPU.

Returns the most recently sampled value for the region hash associated with the Linux logical CPU specified by the user. An exception is raised if the value of cpu_idx is negative or greater or equal to platform_topo().num_domain(GEOPM_DOMAIN_CPU).

Parameters
[in]cpu_idxThe index of the linux logical CPU to query.
Returns
The region hash associated with the CPU.

Implemented in geopm::ApplicationSamplerImp.

◆ do_shutdown()

virtual bool geopm::ApplicationSampler::do_shutdown ( void  ) const
pure virtual

◆ get_records()

virtual std::vector<record_s> geopm::ApplicationSampler::get_records ( void  ) const
pure virtual

Get all of the application events that have been recorded since the last call to update_records().

Returns
Vector of application event records.

Implemented in geopm::ApplicationSamplerImp.

◆ get_short_region()

virtual short_region_s geopm::ApplicationSampler::get_short_region ( uint64_t  event_signal) const
pure virtual

◆ overhead_time()

virtual double geopm::ApplicationSampler::overhead_time ( void  ) const
pure virtual

◆ region_hash_network()

std::set< uint64_t > geopm::ApplicationSampler::region_hash_network ( void  )
static

Returns set of region hashes associated with application network functions.

Returns
Set of network function region hashes.

◆ total_time()

virtual double geopm::ApplicationSampler::total_time ( void  ) const
pure virtual

◆ update()

virtual void geopm::ApplicationSampler::update ( const geopm_time_s &  curr_time)
pure virtual

Update the record buffer by clearing out old records and providing a new cache for subsequent calls to the get_records() method. Also update cache of application status for use by hint and progress APIs.

Implemented in geopm::ApplicationSamplerImp.


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