mlco2 / codecarbon

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

Fix SLURM RAM monitoring #473

Closed benoit-cty closed 7 months ago

benoit-cty commented 7 months ago

Fix SLURM RAM monitoring :

Will close #447

benoit-cty commented 7 months ago

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

vict0rsch commented 7 months ago

I'll have a look next week 😊

vict0rsch commented 7 months 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 7 months ago

This works as expected

from codecarbon.external.hardware import RAM

ram = RAM(tracking_mode="process")
ram.slurm_memory_GB
benoit-cty commented 7 months 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 !