noether.core.utils.platform

Submodules

Functions

get_cli_command()

Return the command with which the script was called.

get_installed_cuda_version()

log_system_info()

Logs system information like OS, CUDA version, and Python version.

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.

Package Contents

noether.core.utils.platform.get_cli_command()

Return the command with which the script was called.

Attention: This assumes the script was started with python (not python3 or similar).

Returns:

The command with which the script was called.

Return type:

str

noether.core.utils.platform.get_installed_cuda_version()
Return type:

str | None

noether.core.utils.platform.log_system_info()

Logs system information like OS, CUDA version, and Python version.

Return type:

None

noether.core.utils.platform.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

noether.core.utils.platform.get_total_cpu_count()

Get the total number of CPUs visible to this process.

Return type:

int