geopm 3.1.1.dev414+g0e57f5ae
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
geopm::ApplicationStatusImp Class Reference

#include <ApplicationStatus.hpp>

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

Public Member Functions

 ApplicationStatusImp (int num_cpu, std::shared_ptr< SharedMemory > shmem)
 
virtual ~ApplicationStatusImp ()=default
 
void set_hint (int cpu_idx, uint64_t hint) override
 Set the current hint bits for a CPU.
 
uint64_t get_hint (int cpu_idx) const override
 Get the current hint bits for a CPU.
 
void set_hash (int cpu_idx, uint64_t hash, uint64_t hint) override
 Set the hash and hint of the region currently running on a CPU.
 
uint64_t get_hash (int cpu_idx) const override
 Get the hash of the region currently running on a CPU.
 
void reset_work_units (int cpu_idx) override
 
void set_total_work_units (int cpu_idx, int work_units) override
 Reset the total work units for all threads to be completed as part of a parallel region. Calling this method also resets the work completed for the CPU.
 
void increment_work_unit (int cpu_idx) override
 Mark a unit of work completed for this CPU.
 
double get_progress_cpu (int cpu_idx) const override
 Get the current progress for this CPU. Progress is the fraction of the total work units that have been completed.
 
void update_cache (void) override
 Updates the local memory with the latest values from the shared memory. Any calls to get methods will use these values until the cache is updated again.
 
- Public Member Functions inherited from geopm::ApplicationStatus
virtual ~ApplicationStatus ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::ApplicationStatus
static std::unique_ptr< ApplicationStatusmake_unique (int num_cpu, std::shared_ptr< SharedMemory > shmem)
 Create an ApplicationStatus object using the given SharedMemory. The caller is responsible for calling buffer_size() when creating the shared memory, or attaching to an existing shared memory region before passing the object to this method.
 
static size_t buffer_size (int num_cpu)
 Return the required size of the shared memory region used by the ApplicationStatus for the given number of CPUs.
 
- Static Protected Attributes inherited from geopm::ApplicationStatus
static constexpr size_t M_STATUS_SIZE = geopm::hardware_destructive_interference_size
 

Constructor & Destructor Documentation

◆ ApplicationStatusImp()

geopm::ApplicationStatusImp::ApplicationStatusImp ( int  num_cpu,
std::shared_ptr< SharedMemory >  shmem 
)

◆ ~ApplicationStatusImp()

virtual geopm::ApplicationStatusImp::~ApplicationStatusImp ( )
virtualdefault

Member Function Documentation

◆ get_hash()

uint64_t geopm::ApplicationStatusImp::get_hash ( int  cpu_idx) const
overridevirtual

Get the hash of the region currently running on a CPU.

Implements geopm::ApplicationStatus.

◆ get_hint()

uint64_t geopm::ApplicationStatusImp::get_hint ( int  cpu_idx) const
overridevirtual

Get the current hint bits for a CPU.

Parameters
[in]cpu_idxIndex of the Linux logical CPU.
Returns
The current hint for the given CPU.

Implements geopm::ApplicationStatus.

◆ get_progress_cpu()

double geopm::ApplicationStatusImp::get_progress_cpu ( int  cpu_idx) const
overridevirtual

Get the current progress for this CPU. Progress is the fraction of the total work units that have been completed.

Parameters
[in]cpu_idxIndex of the Linux logical CPU.
Returns
Fraction of the total work completed by this CPU.

Implements geopm::ApplicationStatus.

◆ increment_work_unit()

void geopm::ApplicationStatusImp::increment_work_unit ( int  cpu_idx)
overridevirtual

Mark a unit of work completed for this CPU.

Parameters
[in]cpu_idxIndex of the Linux logical CPU

Implements geopm::ApplicationStatus.

◆ reset_work_units()

void geopm::ApplicationStatusImp::reset_work_units ( int  cpu_idx)
overridevirtual

◆ set_hash()

void geopm::ApplicationStatusImp::set_hash ( int  cpu_idx,
uint64_t  hash,
uint64_t  hint 
)
overridevirtual

Set the hash and hint of the region currently running on a CPU.

Implements geopm::ApplicationStatus.

◆ set_hint()

void geopm::ApplicationStatusImp::set_hint ( int  cpu_idx,
uint64_t  hint 
)
overridevirtual

Set the current hint bits for a CPU.

Parameters
[in]cpu_idxIndex of the Linux logical CPU
[in]hintBitfield of hint to set for the CPU. Any existing hint will be overwritten.

Implements geopm::ApplicationStatus.

◆ set_total_work_units()

void geopm::ApplicationStatusImp::set_total_work_units ( int  cpu_idx,
int  work_units 
)
overridevirtual

Reset the total work units for all threads to be completed as part of a parallel region. Calling this method also resets the work completed for the CPU.

Parameters
[in]cpu_idxIndex of the Linux logical CPU

Implements geopm::ApplicationStatus.

◆ update_cache()

void geopm::ApplicationStatusImp::update_cache ( void  )
overridevirtual

Updates the local memory with the latest values from the shared memory. Any calls to get methods will use these values until the cache is updated again.

Implements geopm::ApplicationStatus.


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