geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
PowerGovernor.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef POWERGOVERNOR_HPP_INCLUDE
7 #define POWERGOVERNOR_HPP_INCLUDE
8 
9 #include <memory>
10 
11 #include "geopm_public.h"
12 
13 namespace geopm
14 {
15  class GEOPM_PUBLIC PowerGovernor
16  {
17  public:
18  PowerGovernor() = default;
19  virtual ~PowerGovernor() = default;
21  virtual void init_platform_io(void) = 0;
27  virtual void sample_platform(void) = 0;
32  // node_power_request unless clamped by bounds.
34  virtual void adjust_platform(double node_power_request, double &node_power_actual) = 0;
35  virtual bool do_write_batch(void) const = 0;
39  virtual void set_power_bounds(double min_pkg_power, double max_pkg_power) = 0;
42  virtual double power_package_time_window(void) const = 0;
45  static std::unique_ptr<PowerGovernor> make_unique(void);
48  static std::shared_ptr<PowerGovernor> make_shared(void);
49  };
50 }
51 
52 #endif
Definition: PowerGovernor.hpp:16
virtual void init_platform_io(void)=0
Registsters signals and controls with PlatformIO.
virtual ~PowerGovernor()=default
virtual double power_package_time_window(void) const =0
Get the time window for controlling package power.
virtual void adjust_platform(double node_power_request, double &node_power_actual)=0
Calculates metric of DRAM power history, subtracting that value from the provided target node power.
virtual void sample_platform(void)=0
To be called inside of the Agent's sample_platform() method to read any values required when calling ...
virtual void set_power_bounds(double min_pkg_power, double max_pkg_power)=0
Sets min and max package bounds.
virtual bool do_write_batch(void) const =0
Definition: Accumulator.cpp:12