{"id":32964261,"url":"https://github.com/energymon/energymon","last_synced_at":"2026-02-22T19:23:04.067Z","repository":{"id":34171597,"uuid":"38018628","full_name":"energymon/energymon","owner":"energymon","description":"A portable interface for energy monitoring utilities","archived":false,"fork":false,"pushed_at":"2024-11-29T16:13:30.000Z","size":1232,"stargazers_count":38,"open_issues_count":4,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-17T20:02:17.632Z","etag":null,"topics":["c","cray-pm","energy","energy-monitoring-utilities","feedback-mechanism","ibmpowernv","intel-power-gadget","interface","jetson","msr","odroid","odroid-smart-power","portable","powercap","rapl","raplcap","seec","wattsup","zcu102"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/energymon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-06-25T00:31:44.000Z","updated_at":"2025-10-08T05:33:02.000Z","dependencies_parsed_at":"2024-04-15T15:26:33.097Z","dependency_job_id":null,"html_url":"https://github.com/energymon/energymon","commit_stats":{"total_commits":378,"total_committers":4,"mean_commits":94.5,"dds":0.08465608465608465,"last_synced_commit":"38ef1e6d2d69abf1e3496832369663918d9e56d4"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/energymon/energymon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energymon%2Fenergymon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energymon%2Fenergymon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energymon%2Fenergymon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energymon%2Fenergymon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/energymon","download_url":"https://codeload.github.com/energymon/energymon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/energymon%2Fenergymon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29724084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T19:15:09.475Z","status":"ssl_error","status_checked_at":"2026-02-22T19:15:09.045Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cray-pm","energy","energy-monitoring-utilities","feedback-mechanism","ibmpowernv","intel-power-gadget","interface","jetson","msr","odroid","odroid-smart-power","portable","powercap","rapl","raplcap","seec","wattsup","zcu102"],"created_at":"2025-11-13T02:00:33.834Z","updated_at":"2026-02-22T19:23:04.038Z","avatar_url":"https://github.com/energymon.png","language":"C","funding_links":[],"categories":["Measure power usage by software"],"sub_categories":["GNU/Linux"],"readme":"# Energy Monitoring Interface\n\nEnergyMon provides a general C interface for energy monitoring utilities.\n\nIf using this project for other scientific works or publications, please reference:\n\n* Connor Imes, Lars Bergstrom, and Henry Hoffmann. \"A Portable Interface for Runtime Energy Monitoring\". In: FSE. 2016. DOI: https://doi.org/10.1145/2950290.2983956\n  \u003cdetails\u003e\n  \u003csummary\u003e[BibTex]\u003c/summary\u003e\n\n  ```BibTex\n  @inproceedings{imes2016energymon,\n    author = {Imes, Connor and Bergstrom, Lars and Hoffmann, Henry},\n    title = {A Portable Interface for Runtime Energy Monitoring},\n    year = {2016},\n    isbn = {9781450342186},\n    publisher = {Association for Computing Machinery},\n    address = {New York, NY, USA},\n    url = {https://doi.org/10.1145/2950290.2983956},\n    doi = {10.1145/2950290.2983956},\n    booktitle = {Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering},\n    pages = {968–974},\n    numpages = {7},\n    keywords = {portable energy measurement},\n    location = {Seattle, WA, USA},\n    series = {FSE 2016}\n  }\n  ```\n\n  \u003c/details\u003e\n* You may also find an extended analysis in the [Tech Report](https://cs.uchicago.edu/research/publications/techreports/TR-2016-08).\n  \u003cdetails\u003e\n  \u003csummary\u003e[BibTex]\u003c/summary\u003e\n\n  ```BibTex\n  @techreport{imes2016energymon-tr,\n    author = {Imes, Connor and Bergstrom, Lars and Hoffmann, Henry},\n    title = {A Portable Interface for Runtime Energy Monitoring: Extended Analysis},\n    institution = {University of Chicago, Department of Computer Science},\n    number = {TR-2016-08},\n    year = {2016},\n    month = sep,\n    address = {Chicago, IL, USA}\n  }\n  ```\n\n  \u003c/details\u003e\n\nApplications using some libraries may need to be executed using elevated privileges.\n\nThe following instructions are for Linux systems.\nIf you are using a different platform, change the commands accordingly.\n\nCurrent EnergyMon implementation options are:\n\n* **dummy** [default]: Mock implementation\n* **cray-pm**: Cray XC30 and XC40 systems (e.g., NERSC Cori) via Linux sysfs files\n* **ibmpowernv**: IBM PowerNV systems (e.g., OLCF Summit) via Linux sysfs energy sensor files\n* **ibmpowernv-power**: IBM PowerNV systems (e.g., OLCF Summit) via Linux sysfs power sensor files\n* **ipg**: Intel RAPL via `Intel Power Gadget`\n* **jetson**: NVIDIA Jetson systems with INA3221 power sensors via Linux sysfs files\n* **msr**: Intel RAPL via Linux Model-Specific Register device files (supports most non-Atom CPUs)\n* **odroid**: Hardkernel ODROID XU+E and XU3 systems (with INA-231 power sensors) via Linux sysfs files\n* **odroid-ioctl**: Hardkernel ODROID XU+E and XU3 systems (with INA-231 power sensors) via `ioctl` on Linux device files\n* **osp**: Hardkernel ODROID Smart Power meters (coarse-grained energy counter) via `HIDAPI`\n* **osp-polling**: Hardkernel ODROID Smart Power meters (finer-grained power sensor) via `HIDAPI`\n* **osp3**: ODROID Smart Power 3 meters via Linux and macOS device files\n* **rapl**: Intel RAPL via Linux powercap sysfs files\n* **raplcap-msr**: Intel RAPL via `libraplcap-msr` (more capable than `msr` implementation above)\n* **shmem**: Shared memory client via an EnergyMon shared memory provider\n* **wattsup**: Watts Up Pro meter via Linux and macOS device files\n* **wattsup-libusb**: Watts Up Pro meter via `libusb`\n* **wattsup-libftdi**: Watts Up Pro meter via `libftdi`\n* **zcu102**: Xilinx Zynq UltraScale+ ZCU102 systems (with INA-226 power sensors) via Linux sysfs files\n\nSee the README files in subdirectories for implementation specifics, including dependencies.\n\n\n## Building\n\nThis project uses CMake.\n\nBy default, all libraries will be built, with `dummy` as the `energymon-default` implementation:\n\n``` sh\nmkdir _build\ncd _build\ncmake ..\nmake\n```\n\nTo use a different default implementation, e.g., the RAPL energy monitor, specify `ENERGYMON_BUILD_DEFAULT` with cmake:\n\n``` sh\ncmake -DENERGYMON_BUILD_DEFAULT=rapl ..\n```\n\nSet `ENERGYMON_BUILD_DEFAULT=NONE` to disable building a default implementation.\nIts default value is `dummy`.\n\nTo build only a single library, e.g., the RAPL energy monitor, specify `ENERGYMON_BUILD_LIB` with cmake:\n\n``` sh\ncmake -DENERGYMON_BUILD_LIB=rapl ..\n```\n\nSet `ENERGYMON_BUILD_LIB=NONE` to only build the default implementation (if set).\nSet back to its default value of `ALL` to build all libraries.\n\nTo build shared objects / dynamically linked libraries instead of static libraries, set `BUILD_SHARED_LIBS` with cmake:\n\n``` sh\ncmake .. -DBUILD_SHARED_LIBS=ON\n```\n\nFor an optimized build, set `CMAKE_BUILD_TYPE` when with cmake, e.g., one of:\n\n``` sh\ncmake .. -DCMAKE_BUILD_TYPE=Release\ncmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo\n```\n\nOf course, you can specify multiple options, e.g.:\n\n``` sh\ncmake .. -DENERGYMON_BUILD_LIB=NONE -DENERGYMON_BUILD_DEFAULT=rapl -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release\n```\n\n### Other Build Options\n\nBoolean options:\n\n * `ENERGYMON_BUILD_SHMEM_PROVIDERS` - enable/disable building shared memory providers (True by default)\n * `ENERGYMON_BUILD_UTILITIES` - enable/disable building utility applications (True by default)\n * `ENERGYMON_BUILD_TESTS` - enable/disable building test code (True by default)\n * `ENERGYMON_BUILD_EXAMPLES` - enable/disable building examples (True by default)\n\n\n## Installing\n\nTo install libraries, headers, and binaries, run with proper privileges:\n\n``` sh\nmake install\n```\n\nOn Linux, the installation usually places\nlibraries in `/usr/local/lib`,\nheader files in `/usr/local/include/energymon`, and\nbinary files in `/usr/local/bin`.\n\n\n## Uninstalling\n\nTo remove files installed to the system, run with proper privileges:\n\n``` sh\nmake uninstall\n```\n\n\n## Linking\n\nLibrary names have the format `energymon-foo`, where `foo` is a short name from the bulleted list above.\nFor example, the `dummy` library is named `energymon-dummy`.\nThe following instructions use the `default` library for simplicity and portability, but substitute names as needed.\n\n### CMake\n\nProjects that use `CMake` can find the `EnergyMon` package and link against imported targets, which automatically applies properties like header search paths and transitive dependencies:\n\n```cmake\nfind_package(EnergyMon REQUIRED)\n\nadd_executable(hello_world hello_world.c)\ntarget_link_libraries(hello_world PRIVATE EnergyMon::energymon-default)\n```\n\n### pkg-config\n\nA more general approach for linking with an EnergyMon library is to use [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/):\n\n```sh\ncc $(pkg-config energymon-default --cflags) hello_world.c \\\n   $(pkg-config energymon-default --libs --static) -o hello_world\n```\n\nor in a Makefile:\n\n```Makefile\nCFLAGS += $(shell pkg-config --cflags energymon-default)\nLDFLAGS += $(shell pkg-config --libs --static energymon-default)\n\nhello_world: hello_world.c\n\t$(CC) $(CFLAGS) hello_world.c -o $@ $(LDFLAGS)\n```\n\nIf shared object libraries are installed, don't include the `--static` option.\n\nProjects that use `CMake \u003e= 3.6` can alternatively use a pkg-config `IMPORTED_TARGET`, rather than the direct CMake imports documented above:\n\n```cmake\nfind_package(PkgConfig REQUIRED)\npkg_check_modules(EnergyMonDefault REQUIRED IMPORTED_TARGET energymon-default)\n\nadd_executable(hello_world hello_world.c)\ntarget_link_libraries(hello_world PRIVATE PkgConfig::EnergyMonDefault)\n```\n\n\n## Usage\n\nTo use an EnergyMon implementation, you must first populate the struct by calling the getter function, then initialize it.\nDon't forget to cleanup the instance once you're finished with it.\nSee `energymon.h` and `energymon-default.h` for more detailed function descriptions.\n\n```C\n  energymon em;\n  uint64_t start_uj, end_uj;\n\n  // get the energymon instance and initialize\n  energymon_get_default(\u0026em);\n  em.finit(\u0026em);\n\n  // profile application function\n  start_uj = em.fread(\u0026em);\n  do_work();\n  end_uj = em.fread(\u0026em);\n  printf(\"Total energy for do_work() in microjoules: %\"PRIu64\"\\n\", end_uj - start_uj);\n\n  // destroy the instance\n  em.ffinish(\u0026em);\n```\n\n\n## Tools\n\nThis project includes a handful of applications.\n\n### Utilities\n\nAll of the following are linked with `energymon-default`:\n\n* `energymon-cmd-profile`: Prints out time, energy, and power statistics for the execution of a given shell command.\n* `energymon-power-poller`: Prints average power values at the requested interval for the previous interval period.\n* `energymon-file-provider`: Writes energy data to a file (overwrites previous values).\n* `energymon-idle-power`: Prints the average power over the given interval (meant to run in isolation and measure idle power consumption).\n* `energymon-info`: Prints information about the implementation.\n* `energymon-overhead`: Prints the latency overhead in nanoseconds of the functions `finit`, `fread`, and `ffinish`.\n\nImplementation-specific versions of these utilities are also provided.\n\n### Shared Memory Providers\n\nShared memory providers allow exposing energy data to one or more unprivileged applications for sources that require elevated privileges and/or exclusive access.\nThe providers may need to run with elevated privileges, but other applications can attach to their shared memory and read energy data using the `shmem` EnergyMon implementation.\n\n* `energymon-osp-polling-shmem-provider`\n* `energymon-wattsup-shmem-provider`\n* `energymon-wattsup-libftdi-provider`\n* `energymon-wattsup-libusb-provider`\n\n\n## Project Source\n\nFind this and related project sources at the [energymon organization on GitHub](https://github.com/energymon).  \nThis project originates at: https://github.com/energymon/energymon\n\n\nBug reports and pull requests for new implementations, bug fixes, and enhancements are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenergymon%2Fenergymon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenergymon%2Fenergymon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenergymon%2Fenergymon/lists"}