detect where your code consumes energy the most so you can optimize those functions
Joulehunter helps you find what part of your code is consuming considerable amounts of energy .
This repo is still a work in progress. 😄
Joulehunter runs on Linux machines with Intel RAPL support. This technology has been available since the Sandy Bridge generation.
pip install joulehunter
joulehunter -l will list the available domains on this machine. These include the packages and their components, such as the DRAM and core.
joulehunter main.py will execute
main.py and measure the energy consumption of the first package (CPU).
To select the package to analyze use the option
--package followed by the package number or the package name. The default value is 0.
--component allow you to measure the energy of an individual component by specifying their name or ID. If not specified, the entire package will be selected.
joulehunter -l could output this:
 package-0  core  uncore  dram  package-1  core  uncore  dram
If we run
joulehunter -p package-1 -c 2 my_file.py, joulehunter will execute
my_file.py and measure the energy consumption of package-1's DRAM.
Due to a security vulnerability, only root has read permission for the energy files. In order to circumvent this, run the script as root or grant read permissions for the following files:
More info here.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size joulehunter-1.0.tar.gz (355.1 kB)||File type Source||Python version None||Upload date||Hashes View|