sosy-lab / cpu-energy-meter

A tool for measuring energy consumption of Intel CPUs
BSD 3-Clause "New" or "Revised" License
321 stars 29 forks source link

Measure as rarely as possible but as often as necessary #12

Closed PhilippWendler closed 6 years ago

PhilippWendler commented 7 years ago

Currently, the measurement interval is fixed to 1s (if no signals arrive).

This is unnecessarily often. We only need to measure often enough that we are guaranteed to never loose an overflow. Thus we should read the maximum_power_watts for the domains, and calculate from this value and RAPL_ENERGY_UNIT how long it takes for an overflow. Then we should probably use half of this as wait time between measurements.

This should reduce the overhead of the measurements further. On my machine, for example, the energy unit is 6.103516e-05, so assuming 100W power consumption it would take over half an hour for an overflow. So if this is done, #10 would be much less important.

We should also add some assertions, for example that for each measurement interval the power consumption is in the expected interval [0, maximum_power_watts].