joblib
.cpu_count¶
- joblib.cpu_count(only_physical_cores=False)¶
Return the number of CPUs.
This delegates to loky.cpu_count that takes into account additional constraints such as Linux CFS scheduler quotas (typically set by container runtimes such as docker) and CPU affinity (for instance using the taskset command on Linux).
- Parameters:
- only_physical_coresboolean, default=False
If True, does not take hyperthreading / SMT logical cores into account.