Thanks for the feedback so far. It seems that there are pros and cons to 
all of the options.

What about the following: We go with the somewhat random min(8, number of 
threads) and print a warning once if "number of threads" > 8 (telling the 
user to export SAGE_NUM_THREADS)? Note that this won't affect doctests as 
SAGE_NUM_THREADS=2 in that context.

That way, we provide a good experience for the typical laptop/desktop user 
and don't risk angry emails from admins after somebody convinced them to 
install Sage on their shiny server.

What do you think?


PS: I am also fine with "number of threads" as a default. But I am opposed 
to "1" as that provides a poor experience for the casual user who won't dig 
into the documentation to find out what's going on.

On Monday, July 9, 2018 at 6:35:22 PM UTC+2, Julian Rüth wrote:
> Hello.
> since Sage 8.2 sage.parallel.ncpus.ncpus() returns 1 if you have no 
> environment variables such as MAKE, SAGE_NUM_THREADS, MAKEOPTS set. 
> This number is used by the @parallel decorator and similar constructions 
> to determine the number of processes to run in parallel. (Unless during 
> doctests, then it's set to 2 I think.)
> The question is: What is a good default for things such as @parallel when 
> SAGE_NUM_THREADS has not been set? I think that 1 is not a good one. The 
> actual number of cores/threads on a system probably isn't either on servers 
> with lots of cores. At some point we had `min(8, number of threads)` which 
> appears reasonable to me.
> Please join the discussion at :)
> julian

You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to