Ticket #7011: trac_7011.patch

File trac_7011.patch, 2.3 KB (added by ddrake, 12 years ago)

add in default maximum of 8 threads

  • sage-ptest

    # HG changeset patch
    # User Dan Drake <drake@kaist.edu>
    # Date 1254212407 -32400
    # Node ID 2bab25abd27ad237872b364a2a07ba1cbd3a4654
    # Parent  dc6bf7b795b0e80318c4d931a9c7fbcb1db1a7fe
    [mq]: trac_7011.patch
    
    diff --git a/sage-ptest b/sage-ptest
    a b  
    262262        infiles = argv[1:]
    263263
    264264    if numthreads == 0:
    265         # Set numthreads to be the number of processors --- default.
     265        # Set numthreads to be the number of processors, with a default
     266        # maximum of 8.
     267        #
    266268        # The detection of number of processors might not be reliable on some
    267269        # platforms. On a Sun SPARC T5240 (t2.math), the reported number of
    268270        # processors might not correspond to the actual number of processors.
    269         # See ticket #6283 and the file SAGE_ROOT/makefile.
     271        # See tickets #6283, #7011, and the file SAGE_ROOT/makefile.
    270272        #
    271         # WARNING: Unless you are certain that you want to use all the
    272         # cores/processors on your system for parallel doctesting, use
    273         # a (sensible) positive integer.
     273        # WARNING: If cpu_count() below reports <= 8 for your machine
     274        # and you *don't* want to use all the cores/processors on your
     275        # system for parallel doctesting, use a (sensible) positive
     276        # integer.
     277        #
     278        # If cpu_count() reports > 8 and you want to use that many
     279        # threads, you must manually specify the number of threads.
    274280        try:
    275             numthreads = multiprocessing.cpu_count()
     281            numthreads = min(8, multiprocessing.cpu_count())
    276282        except NotImplementedError:
    277283            numthreads = 1
    278284
  • sage-sage

    diff --git a/sage-sage b/sage-sage
    a b  
    9292    echo "                      -rand[=seed] -- randomize order of tests"
    9393    echo "  -tnew ...     -- like -t above, but only tests files modified since last commit"
    9494    echo "  -tp <N> ...   -- like -t above, but tests in parallel using N threads"
     95    echo "                   with 0 interpreted as minimum(8, cpu_count())"
    9596    echo "  -testall      -- test all source, docs, and examples in your Sage distro."
    9697    #echo "  -update       -- download latest non-optional Sage packages (do not build them)"
    9798    #echo "  -update-build -- build and install all downloaded non-optional Sage packages"