Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 1 | #include "occ_status.hpp" |
| 2 | |
Chris Cain | b6535e8 | 2022-01-21 08:24:13 -0600 | [diff] [blame] | 3 | #include <fmt/core.h> |
| 4 | |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 5 | #include <phosphor-logging/log.hpp> |
Gunnar Mills | 94df8c9 | 2018-09-14 14:50:03 -0500 | [diff] [blame] | 6 | #include <powercap.hpp> |
George Liu | b5ca101 | 2021-09-10 12:53:11 +0800 | [diff] [blame] | 7 | |
| 8 | #include <cassert> |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 9 | #include <filesystem> |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 10 | |
| 11 | namespace open_power |
| 12 | { |
| 13 | namespace occ |
| 14 | { |
| 15 | namespace powercap |
| 16 | { |
| 17 | |
Gunnar Mills | 94df8c9 | 2018-09-14 14:50:03 -0500 | [diff] [blame] | 18 | constexpr auto PCAP_PATH = "/xyz/openbmc_project/control/host0/power_cap"; |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 19 | constexpr auto PCAP_INTERFACE = "xyz.openbmc_project.Control.Power.Cap"; |
| 20 | |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 21 | constexpr auto POWER_CAP_PROP = "PowerCap"; |
| 22 | constexpr auto POWER_CAP_ENABLE_PROP = "PowerCapEnable"; |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 23 | constexpr auto POWER_CAP_HARD_MIN = "MinPowerCapValue"; |
| 24 | constexpr auto POWER_CAP_MAX = "MaxPowerCapValue"; |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 25 | |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 26 | using namespace phosphor::logging; |
George Liu | bcef3b4 | 2021-09-10 12:39:02 +0800 | [diff] [blame] | 27 | namespace fs = std::filesystem; |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 28 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 29 | void PowerCap::updatePcapBounds() |
| 30 | { |
| 31 | // Build the hwmon string to write the power cap bounds |
| 32 | fs::path minName = getPcapFilename(std::regex{"power\\d+_cap_min$"}); |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 33 | fs::path maxName = getPcapFilename(std::regex{"power\\d+_cap_max$"}); |
| 34 | |
| 35 | // Read the power cap bounds from sysfs files |
| 36 | uint64_t cap; |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 37 | uint32_t capHardMin = 0, capMax = INT_MAX; |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 38 | std::ifstream minFile(minName, std::ios::in); |
| 39 | if (minFile) |
| 40 | { |
| 41 | minFile >> cap; |
| 42 | minFile.close(); |
Chris Cain | 8676e03 | 2022-03-24 15:06:23 -0500 | [diff] [blame] | 43 | // Convert to Input Power in Watts (round up) |
| 44 | capHardMin = ((cap / (PS_DERATING_FACTOR / 100.0) / 1000000) + 0.9); |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 45 | } |
| 46 | else |
| 47 | { |
| 48 | log<level::ERR>( |
| 49 | fmt::format( |
| 50 | "updatePcapBounds: unable to find cap_min file: {} (errno={})", |
| 51 | pcapBasePathname.c_str(), errno) |
| 52 | .c_str()); |
| 53 | } |
| 54 | std::ifstream maxFile(maxName, std::ios::in); |
| 55 | if (maxFile) |
| 56 | { |
| 57 | maxFile >> cap; |
| 58 | maxFile.close(); |
Chris Cain | 8676e03 | 2022-03-24 15:06:23 -0500 | [diff] [blame] | 59 | // Convert to Input Power in Watts (truncate remainder) |
| 60 | capMax = cap / (PS_DERATING_FACTOR / 100.0) / 1000000; |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 61 | } |
| 62 | else |
| 63 | { |
| 64 | log<level::ERR>( |
| 65 | fmt::format( |
| 66 | "updatePcapBounds: unable to find cap_max file: {} (errno={})", |
| 67 | pcapBasePathname.c_str(), errno) |
| 68 | .c_str()); |
| 69 | } |
| 70 | |
| 71 | // Save the bounds to dbus |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 72 | updateDbusPcap(capHardMin, capMax); |
| 73 | |
| 74 | // Validate dbus and hwmon user caps match |
| 75 | const uint32_t dbusUserCap = getPcap(); |
| 76 | const uint32_t hwmonUserCap = readUserCapHwmon(); |
| 77 | if ((hwmonUserCap != 0) && (dbusUserCap != hwmonUserCap)) |
| 78 | { |
| 79 | // User power cap is enabled, but does not match dbus |
| 80 | log<level::ERR>( |
| 81 | fmt::format( |
| 82 | "updatePcapBounds: user powercap mismatch (hwmon:{}W, bdus:{}W) - using dbus", |
| 83 | hwmonUserCap, dbusUserCap) |
| 84 | .c_str()); |
| 85 | writeOcc(dbusUserCap); |
| 86 | } |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 87 | } |
| 88 | |
Andrew Geissler | 4cea4d2 | 2017-07-10 15:13:33 -0500 | [diff] [blame] | 89 | uint32_t PowerCap::getOccInput(uint32_t pcap, bool pcapEnabled) |
| 90 | { |
| 91 | if (!pcapEnabled) |
| 92 | { |
| 93 | // Pcap disabled, return 0 to indicate disabled |
| 94 | return 0; |
| 95 | } |
| 96 | |
| 97 | // If pcap is not disabled then just return the pcap with the derating |
| 98 | // factor applied. |
Gunnar Mills | 94df8c9 | 2018-09-14 14:50:03 -0500 | [diff] [blame] | 99 | return ((static_cast<uint64_t>(pcap) * PS_DERATING_FACTOR) / 100); |
Andrew Geissler | 4cea4d2 | 2017-07-10 15:13:33 -0500 | [diff] [blame] | 100 | } |
| 101 | |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 102 | uint32_t PowerCap::getPcap() |
| 103 | { |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 104 | utils::PropertyValue pcap{}; |
| 105 | try |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 106 | { |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 107 | pcap = utils::getProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_PROP); |
| 108 | |
| 109 | return std::get<uint32_t>(pcap); |
| 110 | } |
Patrick Williams | 2561362 | 2021-09-02 09:29:54 -0500 | [diff] [blame] | 111 | catch (const sdbusplus::exception::exception& e) |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 112 | { |
| 113 | log<level::ERR>("Failed to get PowerCap property", |
| 114 | entry("ERROR=%s", e.what()), |
| 115 | entry("PATH=%s", PCAP_PATH)); |
| 116 | |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 117 | return 0; |
| 118 | } |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | bool PowerCap::getPcapEnabled() |
| 122 | { |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 123 | utils::PropertyValue pcapEnabled{}; |
| 124 | try |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 125 | { |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 126 | pcapEnabled = utils::getProperty(PCAP_PATH, PCAP_INTERFACE, |
| 127 | POWER_CAP_ENABLE_PROP); |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 128 | |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 129 | return std::get<bool>(pcapEnabled); |
| 130 | } |
Patrick Williams | 2561362 | 2021-09-02 09:29:54 -0500 | [diff] [blame] | 131 | catch (const sdbusplus::exception::exception& e) |
George Liu | f3b7514 | 2021-06-10 11:22:50 +0800 | [diff] [blame] | 132 | { |
| 133 | log<level::ERR>("Failed to get PowerCapEnable property", |
| 134 | entry("ERROR=%s", e.what()), |
| 135 | entry("PATH=%s", PCAP_PATH)); |
| 136 | |
| 137 | return false; |
| 138 | } |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 139 | } |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 140 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 141 | fs::path PowerCap::getPcapFilename(const std::regex& expr) |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 142 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 143 | if (pcapBasePathname.empty()) |
| 144 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 145 | pcapBasePathname = occStatus.getHwmonPath(); |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 146 | } |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 147 | |
| 148 | if (fs::exists(pcapBasePathname)) |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 149 | { |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 150 | // Search for pcap file based on the supplied expr |
| 151 | for (auto& file : fs::directory_iterator(pcapBasePathname)) |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 152 | { |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 153 | if (std::regex_search(file.path().string(), expr)) |
| 154 | { |
| 155 | // Found match |
| 156 | return file; |
| 157 | } |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 158 | } |
| 159 | } |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 160 | else |
| 161 | { |
| 162 | log<level::ERR>(fmt::format("Power Cap base filename not found: {}", |
| 163 | pcapBasePathname.c_str()) |
| 164 | .c_str()); |
| 165 | } |
| 166 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 167 | // return empty path |
| 168 | return fs::path{}; |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 169 | } |
| 170 | |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 171 | // Write the user power cap to sysfs. |
| 172 | // This will trigger the driver to send the cap to the OCC |
Andrew Geissler | 6ac874e | 2017-07-10 15:54:58 -0500 | [diff] [blame] | 173 | void PowerCap::writeOcc(uint32_t pcapValue) |
| 174 | { |
Chris Cain | d4c19a0 | 2022-04-22 15:46:13 -0500 | [diff] [blame^] | 175 | if (!occStatus.occActive()) |
| 176 | { |
| 177 | // OCC not running, skip update |
| 178 | return; |
| 179 | } |
| 180 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 181 | // Build the hwmon string to write the user power cap |
| 182 | fs::path fileName = getPcapFilename(std::regex{"power\\d+_cap_user$"}); |
| 183 | if (fileName.empty()) |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 184 | { |
Chris Cain | b6535e8 | 2022-01-21 08:24:13 -0600 | [diff] [blame] | 185 | log<level::ERR>( |
| 186 | fmt::format("Could not find a power cap file to write to: {})", |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 187 | pcapBasePathname.c_str()) |
Chris Cain | b6535e8 | 2022-01-21 08:24:13 -0600 | [diff] [blame] | 188 | .c_str()); |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 189 | return; |
| 190 | } |
Matt Spinler | eaaf3b2 | 2019-07-16 10:29:27 -0500 | [diff] [blame] | 191 | |
| 192 | uint64_t microWatts = pcapValue * 1000000ull; |
| 193 | |
| 194 | auto pcapString{std::to_string(microWatts)}; |
Andrew Geissler | 6ac874e | 2017-07-10 15:54:58 -0500 | [diff] [blame] | 195 | |
Andrew Geissler | 6ac874e | 2017-07-10 15:54:58 -0500 | [diff] [blame] | 196 | // Open the hwmon file and write the power cap |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 197 | std::ofstream file(fileName, std::ios::out); |
| 198 | if (file) |
| 199 | { |
| 200 | log<level::INFO>(fmt::format("Writing {}uW to {}", pcapString.c_str(), |
| 201 | fileName.c_str()) |
| 202 | .c_str()); |
| 203 | file << pcapString; |
| 204 | file.close(); |
| 205 | } |
| 206 | else |
| 207 | { |
| 208 | log<level::ERR>(fmt::format("Failed writing {}uW to {} (errno={})", |
| 209 | microWatts, fileName.c_str(), errno) |
| 210 | .c_str()); |
| 211 | } |
| 212 | |
Andrew Geissler | 6ac874e | 2017-07-10 15:54:58 -0500 | [diff] [blame] | 213 | return; |
| 214 | } |
| 215 | |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 216 | // Read the current user power cap from sysfs. |
| 217 | uint32_t PowerCap::readUserCapHwmon() |
| 218 | { |
| 219 | uint32_t userCap = 0; |
| 220 | |
| 221 | // Get the sysfs filename for the user power cap |
| 222 | fs::path userCapName = getPcapFilename(std::regex{"power\\d+_cap_user$"}); |
| 223 | if (userCapName.empty()) |
| 224 | { |
| 225 | log<level::ERR>( |
| 226 | fmt::format( |
| 227 | "readUserCapHwmon: Could not find a power cap file to read: {})", |
| 228 | pcapBasePathname.c_str()) |
| 229 | .c_str()); |
| 230 | return 0; |
| 231 | } |
| 232 | |
| 233 | // Open the sysfs file and read the power cap |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 234 | std::ifstream file(userCapName, std::ios::in); |
| 235 | if (file) |
| 236 | { |
Chris Cain | e2d0a43 | 2022-03-28 11:08:49 -0500 | [diff] [blame] | 237 | uint64_t cap; |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 238 | file >> cap; |
| 239 | file.close(); |
| 240 | // Convert to Watts |
| 241 | userCap = cap / 1000000; |
| 242 | } |
| 243 | else |
| 244 | { |
| 245 | log<level::ERR>( |
| 246 | fmt::format("readUserCapHwmon: Failed reading {} (errno={})", |
| 247 | userCapName.c_str(), errno) |
| 248 | .c_str()); |
| 249 | } |
| 250 | |
| 251 | return userCap; |
| 252 | } |
| 253 | |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 254 | void PowerCap::pcapChanged(sdbusplus::message::message& msg) |
| 255 | { |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 256 | if (!occStatus.occActive()) |
| 257 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 258 | // Nothing to do |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 259 | return; |
| 260 | } |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 261 | |
| 262 | uint32_t pcap = 0; |
| 263 | bool pcapEnabled = false; |
| 264 | |
| 265 | std::string msgSensor; |
Patrick Williams | e096270 | 2020-05-13 17:50:22 -0500 | [diff] [blame] | 266 | std::map<std::string, std::variant<uint32_t, bool>> msgData; |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 267 | msg.read(msgSensor, msgData); |
| 268 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 269 | bool changeFound = false; |
| 270 | for (const auto& [prop, value] : msgData) |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 271 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 272 | if (prop == POWER_CAP_PROP) |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 273 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 274 | pcap = std::get<uint32_t>(value); |
| 275 | pcapEnabled = getPcapEnabled(); |
| 276 | changeFound = true; |
| 277 | } |
| 278 | else if (prop == POWER_CAP_ENABLE_PROP) |
| 279 | { |
| 280 | pcapEnabled = std::get<bool>(value); |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 281 | pcap = getPcap(); |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 282 | changeFound = true; |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 283 | } |
| 284 | else |
| 285 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 286 | // Ignore other properties |
| 287 | log<level::DEBUG>( |
| 288 | fmt::format( |
| 289 | "pcapChanged: Unknown power cap property changed {} to {}", |
| 290 | prop.c_str(), std::get<uint32_t>(value)) |
| 291 | .c_str()); |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 292 | } |
| 293 | } |
| 294 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 295 | if (changeFound) |
| 296 | { |
| 297 | log<level::INFO>( |
| 298 | fmt::format( |
| 299 | "Power Cap Property Change (cap={}W (input), enabled={})", pcap, |
| 300 | pcapEnabled ? 'y' : 'n') |
| 301 | .c_str()); |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 302 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 303 | // Determine desired action to write to occ |
Andrew Geissler | 6ac874e | 2017-07-10 15:54:58 -0500 | [diff] [blame] | 304 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 305 | auto occInput = getOccInput(pcap, pcapEnabled); |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 306 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 307 | // Write action to occ |
| 308 | writeOcc(occInput); |
| 309 | } |
Andrew Geissler | 52cf26a | 2017-07-06 12:56:32 -0500 | [diff] [blame] | 310 | |
| 311 | return; |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 312 | } |
| 313 | |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 314 | // Update the Power Cap bounds on DBus |
Chris Cain | 40501a2 | 2022-03-14 17:33:27 -0500 | [diff] [blame] | 315 | bool PowerCap::updateDbusPcap(uint32_t hardMin, uint32_t max) |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 316 | { |
| 317 | bool complete = true; |
| 318 | |
| 319 | try |
| 320 | { |
Chris Cain | 5d66a0a | 2022-02-09 08:52:10 -0600 | [diff] [blame] | 321 | utils::setProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_HARD_MIN, |
| 322 | hardMin); |
| 323 | } |
| 324 | catch (const sdbusplus::exception::exception& e) |
| 325 | { |
| 326 | log<level::ERR>( |
| 327 | fmt::format( |
| 328 | "updateDbusPcap: Failed to set HARD PCAP to {}W due to {}", |
| 329 | hardMin, e.what()) |
| 330 | .c_str()); |
| 331 | complete = false; |
| 332 | } |
| 333 | |
| 334 | try |
| 335 | { |
| 336 | utils::setProperty(PCAP_PATH, PCAP_INTERFACE, POWER_CAP_MAX, max); |
| 337 | } |
| 338 | catch (const sdbusplus::exception::exception& e) |
| 339 | { |
| 340 | log<level::ERR>( |
| 341 | fmt::format( |
| 342 | "updateDbusPcap: Failed to set MAX PCAP to {}W due to {}", max, |
| 343 | e.what()) |
| 344 | .c_str()); |
| 345 | complete = false; |
| 346 | } |
| 347 | |
| 348 | return complete; |
| 349 | } |
Gunnar Mills | 94df8c9 | 2018-09-14 14:50:03 -0500 | [diff] [blame] | 350 | } // namespace powercap |
Andrew Geissler | 32016d1 | 2017-06-20 15:46:52 -0500 | [diff] [blame] | 351 | |
| 352 | } // namespace occ |
| 353 | |
Gunnar Mills | 94df8c9 | 2018-09-14 14:50:03 -0500 | [diff] [blame] | 354 | } // namespace open_power |