joulehunter
Joulehunter helps you find what part of your code is consuming considerable amounts of energy.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 33 committers (6.1%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.9%) to scientific vocabulary
Keywords from Contributors
Repository
Joulehunter helps you find what part of your code is consuming considerable amounts of energy.
Basic Info
Statistics
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 4
- Releases: 3
Metadata Files
README.md
joulehunter
Joulehunter helps you find what part of your code is consuming considerable amounts of energy.
This repo is still a work in progress. 😄
Compatibility
Joulehunter runs on Linux machines with Intel RAPL support. This technology has been available since the Sandy Bridge generation.
Installation
You can install joulehunter with pip: pip install joulehunter.
You can also clone the repo and install it directly:
git clone https://github.com/powerapi-ng/joulehunter.git
cd joulehunter
python setup.py install
Usage
Joulehunter works similarly to pyinstrument, as we forked the repo and replaced time measuring with energy measuring. Here's pyinstrument's documentation. Whenever pyinstrument is present in a variable name, it should be replaced with joulehunter (for example, PYINSTRUMENT_PROFILE_DIR turns into JOULEHUNTER_PROFILE_DIR).
Command line
joulehunter -l will list the available domains on this machine. These include the packages and their components, such as the DRAM and core.
The command 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 -p or --package followed by the package number or the package name. The default value is 0.
The options -c and --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.
Example
Executing joulehunter -l could output this:
[0] package-0
[0] core
[1] uncore
[2] dram
[1] package-1
[0] core
[1] uncore
[2] 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.
Profiling chunks of code
As pyinstrument's documentation shows, it's also possible to profile specific chunks of code.
Joulehunter's Profiler class can receive two additional arguments: package and component. They receive the ID (as a string or integer) or name of the desired package/component. If package is not specified, package-0 will be used. If component is None, the entire package will be analyzed.
Profiling web requests in Flask
Please refer to pyinstrument's documentation for instructions on how to profile web requests in Flask. As in the previous case, joulehunter's Profiler() accepts two additional arguments.
Profiling web requests in Django
Profiling web requests in Django as explained in pyinstrument's documentation selects package 0 as the default domain (don't forget to rename the pyinstrument in variable names with joulehunter).
The user can choose a particular package and component as follows:
Query component: The query strings package and component are used to select the desired package and component. For example, including ?profiler&package=0&component=dram at the end of a request URL will select the first package and the DRAM. If the component query component is present but empty, the package will be analyzed.
Variable in settings.py: The user's selection can also be defined in settings.py with the JOULEHUNTER_PACKAGE and JOULEHUNTER_COMPONENT variables. These are later passed to Package().
If the package or component is defined both as a query component and in settings.py, the one defined as a query component will be selected.
Read permission
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:
/sys/devices/virtual/powercap/intel-rapl/intel-rapl:*/energy_uj
/sys/devices/virtual/powercap/intel-rapl/intel-rapl:*/intel-rapl:*:*/energy_uj
More info here.
Acknowledgments
Thanks to Joe Rickerby and all of pyinstrument's contributors.
This fork is being developed by Chakib Belgaid and Alex Kaminetzky. Feel free to ask us any questions!
Owner
- Name: PowerAPI
- Login: powerapi-ng
- Kind: organization
- Email: contact@powerapi.org
- Location: Lille, France
- Website: http://powerapi.org
- Repositories: 10
- Profile: https://github.com/powerapi-ng
Software-Defined Power Meters
Citation (CITATION.cff)
cff-version: 1.2.0
title: "JouleHunter : an energy profiler for python applications"
message: Make your python code green again
type: software
date-released: 2021-09-15
authors:
- given-names: Mohammed chakib
family-names: Belgaid
email: chakib.belgaid@gmail.com
orcid: 'https://orcid.org/0000-0002-5264-7426'
affiliation: Inria university of Lille
- given-names: Alex
family-names: Kaminetzky
- given-names: Romain
family-names: Rouvoy
email: romain.rouvoy@inria.fr
affiliation: inria university of lille
orcid: 'https://orcid.org/0000-0003-1771-8791'
- orcid: 'https://orcid.org/0000-0003-0006-6088'
affiliation: 'Inria university of lille '
email: lionel.seinturier@univ-lille.fr
family-names: Seinturier
given-names: Lionel
identifiers:
- type: url
value: https://github.com/powerapi-ng/joulehunter/
repository-code: 'https://github.com/powerapi-ng/joulehunter/'
abstract: >-
Joulehunter helps you find what part of your code is consuming considerable amounts of energy within python applications.
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Joe Rickerby | j****k@m****m | 450 |
| akaminetzkyp | a****p@g****m | 51 |
| mbelgaid | m****d@i****r | 35 |
| Iddan Aaronsohn | m****l@a****m | 8 |
| Aaron Meurer | a****r@g****m | 7 |
| Christian Hudon | c****n@s****m | 7 |
| codelol | j****n@g****m | 5 |
| dependabot[bot] | 4****] | 5 |
| Joel Squire | j****l@s****g | 4 |
| Steven Tartakovsky | t****r@g****m | 3 |
| Balázs Rostás | r****s@g****m | 2 |
| Christian Clauss | c****s@m****m | 2 |
| Your Name | m****n@p****m | 2 |
| Ayush Shanker | s****h@g****m | 1 |
| pre-commit | p****t@e****m | 1 |
| Sandro Huber | s****r@f****m | 1 |
| Martijn Pieters | m****s@f****m | 1 |
| Imran Iqbal | i****l@c****m | 1 |
| Alessio Bazzanella | a****a@m****m | 1 |
| Chillar Anand | a****a@g****m | 1 |
| x1ah | x****q@g****m | 1 |
| Dan Vanderkam | d****k@s****m | 1 |
| Julien Danjou | j****n@d****o | 1 |
| Karthik Kumar Viswanathan | k****n@z****m | 1 |
| Mike Fiedler | m****n@g****m | 1 |
| Pallak | 2****9 | 1 |
| Pavka | p****n@y****u | 1 |
| Peter M. Landwehr | p****h@a****u | 1 |
| Prashanth Madi | p****i@g****m | 1 |
| QIN2DIM | 6****M | 1 |
| and 3 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 18
- Total pull requests: 2
- Average time to close issues: 2 days
- Average time to close pull requests: 5 months
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 0.56
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- kaminetzky (11)
- chakib-belgaid (6)
- zakiournani (1)
Pull Request Authors
- kaminetzky (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 14 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 2
- Total maintainers: 1
pypi.org: joulehunter
detect where your code consumes energy the most so you can optimize those functions
- Homepage: https://github.com/powerapi-ng/joulehunter
- Documentation: https://joulehunter.readthedocs.io/
- License: BSD License
-
Latest release: 1.0.2
published over 3 years ago
Rankings
Maintainers (1)
Dependencies
- 1117 dependencies
- @vue/cli-plugin-babel ^4.5.11 development
- @vue/cli-service ^4.5.11 development
- vue-template-compiler ^2.6.12 development
- html-webpack-inline-source-plugin 0.0.10
- vue ^2.6.12
- django * development
- flake8 * development
- flaky * development
- furo ==2021.6.18b36 development
- greenlet * development
- myst-parser ==0.15.1 development
- nox * development
- pytest * development
- pytest-asyncio ==0.12.0 development
- pytest-mock * development
- sphinx ==4.0.2 development
- sphinxcontrib-programoutput ==0.17 development
- trio * development
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v2 composite
- actions/upload-artifact v2 composite
- pypa/gh-action-pypi-publish master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
