geopm
3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
|
Classes | |
class | BatchClient |
Interface that will attach to a batch server. The batch server that it connects to is typically created through a call to the GEOPM DBus interface io.github.geopm.PlatformStartBatch. More... | |
class | BatchClientImp |
class | BatchServer |
class | BatchServerImp |
class | BatchStatus |
class | BatchStatusImp |
class | BatchStatusServer |
class | BatchStatusClient |
class | CNLIOGroup |
IOGroup that wraps interfaces to Compute Node Linux. More... | |
class | CombinedControl |
Used by PlatformIO to define a control as a function of other controls. More... | |
class | CombinedSignal |
Used by PlatformIO to define a signal as a function of other signals. More... | |
class | ConstConfigIOGroup |
class | Control |
class | CpufreqSysfsDriver |
Class used to implement the CpufreqSysfsDriverGroup. More... | |
class | CpuidNull |
class | CpuinfoIOGroup |
IOGroup that provides constants for CPU frequency limits as signals for PlatformIO. More... | |
class | DCGMDevicePool |
class | DCGMDevicePoolImp |
class | DCGMIOGroup |
IOGroup that provides signals and controls for DCGM GPUs. More... | |
class | DerivativeSignal |
class | DifferenceSignal |
class | DomainControl |
class | DrmGpuTopo |
class | DrmSysfsDriver |
Class used to implement the DrmSysfsDriverGroup. More... | |
class | ErrorMessage |
class | DLRegistry |
class | GPUTopo |
class | GPUTopoNull |
class | IOUring |
class | IOUringFallback |
Fallback implementation of the IOUring batch interface. This implementation uses queues of individual read/write operations instead of a single batched operation. More... | |
class | IOUringImp |
Implementation of the IOUring batch interface. This implementation batches operations inside io_uring submission queues. More... | |
class | LevelZero |
class | LevelZeroDevicePool |
class | LevelZeroDevicePoolImp |
class | LevelZeroGPUTopo |
class | LevelZeroImp |
class | LevelZeroIOGroup |
IOGroup that provides signals and controls for GPUs. More... | |
class | LevelZeroSignal |
class | MSR |
This class encodes how to access fields within an MSR, but does not hold the state of any registers. More... | |
class | MSRFieldControl |
class | MSRFieldSignal |
class | MSRIO |
struct | json_checker |
Used to validate types and values of JSON objects. More... | |
class | MSRIOGroup |
IOGroup that provides signals and controls based on MSRs. More... | |
class | MSRIOImp |
class | MSRPath |
class | MultiplicationSignal |
A composite signal used by an IOGroup to produce a signal as the Multiplication of one signal and a double. More... | |
class | NVMLDevicePool |
class | NVMLDevicePoolImp |
class | NVMLGPUTopo |
class | NVMLIOGroup |
IOGroup that provides signals and controls for NVML GPUs. More... | |
class | PlatformIOImp |
class | PlatformTopoImp |
class | POSIXSignal |
class | POSIXSignalImp |
class | RatioSignal |
A composite signal used by an IOGroup to produce a signal as the Ratio of two signals. More... | |
class | RawMSRSignal |
class | RuntimeStats |
Class that aggregates statistics without buffered data. More... | |
class | SDBus |
Abstraction around sd_bus interface for calling methods. More... | |
class | SDBusImp |
class | SDBusMessage |
Abstraction around sd_bus interfaces that read from or append to sd_bus_message types. More... | |
class | SDBusMessageImp |
class | SecurePath |
Helper object to optionally verify that a file was created with a. More... | |
class | ServiceIOGroup |
IOGroup that uses DBus interface to access geopmd provided signals and controls. This IOGroup is not loaded by a server side PlatformIO object. More... | |
class | SharedMemoryImp |
class | Signal |
class | SSTControl |
class | SSTIO |
struct | sst_version_s |
SST Version information. More... | |
struct | sst_cpu_map_interface_s |
A single mapping of logical CPU index to punit CPU. More... | |
struct | sst_cpu_map_interface_batch_s |
struct | sst_mmio_interface_s |
A single MMIO operation. More... | |
struct | sst_mmio_interface_batch_s |
struct | sst_mbox_interface_s |
A single mailbox operation. More... | |
struct | sst_mbox_interface_batch_s |
class | SSTIoctl |
Defines functions that interact directly with SST ioctls. More... | |
class | SSTIoctlImp |
class | SSTIOGroup |
IOGroup that provides a signal for the time since GEOPM startup. More... | |
class | SSTIOImp |
class | SSTSignal |
class | StatsCollector |
Class that accumulates statistics based on PlatformIO requests. More... | |
class | StatsCollectorImp |
class | SysfsDriver |
Class used to implement the SysfsIOGroup base class. More... | |
class | SysfsIOGroup |
class | TimeIOGroup |
IOGroup that provides a signal for the time since GEOPM startup. More... | |
class | TimeSignal |
class | TimeZero |
class | UniqueFd |
A wrapper to close a file descriptor when the descriptor goes out of scope. More... | |
class | Agg |
class | CircularBuffer |
Templated container for a circular buffer implementation. The CircularBuffer container implements a fixed size buffer. Once at capacity, any new insertions cause the oldest entry to be dropped. More... | |
class | Cpuid |
class | Exception |
Class for all GEOPM-specific exceptions. More... | |
class | DeprecationWarning |
class | IOGroup |
class | IOGroupFactory |
class | PlatformIO |
Class which is a collection of all valid control and signal objects for a platform. More... | |
class | PlatformTopo |
class | PluginFactory |
class | SaveControl |
Class that enables the save/restore feature for IOGroups. More... | |
class | SaveControlImp |
struct | signal_info_s |
Information pertaining to a particular signal supported by PlatformIO. More... | |
struct | control_info_s |
Information pertaining to a particular control supported by PlatformIO. More... | |
class | ServiceProxy |
Proxy object for the io.github.geopm D-Bus interface used to implement the ServiceIOGroup. More... | |
class | ServiceProxyImp |
class | SharedMemory |
This class encapsulates an inter-process shared memory region. More... | |
class | SharedMemoryScopedLock |
An object used to automatically hold a SharedMemory mutex while in scope, and release it when out of scope. More... | |
Enumerations | |
enum | string_format_e { STRING_FORMAT_DOUBLE , STRING_FORMAT_INTEGER , STRING_FORMAT_HEX , STRING_FORMAT_RAW64 } |
Functions | |
std::vector< double > | nan_filter (const std::vector< double > &operand) |
const std::string | cpufreq_sysfs_json (void) |
DCGMDevicePool & | dcgm_device_pool () |
const std::string | drm_sysfs_json (void) |
std::string | error_message (int error_value) |
Function that converts an error code into an error message. More... | |
int | exception_handler (std::exception_ptr eptr, bool do_print=false) |
Handle a thrown exception and return an error value. More... | |
uint64_t | hash (const std::string &key) |
void | plugin_load (const std::string &plugin_prefix) |
void | plugin_reset (void) |
std::string | shmem_path_prof (const std::string &shm_key, int pid, int uid) |
void | shmem_create_prof (const std::string &shm_key, size_t size, int pid, int uid, int gid) |
std::string | version (void) |
std::vector< int > | shared_object_version (void) |
void | check_hint (uint64_t hint) |
const GPUTopo & | gpu_topo (void) |
std::string | read_file (const std::string &path) |
Reads the specified file and returns the contents in a string. More... | |
double | read_double_from_file (const std::string &path, const std::string &expected_units) |
Read a file and return a double read from the file. More... | |
void | write_file (const std::string &path, const std::string &contents) |
Writes a string to a file. This will replace the file if it exists or create it if it does not exist. More... | |
std::vector< std::string > | string_split (const std::string &str, const std::string &delim) |
Splits a string according to a delimiter. More... | |
std::string | string_join (const std::vector< std::string > &string_list, const std::string &delim) |
Joins a vector of strings together with a delimiter. More... | |
std::string | hostname (void) |
Returns the current hostname as a string. More... | |
std::vector< std::string > | list_directory_files (const std::string &path) |
List all files in the given directory. More... | |
bool | string_begins_with (const std::string &str, const std::string &key) |
Returns whether one string begins with another. More... | |
bool | string_ends_with (std::string str, std::string key) |
Returns whether one string ends with another. More... | |
std::string | string_format_double (double signal) |
Format a string to best represent a signal encoding a double precision floating point number. More... | |
std::string | string_format_float (double signal) |
Format a string to best represent a signal encoding a single precision floating point number. More... | |
std::string | string_format_integer (double signal) |
Format a string to best represent a signal encoding a decimal integer. More... | |
std::string | string_format_hex (double signal) |
Format a string to best represent a signal encoding an unsigned hexadecimal integer. More... | |
std::string | string_format_raw64 (double signal) |
Format a string to represent the raw memory supporting a signal as an unsigned hexadecimal integer. More... | |
std::function< std::string(double)> | string_format_type_to_function (int format_type) |
Convert a format type enum string_format_e to a format function. More... | |
std::function< std::string(double)> | string_format_name_to_function (const std::string &format_name) |
Convert a format function to a format name to a format function. More... | |
int | string_format_function_to_type (std::function< std::string(double)> format_function) |
Convert a format function to a format type enum string_format_e. More... | |
std::string | get_env (const std::string &name) |
Read an environment variable. More... | |
int | verbosity_level (void) |
Query environment for verbosity level. More... | |
unsigned int | pid_to_uid (const int pid) |
Query for the user id associated with the process id. More... | |
unsigned int | pid_to_gid (const int pid) |
Query for the group id associated with the process id. More... | |
std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > | make_cpu_set (int num_cpu, const std::set< int > &cpu_enabled) |
Wrapper around CPU_ALLOC and CPU_FREE. More... | |
bool | has_cap_sys_admin (void) |
Check if the caller has effective capability CAP_SYS_ADMIN. More... | |
bool | has_cap_sys_admin (int pid) |
Check if the pid has effective capability CAP_SYS_ADMIN. More... | |
std::string | read_symlink_target (const std::string &symlink_path) |
void | enable_fixed_counters (PlatformIO &pio) |
IOGroupFactory & | iogroup_factory (void) |
const LevelZero & | levelzero () |
const LevelZeroDevicePool & | levelzero_device_pool () |
const std::string | arch_msr_json (void) |
const std::string | knl_msr_json (void) |
const std::string | hsx_msr_json (void) |
const std::string | snb_msr_json (void) |
const std::string | skx_msr_json (void) |
const std::string | spr_msr_json (void) |
void | check_expected_key_values (const Json &root, const std::map< std::string, json_checker > &required_key_map, const std::map< std::string, json_checker > &optional_key_map, const std::string &loc_message) |
NVMLDevicePool & | nvml_device_pool (const int num_cpu) |
PlatformIO & | platform_io (void) |
const PlatformTopo & | platform_topo (void) |
struct geopm_time_s | time_zero (void) |
void | time_zero_reset (const geopm_time_s &zero) |
struct geopm_time_s | time_curr (void) |
struct geopm_time_s | time_curr_real (void) |
std::string | time_curr_string (void) |
template<class Type , class ... Args> | |
std::unique_ptr< Type > | make_unique (Args &&...args) |
Implementation of std::make_unique (C++14) for C++11. Note that this version will only work for non-array types. More... | |
const std::string geopm::arch_msr_json | ( | void | ) |
void geopm::check_expected_key_values | ( | const Json & | root, |
const std::map< std::string, json_checker > & | required_key_map, | ||
const std::map< std::string, json_checker > & | optional_key_map, | ||
const std::string & | loc_message | ||
) |
void geopm::check_hint | ( | uint64_t | hint | ) |
const std::string geopm::cpufreq_sysfs_json | ( | void | ) |
DCGMDevicePool & geopm::dcgm_device_pool | ( | ) |
const std::string geopm::drm_sysfs_json | ( | void | ) |
void GEOPM_PUBLIC geopm::enable_fixed_counters | ( | PlatformIO & | pio | ) |
Enable MSR fixed counters.
[in] | pio | Reference to the PlatformIO object used to write the registers. |
std::string GEOPM_PUBLIC geopm::error_message | ( | int | error_value | ) |
Function that converts an error code into an error message.
error_value | The error code associated with the exception. |
int GEOPM_PUBLIC geopm::exception_handler | ( | std::exception_ptr | eptr, |
bool | do_print = false |
||
) |
Handle a thrown exception and return an error value.
This exception handler is used by every GEOPM C interface to handle any exceptions that are thrown during execution of a C++ implementation. If GEOPM has been configured with debugging enabled, then this handler will print an explanatory message to standard error. In all cases it will convert the C++ exception into an error number which can be used with geopm_error_message() to obtain an error message. Note that the error message printed when debugging is enabled has more specific information than the message produced by geopm_error_message().
[in] | eptr | A pointer to a thrown exception such as std::current_exception(). |
[in] | do_print | A bool specifying whether or not to print a debug string to standard error when handling exception. |
std::string GEOPM_PUBLIC geopm::get_env | ( | const std::string & | name | ) |
Read an environment variable.
[in] | The | name of the environment variable to read. |
const GPUTopo & geopm::gpu_topo | ( | void | ) |
bool GEOPM_PUBLIC geopm::has_cap_sys_admin | ( | int | pid | ) |
Check if the pid has effective capability CAP_SYS_ADMIN.
[in] | pid | Linux PID to check |
bool GEOPM_PUBLIC geopm::has_cap_sys_admin | ( | void | ) |
Check if the caller has effective capability CAP_SYS_ADMIN.
uint64_t geopm::hash | ( | const std::string & | key | ) |
std::string GEOPM_PUBLIC geopm::hostname | ( | void | ) |
Returns the current hostname as a string.
const std::string geopm::hsx_msr_json | ( | void | ) |
IOGroupFactory GEOPM_PUBLIC & geopm::iogroup_factory | ( | void | ) |
const std::string geopm::knl_msr_json | ( | void | ) |
const LevelZero & geopm::levelzero | ( | ) |
const LevelZeroDevicePool & geopm::levelzero_device_pool | ( | ) |
std::vector< std::string > GEOPM_PUBLIC geopm::list_directory_files | ( | const std::string & | path | ) |
List all files in the given directory.
[in] | path | Path to the directory. |
std::unique_ptr< cpu_set_t, std::function< void(cpu_set_t *)> > GEOPM_PUBLIC geopm::make_cpu_set | ( | int | num_cpu, |
const std::set< int > & | cpu_enabled | ||
) |
Wrapper around CPU_ALLOC and CPU_FREE.
[in] | num_cpu | The number of CPUs to allocate the CPU set |
[in] | cpu_enabled | The CPUs to be included in the CPU set |
std::unique_ptr<Type> geopm::make_unique | ( | Args &&... | args | ) |
Implementation of std::make_unique (C++14) for C++11. Note that this version will only work for non-array types.
std::vector<double> geopm::nan_filter | ( | const std::vector< double > & | operand | ) |
NVMLDevicePool & geopm::nvml_device_pool | ( | const int | num_cpu | ) |
unsigned int GEOPM_PUBLIC geopm::pid_to_gid | ( | const int | pid | ) |
Query for the group id associated with the process id.
[in] | pid | The process id to query. |
unsigned int GEOPM_PUBLIC geopm::pid_to_uid | ( | const int | pid | ) |
Query for the user id associated with the process id.
[in] | pid | The process id to query. |
PlatformIO GEOPM_PUBLIC & geopm::platform_io | ( | void | ) |
const PlatformTopo GEOPM_PUBLIC & geopm::platform_topo | ( | void | ) |
void GEOPM_PUBLIC geopm::plugin_load | ( | const std::string & | plugin_prefix | ) |
void GEOPM_PUBLIC geopm::plugin_reset | ( | void | ) |
double GEOPM_PUBLIC geopm::read_double_from_file | ( | const std::string & | path, |
const std::string & | expected_units | ||
) |
Read a file and return a double read from the file.
If a double cannot be read from the file or the units reported in the file do not match the expected units, an exception is thrown.
[in] | path | The path of the file to read. |
[in] | expected_units | Expected units to follow the double. Provide an empty string if no units are expected. |
std::string GEOPM_PUBLIC geopm::read_file | ( | const std::string & | path | ) |
Reads the specified file and returns the contents in a string.
[in] | path | The path of the file to read. |
std::string GEOPM_PUBLIC geopm::read_symlink_target | ( | const std::string & | symlink_path | ) |
Read a symlink, returning the target path contained in the symlink.
[in] | symlink_path | Path to the symlink |
std::vector<int> geopm::shared_object_version | ( | void | ) |
void geopm::shmem_create_prof | ( | const std::string & | shm_key, |
size_t | size, | ||
int | pid, | ||
int | uid, | ||
int | gid | ||
) |
std::string geopm::shmem_path_prof | ( | const std::string & | shm_key, |
int | pid, | ||
int | uid | ||
) |
const std::string geopm::skx_msr_json | ( | void | ) |
const std::string geopm::snb_msr_json | ( | void | ) |
const std::string geopm::spr_msr_json | ( | void | ) |
bool GEOPM_PUBLIC geopm::string_begins_with | ( | const std::string & | str, |
const std::string & | key | ||
) |
Returns whether one string begins with another.
bool GEOPM_PUBLIC geopm::string_ends_with | ( | std::string | str, |
std::string | key | ||
) |
Returns whether one string ends with another.
std::string GEOPM_PUBLIC geopm::string_format_double | ( | double | signal | ) |
Format a string to best represent a signal encoding a double precision floating point number.
[in] | signal | A real number that requires many significant digits to accurately represent. |
std::string GEOPM_PUBLIC geopm::string_format_float | ( | double | signal | ) |
Format a string to best represent a signal encoding a single precision floating point number.
[in] | signal | A real number that requires a few significant digits to accurately represent. |
int GEOPM_PUBLIC geopm::string_format_function_to_type | ( | std::function< std::string(double)> | format_function | ) |
Convert a format function to a format type enum string_format_e.
std::string GEOPM_PUBLIC geopm::string_format_hex | ( | double | signal | ) |
Format a string to best represent a signal encoding an unsigned hexadecimal integer.
[in] | signal | An unsigned integer that is best represented as a hexadecimal number and has been assigned to a double precision number |
std::string GEOPM_PUBLIC geopm::string_format_integer | ( | double | signal | ) |
Format a string to best represent a signal encoding a decimal integer.
[in] | signal | An integer that is best represented as a decimal number. |
std::function< std::string(double)> GEOPM_PUBLIC geopm::string_format_name_to_function | ( | const std::string & | format_name | ) |
Convert a format function to a format name to a format function.
std::string GEOPM_PUBLIC geopm::string_format_raw64 | ( | double | signal | ) |
Format a string to represent the raw memory supporting a signal as an unsigned hexadecimal integer.
[in] | signal | A 64-bit unsigned integer that has been byte-wise copied into the memory of signal. |
std::function< std::string(double)> GEOPM_PUBLIC geopm::string_format_type_to_function | ( | int | format_type | ) |
Convert a format type enum string_format_e to a format function.
std::string GEOPM_PUBLIC geopm::string_join | ( | const std::vector< std::string > & | string_list, |
const std::string & | delim | ||
) |
Joins a vector of strings together with a delimiter.
[in] | string_list | The list of strings to be joined. |
[in] | delim | The delimiter to use to join the strings. |
std::vector< std::string > GEOPM_PUBLIC geopm::string_split | ( | const std::string & | str, |
const std::string & | delim | ||
) |
Splits a string according to a delimiter.
[in] | str | The string to be split. |
[in] | delim | The delimiter to use to divide the string. Cannot be empty. |
struct geopm_time_s geopm::time_curr | ( | void | ) |
struct geopm_time_s geopm::time_curr_real | ( | void | ) |
std::string geopm::time_curr_string | ( | void | ) |
struct geopm_time_s geopm::time_zero | ( | void | ) |
void geopm::time_zero_reset | ( | const geopm_time_s & | zero | ) |
int GEOPM_PUBLIC geopm::verbosity_level | ( | void | ) |
Query environment for verbosity level.
Read GEOPM_VERBOSITY environment variable. If set, convert to integer. If unset, or conversion fails, returns default value. The default value is 0 unless the GEOPM software is compiled with –enable-debug configuration. When debug is enabled at compile time, the default value is 2.
Level 0: Print errors and critical warning messages Level 1: Print warning messages Level 2: Print diagnostic info messages
std::string geopm::version | ( | void | ) |
void GEOPM_PUBLIC geopm::write_file | ( | const std::string & | path, |
const std::string & | contents | ||
) |
Writes a string to a file. This will replace the file if it exists or create it if it does not exist.
[in] | path | The path to the file to write to. |
[in] | contents | The string to write to the file. |