geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | Static Public Member Functions | List of all members
geopm::PlatformTopo Class Referenceabstract

#include <PlatformTopo.hpp>

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

Public Member Functions

 PlatformTopo ()=default
 
virtual ~PlatformTopo ()=default
 
virtual int num_domain (int domain_type) const =0
 Number of domains on the platform of a particular geopm_domain_e type. More...
 
virtual int domain_idx (int domain_type, int cpu_idx) const =0
 Get the domain index for a particular domain type that contains the given Linux logical CPU index. More...
 
virtual bool is_nested_domain (int inner_domain, int outer_domain) const =0
 Check if one domain type is contained in another. More...
 
virtual std::set< int > domain_nested (int inner_domain, int outer_domain, int outer_idx) const =0
 Get the set of smaller domains contained in a larger one. If the inner domain is not the same as or contained within the outer domain, it throws an error. More...
 

Static Public Member Functions

static std::string domain_type_to_name (int domain_type)
 Convert a domain type enum to a string. More...
 
static int domain_name_to_type (const std::string &domain_name)
 Convert a domain name to its corresponding enum. More...
 
static void create_cache (void)
 Create cache file in tmpfs that can be read instead of popen() call. More...
 

Constructor & Destructor Documentation

◆ PlatformTopo()

geopm::PlatformTopo::PlatformTopo ( )
default

◆ ~PlatformTopo()

virtual geopm::PlatformTopo::~PlatformTopo ( )
virtualdefault

Member Function Documentation

◆ create_cache()

void geopm::PlatformTopo::create_cache ( void  )
static

Create cache file in tmpfs that can be read instead of popen() call.

◆ domain_idx()

virtual int geopm::PlatformTopo::domain_idx ( int  domain_type,
int  cpu_idx 
) const
pure virtual

Get the domain index for a particular domain type that contains the given Linux logical CPU index.

Implemented in geopm::PlatformTopoImp.

◆ domain_name_to_type()

int geopm::PlatformTopo::domain_name_to_type ( const std::string &  domain_name)
static

Convert a domain name to its corresponding enum.

Parameters
[in]nameDomain name which is the enum in lowercase with GEOPM_DOMAIN_ prefix removed.
Returns
Domain type from the geopm_domain_e enum.

◆ domain_nested()

virtual std::set<int> geopm::PlatformTopo::domain_nested ( int  inner_domain,
int  outer_domain,
int  outer_idx 
) const
pure virtual

Get the set of smaller domains contained in a larger one. If the inner domain is not the same as or contained within the outer domain, it throws an error.

Parameters
[in]inner_domainThe contained domain type.
[in]outer_domainThe containing domain type.
[in]outer_idxThe containing domain index.
Returns
The set of domain indices for the inner domain that are within the indexed outer domain.

Implemented in geopm::PlatformTopoImp.

◆ domain_type_to_name()

std::string geopm::PlatformTopo::domain_type_to_name ( int  domain_type)
static

Convert a domain type enum to a string.

These strings are used by the geopmread and geopmwrite tools.

Parameters
[in]domain_typeDomain type from the geopm_domain_e enum.
Returns
Domain name which is the enum name in lowercase with GEOPM_DOMAIN_ prefix removed.

◆ is_nested_domain()

virtual bool geopm::PlatformTopo::is_nested_domain ( int  inner_domain,
int  outer_domain 
) const
pure virtual

Check if one domain type is contained in another.

Parameters
[in]inner_domainThe contained domain type.
[in]outer_domainThe containing domain type.
Returns
True if the inner_domain is contained within the outer_domain.

Implemented in geopm::PlatformTopoImp.

◆ num_domain()

virtual int geopm::PlatformTopo::num_domain ( int  domain_type) const
pure virtual

Number of domains on the platform of a particular geopm_domain_e type.

Implemented in geopm::PlatformTopoImp.


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