Skip to content

carbon¤

Estimates carbon emissions of compute jobs run on high-performance computing clusters.

This tool has been developed for use on Imperial College London's compute clusters. However, the structure of the code has been designed with the view of potential extension for use on other clusters.

For developers¤

This is a Python application that uses uv for packaging and dependency management. It also provides pre-commit hooks for various linters and formatters and automated tests using pytest and GitHub Actions. Pre-commit hooks are automatically kept updated with a dedicated GitHub Action.

To get started:

  1. Download and install uv following the instructions for your OS.
  2. Clone this repository and make it your working directory
  3. Set up the virtual environment:

bash uv sync

  1. Install the git hooks:

bash uv run pre-commit install

  1. Activate the virtual environment (alternatively, you can prefix any Python-related command with uv run):

bash source .venv/bin/activate

  1. Specify the location of your cluster configuration file:

bash export CARBON_CONFIG=/path/to/config.yaml

  1. Run the main app:

bash carbon <job ID>