CPU Detection#
- sage.parallel.ncpus.ncpus()[source]#
Return the number of available CPUs in the system.
ALGORITHM:
os.sched_getaffinity()
oros.cpu_count()
EXAMPLES:
sage: sage.parallel.ncpus.ncpus() # random output -- depends on machine 2
>>> from sage.all import * >>> sage.parallel.ncpus.ncpus() # random output -- depends on machine 2