ksuit.utils.platform.worker

Attributes

Functions

get_fair_cpu_count([reserve_for_main])

Get the number of CPUs to use per device.

get_total_cpu_count()

Get the total number of CPUs visible to this process.

Module Contents

ksuit.utils.platform.worker.logger
ksuit.utils.platform.worker.get_fair_cpu_count(reserve_for_main=1)

Get the number of CPUs to use per device.

If SLURM is used, the number of CPUs per task is used. Otherwise, CPUs are divided equally across devices (GPUs or a single CPU device).

Parameters:

reserve_for_main (int) – CPUs to keep for the main / orchestration thread.

Returns:

Number of CPUs to use per device.

Return type:

int

ksuit.utils.platform.worker.get_total_cpu_count()

Get the total number of CPUs visible to this process.

Return type:

int