/smartwatts-formula

SmartWatts is a formula for a self-adaptive software-defined power meter based on the PowerAPI framework.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

smartwatts-formula (written by TAN YING)

Activate conda env

conda activate rapl

Install (if not)

Install smartwatts

pip install smartwatts

Install mongodb

sudo apt install mongodb-server-core

Install pymongo

pip install pymongo

Start hwpc-sensor

Start mongodb server (if not)

mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork 

Write the configuration file for hwpc-sensor

vim /ty/config_file.json 

Start the hwpc-sensor

cd ty
sudo docker run --rm --net=host --privileged --pid=host -v /sys:/sys -v /var/lib/docker/containers:/var/lib/docker/containers:ro -v /tmp/powerapi-sensor-reporting:/reporting -v $(pwd):/srv -v $(pwd)/config_file.json:/config_file.json powerapi/hwpc-sensor --config-file /config_file.json

Start RAPL-formula (Open a new terminal)

Write the configuration file for smartwatts

vim /ty/config_file_SW.json

Start smartwatts

python -m smartwatts --config-file config_file_SW.json

Original README

SmartWatts is a software-defined power meter based on the PowerAPI toolkit. SmartWatts is a configurable software that can estimate the power consumption of software in real-time. SmartWatts need to receive several metrics provided by hwpc-sensor :

  • The Running Average Power Limit (RAPL)
  • TSC
  • APERF
  • MPERF
  • CPU_CLK_THREAD_UNHALTED:REF_P
  • CPU_CLK_THREAD_UNHALTED:THREAD_P
  • LLC_MISSES
  • INSTRUCTIONS_RETIRED

The reasons of those metrics are described in SmartWatts: Self-Calibrating Software-Defined Power Meter for Containers

About

SmartWatts is an open-source project developed by the Spirals research group (University of Lille 1 and Inria).

The documentation is available here.

Contributing

If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request. You should start by reading the contribution guide

When submitting code, please check that it is conform by using pylint and flake8 with the configurations files at the root of the project.

Publications

Acknowledgments

SmartWatts is written in Python (under PSF license) and built on top of PowerAPI