geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
geopm::ApplicationStatus Class Referenceabstract

Object that encapsulates application process information such as the process ID, region hash, or region hint. There will be one ApplicationStatus for the node (board domain) on each side of the shared memory. More...

#include <ApplicationStatus.hpp>

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

Public Member Functions

virtual ~ApplicationStatus ()=default
 
virtual void set_hint (int cpu_idx, uint64_t hint)=0
 Set the current hint bits for a CPU. More...
 
virtual uint64_t get_hint (int cpu_idx) const =0
 Get the current hint bits for a CPU. More...
 
virtual void set_hash (int cpu_idx, uint64_t hash, uint64_t hint)=0
 Set the hash and hint of the region currently running on a CPU. More...
 
virtual uint64_t get_hash (int cpu_idx) const =0
 Get the hash of the region currently running on a CPU. More...
 
virtual void reset_work_units (int cpu_idx)=0
 
virtual void set_total_work_units (int cpu_idx, int work_units)=0
 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. More...
 
virtual void increment_work_unit (int cpu_idx)=0
 Mark a unit of work completed for this CPU. More...
 
virtual double get_progress_cpu (int cpu_idx) const =0
 Get the current progress for this CPU. Progress is the fraction of the total work units that have been completed. More...
 
virtual void update_cache (void)=0
 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. More...
 

Static Public Member Functions

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. More...
 
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. More...
 

Static Protected Attributes

static constexpr size_t M_STATUS_SIZE = geopm::hardware_destructive_interference_size
 

Detailed Description

Object that encapsulates application process information such as the process ID, region hash, or region hint. There will be one ApplicationStatus for the node (board domain) on each side of the shared memory.

Constructor & Destructor Documentation

◆ ~ApplicationStatus()

virtual geopm::ApplicationStatus::~ApplicationStatus ( )
virtualdefault

Member Function Documentation

◆ buffer_size()

size_t geopm::ApplicationStatus::buffer_size ( int  num_cpu)
static

Return the required size of the shared memory region used by the ApplicationStatus for the given number of CPUs.

Returns
Minimum buffer size required for the SharedMemory used by ApplicationStatus.

◆ get_hash()

virtual uint64_t geopm::ApplicationStatus::get_hash ( int  cpu_idx) const
pure virtual

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

Implemented in geopm::ApplicationStatusImp.

◆ get_hint()

virtual uint64_t geopm::ApplicationStatus::get_hint ( int  cpu_idx) const
pure virtual

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.

Implemented in geopm::ApplicationStatusImp.

◆ get_progress_cpu()

virtual double geopm::ApplicationStatus::get_progress_cpu ( int  cpu_idx) const
pure virtual

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.

Implemented in geopm::ApplicationStatusImp.

◆ increment_work_unit()

virtual void geopm::ApplicationStatus::increment_work_unit ( int  cpu_idx)
pure virtual

Mark a unit of work completed for this CPU.

Parameters
[in]cpu_idxIndex of the Linux logical CPU

Implemented in geopm::ApplicationStatusImp.

◆ make_unique()

std::unique_ptr< ApplicationStatus > geopm::ApplicationStatus::make_unique ( int  num_cpu,
std::shared_ptr< SharedMemory >  shmem 
)
static

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.

Returns
A unique_ptr to the new ApplicationStatus object.

◆ reset_work_units()

virtual void geopm::ApplicationStatus::reset_work_units ( int  cpu_idx)
pure virtual

Implemented in geopm::ApplicationStatusImp.

◆ set_hash()

virtual void geopm::ApplicationStatus::set_hash ( int  cpu_idx,
uint64_t  hash,
uint64_t  hint 
)
pure virtual

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

Implemented in geopm::ApplicationStatusImp.

◆ set_hint()

virtual void geopm::ApplicationStatus::set_hint ( int  cpu_idx,
uint64_t  hint 
)
pure virtual

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.

Implemented in geopm::ApplicationStatusImp.

◆ set_total_work_units()

virtual void geopm::ApplicationStatus::set_total_work_units ( int  cpu_idx,
int  work_units 
)
pure virtual

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

Implemented in geopm::ApplicationStatusImp.

◆ update_cache()

virtual void geopm::ApplicationStatus::update_cache ( void  )
pure virtual

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.

Implemented in geopm::ApplicationStatusImp.

Member Data Documentation

◆ M_STATUS_SIZE

constexpr size_t geopm::ApplicationStatus::M_STATUS_SIZE = geopm::hardware_destructive_interference_size
staticconstexprprotected

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