geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Classes | Public Member Functions | List of all members
geopm::ApplicationSamplerImp Class Reference

#include <ApplicationSamplerImp.hpp>

Inheritance diagram for geopm::ApplicationSamplerImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::ApplicationSamplerImp:
Collaboration graph
[legend]

Classes

struct  m_process_s
 

Public Member Functions

 ApplicationSamplerImp ()
 
 ApplicationSamplerImp (std::shared_ptr< ApplicationStatus > status, const PlatformTopo &platform_topo, const std::map< int, m_process_s > &process_map, bool is_filtered, const std::string &filter_name, const std::vector< bool > &is_cpu_active, const std::string &profile_name, const std::map< int, std::set< int > > &client_cpu_map, std::shared_ptr< Scheduler > scheduler)
 
virtual ~ApplicationSamplerImp ()=default
 
void update (const geopm_time_s &curr_time) override
 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...
 
std::vector< record_sget_records (void) const override
 Get all of the application events that have been recorded since the last call to update_records(). More...
 
short_region_s get_short_region (uint64_t event_signal) const override
 
uint64_t cpu_region_hash (int cpu_idx) const override
 Get the region hash associated with a CPU. More...
 
uint64_t cpu_hint (int cpu_idx) const override
 Get the hint associated with a CPU. More...
 
double cpu_hint_time (int cpu_idx, uint64_t hint) const override
 Get the amount of time a CPU has been measured running with a hint. More...
 
double cpu_progress (int cpu_idx) const override
 Get the progress reported on a CPU. More...
 
void connect (const std::vector< int > &client_pids) override
 Connect with an application using a key. More...
 
std::vector< int > client_pids (void) const override
 
std::set< int > client_cpu_set (int client_pid) const override
 
bool do_shutdown (void) const override
 
double total_time (void) const override
 
double overhead_time (void) const override
 
int sampler_cpu (void)
 
- Public Member Functions inherited from geopm::ApplicationSampler
virtual ~ApplicationSampler ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::ApplicationSampler
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 inherited from geopm::ApplicationSampler
 ApplicationSampler ()=default
 

Constructor & Destructor Documentation

◆ ApplicationSamplerImp() [1/2]

geopm::ApplicationSamplerImp::ApplicationSamplerImp ( )

◆ ApplicationSamplerImp() [2/2]

geopm::ApplicationSamplerImp::ApplicationSamplerImp ( std::shared_ptr< ApplicationStatus status,
const PlatformTopo &  platform_topo,
const std::map< int, m_process_s > &  process_map,
bool  is_filtered,
const std::string &  filter_name,
const std::vector< bool > &  is_cpu_active,
const std::string &  profile_name,
const std::map< int, std::set< int > > &  client_cpu_map,
std::shared_ptr< Scheduler scheduler 
)

◆ ~ApplicationSamplerImp()

virtual geopm::ApplicationSamplerImp::~ApplicationSamplerImp ( )
virtualdefault

Member Function Documentation

◆ client_cpu_set()

std::set< int > geopm::ApplicationSamplerImp::client_cpu_set ( int  client_pid) const
overridevirtual

◆ client_pids()

std::vector< int > geopm::ApplicationSamplerImp::client_pids ( void  ) const
overridevirtual

◆ connect()

void geopm::ApplicationSamplerImp::connect ( const std::vector< int > &  client_pids)
overridevirtual

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.

Implements geopm::ApplicationSampler.

◆ cpu_hint()

uint64_t geopm::ApplicationSamplerImp::cpu_hint ( int  cpu_idx) const
overridevirtual

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.

Implements geopm::ApplicationSampler.

◆ cpu_hint_time()

double geopm::ApplicationSamplerImp::cpu_hint_time ( int  cpu_idx,
uint64_t  hint 
) const
overridevirtual

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.

Implements geopm::ApplicationSampler.

◆ cpu_progress()

double geopm::ApplicationSamplerImp::cpu_progress ( int  cpu_idx) const
overridevirtual

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.

Implements geopm::ApplicationSampler.

◆ cpu_region_hash()

uint64_t geopm::ApplicationSamplerImp::cpu_region_hash ( int  cpu_idx) const
overridevirtual

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.

Implements geopm::ApplicationSampler.

◆ do_shutdown()

bool geopm::ApplicationSamplerImp::do_shutdown ( void  ) const
overridevirtual

◆ get_records()

std::vector< record_s > geopm::ApplicationSamplerImp::get_records ( void  ) const
overridevirtual

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

Returns
Vector of application event records.

Implements geopm::ApplicationSampler.

◆ get_short_region()

short_region_s geopm::ApplicationSamplerImp::get_short_region ( uint64_t  event_signal) const
overridevirtual

◆ overhead_time()

double geopm::ApplicationSamplerImp::overhead_time ( void  ) const
overridevirtual

◆ sampler_cpu()

int geopm::ApplicationSamplerImp::sampler_cpu ( void  )

◆ total_time()

double geopm::ApplicationSamplerImp::total_time ( void  ) const
overridevirtual

◆ update()

void geopm::ApplicationSamplerImp::update ( const geopm_time_s &  curr_time)
overridevirtual

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.

Implements geopm::ApplicationSampler.


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