CPPJoules is a energy measurement tool designed to measure the energy
consumption during the execution of a piece of
C++ code. CPPJoules leverages the Intel Running Average Power Limit (RAPL)
interface, Intel Powergadget, Nvidia Management
Library (NVML) for reporting energy consumption of different system-on-chip
(SoC) power domains.
Installation & Usage
Requirements
Intel processors from the Celeron, Pentium, Core i3, i7, i9, and Xeon
series, featuring the Sandy Bridge or newer architecture.
Linux distribution Debian based operating system. We have tested on
Ubuntu 20.04.6 LTS
The g++ compiler version has to be above v11.0.0. Install from
here
If on Windows, then PowerGadget v3.6 has to installed. Click here to install
Github Repo
Our entire codebase is in this Github repo : https://github.com/rishalab/CPPJoules.git, you
can either clone or download it to check it.
The values of DRAM-0 , GT-0 and IA-0 are in joules. The value of nvidia_gpu_0 is in microjoules.
Note : The g++ compiler version has to be above v11.0.0. Install
from here Note : If PowerGadget v3.6 is not present, then install from
here
Approach diagram
Measurement of Energy
CPPJoules leverages Intel's RAPL and NVIDIA's NVML libraries to measure
energy consumption for both the CPU and GPU components. For CPU energy
measurement, the tool utilizes Intel's RAPL interface, which provides
detailed energy traces data across various domains, including the CPU
package, core, uncore, and DRAM. This is achieved through the Powercap
interface on Linux and Intel Power Gadget on Windows.
Code snippet screenshot
Test code for array concatenation ( in linux )
Test code for bubble sort ( in linux )
Goal
Helping developers and practitioners to develope energy efficient code in C++
language.
Limitations
CPPJoules uses InterRAPL which requires access to MSRs. Therefore, CPPJoules will
not be able to measure energy consumption for Virtual Machines, Windows Subsystem for Linux
and any other software interface which uses hardware emulation.
Results
The evaluation experiments have been done on a linux machine to compare CPP Joules
with Pyjoules
Results