GreenScheduler / cats

CATS: the Climate-Aware Task Scheduler :cat2: :tiger2: :leopard:
https://greenscheduler.github.io/cats/
MIT License
50 stars 8 forks source link

Reduce carbon footprint estimation to total energy amount #80

Closed tlestang closed 5 months ago

tlestang commented 6 months ago

This PR trims down the carbon footprint estimation module carbonFootprint.py.

For the purpose of providing an estimation of carbon footprint savings, cats only needs to know the total carbon footprint, i.e. summed across all devices (gpus, cpus) and memory. This is straightforward to compute given the new jobinfo format introduced in #79:

energy = (
    PUE
    * (runtime.total_seconds() / 3600)
    * sum([(nunits * power) for nunits, power in jobinfo])
    / 1000
    )
best = energy * average_best_ci
now = energy * average_now_ci

where energy is the total energy. I deliberately removed code accounting for energy for a specific device type, since this is not used in cats so far.

This also removes greenAlgorithmsCalculator methods formatting an amount of gCO2 into units of driving, flying...etc. This is probably a nice to have, but AFAIK this is dead code. Anyone feel free to add them back if they wish to make use of them.

Finally, this gets rid of the check_clean_arguments.validate_job_info function since the job information required for the carbon estimation footprint is fully specified by the jobinfo list returned by configure.get_runtime_configuration.