Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is due to a change that occured in Sage 8.1: all parallelism in Sage is now governed by the environment variable SAGE_NUM_THREADS. In particular, the function ncpus(), which is called by Parallelism().set(), does no longer report the actual number of available CPU's on the computer, but simply reflects SAGE_NUM_THREADS (this new behavior was implemented in #23713 and critized in #24937).

There are two possible workarounds: you may set the environment variable SAGE_NUM_THREADS prior to the Sage session, by


or, in the Sage session, you pass the number of CPU's to Parallelism(), via the keyword argument nproc:

sage: Parallelism().set('tensor', nproc=4)
sage: Parallelism()
Number of processes for parallelization:
 - tensor computations: 4