mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.18k stars 178 forks source link

Fix SLURM RAM monitoring #473

Closed benoit-cty closed 1 year ago

benoit-cty commented 1 year ago

Fix SLURM RAM monitoring :

Will close #447

benoit-cty commented 1 year ago

Tested on a SLURM environment : there is only too call per sessions and no more error message.

vict0rsch commented 1 year ago

I'll have a look next week 😊

vict0rsch commented 1 year ago

There was an issue with $SLURM_JOBID which was changed to $SLURM_JOB_ID, making some queries like scontrol show job $SLURM_JOBID" fail.

vict0rsch commented 1 year ago

This works as expected

from codecarbon.external.hardware import RAM

ram = RAM(tracking_mode="process")
ram.slurm_memory_GB
benoit-cty commented 1 year ago

There was an issue with $SLURM_JOBID which was changed to $SLURM_JOB_ID, making some queries like scontrol show job $SLURM_JOBID" fail.

Thanks for your review, it seems to be deprecated since 2017 so it is safe to remove the support of the old name !