# HG changeset patch
# User Dan Drake
# Date 1254212407 -32400
# Node ID 2bab25abd27ad237872b364a2a07ba1cbd3a4654
# Parent dc6bf7b795b0e80318c4d931a9c7fbcb1db1a7fe
[mq]: trac_7011.patch
diff --git a/sage-ptest b/sage-ptest
--- a/sage-ptest
+++ b/sage-ptest
@@ -262,17 +262,23 @@
infiles = argv[1:]
if numthreads == 0:
- # Set numthreads to be the number of processors --- default.
+ # Set numthreads to be the number of processors, with a default
+ # maximum of 8.
+ #
# The detection of number of processors might not be reliable on some
# platforms. On a Sun SPARC T5240 (t2.math), the reported number of
# processors might not correspond to the actual number of processors.
- # See ticket #6283 and the file SAGE_ROOT/makefile.
+ # See tickets #6283, #7011, and the file SAGE_ROOT/makefile.
#
- # WARNING: Unless you are certain that you want to use all the
- # cores/processors on your system for parallel doctesting, use
- # a (sensible) positive integer.
+ # WARNING: If cpu_count() below reports <= 8 for your machine
+ # and you *don't* want to use all the cores/processors on your
+ # system for parallel doctesting, use a (sensible) positive
+ # integer.
+ #
+ # If cpu_count() reports > 8 and you want to use that many
+ # threads, you must manually specify the number of threads.
try:
- numthreads = multiprocessing.cpu_count()
+ numthreads = min(8, multiprocessing.cpu_count())
except NotImplementedError:
numthreads = 1
diff --git a/sage-sage b/sage-sage
--- a/sage-sage
+++ b/sage-sage
@@ -92,6 +92,7 @@
echo " -rand[=seed] -- randomize order of tests"
echo " -tnew ... -- like -t above, but only tests files modified since last commit"
echo " -tp ... -- like -t above, but tests in parallel using N threads"
+ echo " with 0 interpreted as minimum(8, cpu_count())"
echo " -testall -- test all source, docs, and examples in your Sage distro."
#echo " -update -- download latest non-optional Sage packages (do not build them)"
#echo " -update-build -- build and install all downloaded non-optional Sage packages"