anndict.utils.get_slurm_cores

anndict.utils.get_slurm_cores#

anndict.utils.get_slurm_cores()[source]#

Returns the total number of CPU cores allocated to a Slurm job based on environment variables.

Returns:

The total number of CPU cores allocated to the Slurm job.

Examples

get_slurm_cores()
> 40

Notes

Checks the environment variables SLURM_CPUS_PER_TASK and SLURM_NTASKS to calculate the total number of CPU cores allocated to the job by multiplying their values.

For environment variables that are not set, the function defaults to 1 CPU core.