Utils
- mosaic.utils.utils.cpu_count()[source]
Get the number of available cores in the node.
- Returns:
Number of CPUs.
- Return type:
int
- mosaic.utils.utils.gpu_count()[source]
Get the number of available GPUs in the node.
- Returns:
Number of GPUs.
- Return type:
int
- mosaic.utils.utils.memory_limit()[source]
Get the memory limit (in bytes) for this system.
Takes the minimum value from the following locations: - Total system host memory - Cgroups limit (if set) - RSS rlimit (if set)
- Returns:
Memory limit.
- Return type:
float
- mosaic.utils.utils.memory_used(pid=None)[source]
Get the memory currently being used by the system.
- Parameters:
pid (int, optional) – PID for which to get memory.
- Returns:
Memory used.
- Return type:
float