geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
PowerGovernorImp.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 POWERGOVERNORIMP_HPP_INCLUDE
7 #define POWERGOVERNORIMP_HPP_INCLUDE
8 
9 #include <memory>
10 #include <vector>
11 
12 #include "geopm/PowerGovernor.hpp"
13 
14 namespace geopm
15 {
16  class PlatformIO;
17  class PlatformTopo;
18 
20  {
21  public:
23  PowerGovernorImp(PlatformIO &platform_io, const PlatformTopo &platform_topo);
24  virtual ~PowerGovernorImp();
25  void init_platform_io(void) override;
26  virtual void sample_platform(void) override;
27  void adjust_platform(double node_power_request, double &node_power_actual) override;
28  bool do_write_batch(void) const override;
29  void set_power_bounds(double min_pkg_power, double max_pkg_power) override;
30  double power_package_time_window(void) const override;
31  private:
32  PlatformIO &m_platform_io;
33  const PlatformTopo &m_platform_topo;
34  const double M_CPU_POWER_TIME_WINDOW;
35  int m_pkg_pwr_domain_type;
36  int m_num_pkg;
37  const double M_MIN_PKG_POWER_SETTING;
38  const double M_MAX_PKG_POWER_SETTING;
39  double m_min_pkg_power_policy;
40  double m_max_pkg_power_policy;
41  std::vector<int> m_control_idx;
42  double m_last_pkg_power_setting;
43  bool m_do_write_batch;
44  };
45 }
46 
47 #endif
Definition: PowerGovernor.hpp:16
Definition: PowerGovernorImp.hpp:20
void init_platform_io(void) override
Registsters signals and controls with PlatformIO.
Definition: PowerGovernor.cpp:60
virtual ~PowerGovernorImp()
Definition: PowerGovernor.cpp:55
void adjust_platform(double node_power_request, double &node_power_actual) override
Calculates metric of DRAM power history, subtracting that value from the provided target node power.
Definition: PowerGovernor.cpp:74
PowerGovernorImp()
Definition: PowerGovernor.cpp:33
bool do_write_batch(void) const override
Definition: PowerGovernor.cpp:102
void set_power_bounds(double min_pkg_power, double max_pkg_power) override
Sets min and max package bounds.
Definition: PowerGovernor.cpp:107
virtual void sample_platform(void) override
To be called inside of the Agent's sample_platform() method to read any values required when calling ...
Definition: PowerGovernor.cpp:69
double power_package_time_window(void) const override
Get the time window for controlling package power.
Definition: PowerGovernor.cpp:121
Definition: Accumulator.cpp:12