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

Check with official documentation whether we do everything correctly #13

Closed PhilippWendler closed 6 years ago

PhilippWendler commented 7 years ago

I found the official documentation for the Intel RAPL interface in the Intel Software Developers Manual Volume 3B Chapter 14.9. The processor-specific documentation (which domains are supported on what CPU model, what the address of the MSRs is) can be found in Volume 4. The page that always links to the current versions of these PDFs is here.

We should check whether the tool reads everything correctly according to the documentation. Maybe we can also extend it to more CPU models.

PhilippWendler commented 7 years ago

There are also papers available about this topic, e.g. An Energy Efficiency Feature Survey of the Intel Haswell Processor. This paper also mentions that for some CPUs the units we use might be wrong, cf. https://github.com/RRZE-HPC/likwid/issues/39.

PhilippWendler commented 7 years ago

More information can also be found in the Linux kernel.

PhilippWendler commented 7 years ago

A nice summary is also in a blog post from Intel.

TBunk commented 6 years ago

According to Intel Software Developers Manual Volume 4, Model-specific Registers, only CPU models from the Intel Gen. Sandybridge and onward support the power monitoring feature. I.e., the Core-, Core2-, Nehalem-, and Westmere-CPUs are excluded from that (among others). As for the "small core" processors (Atom), neither of the following are supported: Pineview, Lincroft, Penwell, Cloverview, Cedarview (Models 0x1C, 0x26, 0x27, 0x35, 0x36, respectively).

The changes for this issue can be found in https://github.com/sosy-lab/cpu-energy-meter/commit/b87ffbcee18f1220984c3960652cd3174f26623c, https://github.com/sosy-lab/cpu-energy-meter/commit/c264fa7f8d851106a9727949782e44bd84bcec00, and https://github.com/sosy-lab/cpu-energy-meter/commit/3118119c78971fa9a85260b2f5887051474272a7.

There is lots of duplicate code in the init_rapl()-method by now, though, I suggest to do the refactoring within the #9 task.