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

#include <Agg.hpp>

Public Types

enum  m_type_e {
  M_SUM , M_AVERAGE , M_MEDIAN , M_INTEGER_BITWISE_OR ,
  M_LOGICAL_AND , M_LOGICAL_OR , M_MIN , M_MAX ,
  M_STDDEV , M_REGION_HASH , M_REGION_HINT , M_SELECT_FIRST ,
  M_EXPECT_SAME , M_NUM_TYPE
}
 

Static Public Member Functions

static double sum (const std::vector< double > &operand)
 Returns the sum of the input operands. More...
 
static double average (const std::vector< double > &operand)
 Returns the average of the input operands. More...
 
static double median (const std::vector< double > &operand)
 Returns the median of the input operands. More...
 
static double integer_bitwise_or (const std::vector< double > &operand)
 Returns the output of bitwise OR over all the operands after casting them to int64_t where 0 is false and all positive numbers are true. More...
 
static double logical_and (const std::vector< double > &operand)
 Returns the output of logical AND over all the operands where 0.0 is false and all other values are true. More...
 
static double logical_or (const std::vector< double > &operand)
 Returns the output of logical OR over all the operands where 0.0 is false and all other values are true. More...
 
static double min (const std::vector< double > &operand)
 Returns the minimum value from the input operands. More...
 
static double max (const std::vector< double > &operand)
 Returns the maximum value from the input operands. More...
 
static double stddev (const std::vector< double > &operand)
 Returns the standard deviation of the input operands. More...
 
static double region_hash (const std::vector< double > &operand)
 If all operands are the same, returns the common value. Otherwise, returns GEOPM_REGION_HASH_UNMARKED. This is intended for situations where all ranks in a domain must be in the same region to exert control for that region. More...
 
static double region_hint (const std::vector< double > &operand)
 If all operands are the same, returns the common value. Otherwise, returns GEOPM_REGION_HINT_UNKNOWN. This is intended for situations where all ranks in a domain must be in the same region to exert control for that region. More...
 
static double select_first (const std::vector< double > &operand)
 Returns the first value in the vector and ignores other values. If the vector is empty, returns 0.0. More...
 
static double expect_same (const std::vector< double > &operand)
 Returns the common value if all values are the same, or NAN otherwise. This function should not be used to aggregate values that may be interpreted as NAN such as raw register values. More...
 
static std::function< double(const std::vector< double > &)> name_to_function (const std::string &name)
 Returns the corresponding agg function for a given string name. If the name does not match a known function, it throws an error. More...
 
static std::string function_to_name (std::function< double(const std::vector< double > &)> func)
 Returns the corresponding agg function name for a given std::function. If the std::function does not match a known function, it throws an error. More...
 
static int function_to_type (std::function< double(const std::vector< double > &)> func)
 Returns the corresponding agg function type for a given std::function. If the std::function does not match a known function, it throws an error. More...
 
static std::function< double(const std::vector< double > &)> type_to_function (int agg_type)
 Returns the corresponding agg function for one of the Agg::m_type_e enum values. If the agg_type is out of range, it throws an error. More...
 
static std::string type_to_name (int agg_type)
 Returns the corresponding agg function name for one of the Agg:m_type_e enum values. If the agg_type is out of range, it throws an error. More...
 

Detailed Description

Aggregation functions available to be used by Agents and IOGroups to condense a vector of signal values into a single value.

Member Enumeration Documentation

◆ m_type_e

Enumerator
M_SUM 
M_AVERAGE 
M_MEDIAN 
M_INTEGER_BITWISE_OR 
M_LOGICAL_AND 
M_LOGICAL_OR 
M_MIN 
M_MAX 
M_STDDEV 
M_REGION_HASH 
M_REGION_HINT 
M_SELECT_FIRST 
M_EXPECT_SAME 
M_NUM_TYPE 

Member Function Documentation

◆ average()

double geopm::Agg::average ( const std::vector< double > &  operand)
static

Returns the average of the input operands.

◆ expect_same()

double geopm::Agg::expect_same ( const std::vector< double > &  operand)
static

Returns the common value if all values are the same, or NAN otherwise. This function should not be used to aggregate values that may be interpreted as NAN such as raw register values.

◆ function_to_name()

std::string geopm::Agg::function_to_name ( std::function< double(const std::vector< double > &)>  func)
static

Returns the corresponding agg function name for a given std::function. If the std::function does not match a known function, it throws an error.

◆ function_to_type()

int geopm::Agg::function_to_type ( std::function< double(const std::vector< double > &)>  func)
static

Returns the corresponding agg function type for a given std::function. If the std::function does not match a known function, it throws an error.

◆ integer_bitwise_or()

double geopm::Agg::integer_bitwise_or ( const std::vector< double > &  operand)
static

Returns the output of bitwise OR over all the operands after casting them to int64_t where 0 is false and all positive numbers are true.

◆ logical_and()

double geopm::Agg::logical_and ( const std::vector< double > &  operand)
static

Returns the output of logical AND over all the operands where 0.0 is false and all other values are true.

◆ logical_or()

double geopm::Agg::logical_or ( const std::vector< double > &  operand)
static

Returns the output of logical OR over all the operands where 0.0 is false and all other values are true.

◆ max()

double geopm::Agg::max ( const std::vector< double > &  operand)
static

Returns the maximum value from the input operands.

◆ median()

double geopm::Agg::median ( const std::vector< double > &  operand)
static

Returns the median of the input operands.

◆ min()

double geopm::Agg::min ( const std::vector< double > &  operand)
static

Returns the minimum value from the input operands.

◆ name_to_function()

std::function< double(const std::vector< double > &)> geopm::Agg::name_to_function ( const std::string &  name)
static

Returns the corresponding agg function for a given string name. If the name does not match a known function, it throws an error.

◆ region_hash()

double geopm::Agg::region_hash ( const std::vector< double > &  operand)
static

If all operands are the same, returns the common value. Otherwise, returns GEOPM_REGION_HASH_UNMARKED. This is intended for situations where all ranks in a domain must be in the same region to exert control for that region.

◆ region_hint()

double geopm::Agg::region_hint ( const std::vector< double > &  operand)
static

If all operands are the same, returns the common value. Otherwise, returns GEOPM_REGION_HINT_UNKNOWN. This is intended for situations where all ranks in a domain must be in the same region to exert control for that region.

◆ select_first()

double geopm::Agg::select_first ( const std::vector< double > &  operand)
static

Returns the first value in the vector and ignores other values. If the vector is empty, returns 0.0.

◆ stddev()

double geopm::Agg::stddev ( const std::vector< double > &  operand)
static

Returns the standard deviation of the input operands.

◆ sum()

double geopm::Agg::sum ( const std::vector< double > &  operand)
static

Returns the sum of the input operands.

◆ type_to_function()

std::function< double(const std::vector< double > &)> geopm::Agg::type_to_function ( int  agg_type)
static

Returns the corresponding agg function for one of the Agg::m_type_e enum values. If the agg_type is out of range, it throws an error.

◆ type_to_name()

std::string geopm::Agg::type_to_name ( int  agg_type)
static

Returns the corresponding agg function name for one of the Agg:m_type_e enum values. If the agg_type is out of range, it throws an error.


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