resources#

Computational resource management

Functions

cpu_count()

Finds the number of CPUs in the current system, while respecting the affinity to make it compatible with cluster management systems.

gpu_count()

Finds the number of GPUs in the current system.

Classes

ChunkedSemaphore(max_count[, sleep])

Semaphore allowing chunked atomic resource acquisition.

Resources(max_count, parent)

Acquire computational resources in the form of a context manager.