|
596 | 596 | # See trac 7186 -- this is needed if ecl is moved
|
597 | 597 | ECLDIR="$SAGE_LOCAL/lib/ecl/" && export ECLDIR
|
598 | 598 |
|
| 599 | + |
599 | 600 | # Handle parallel building/testing/...
|
600 |
| -# See Trac Ticket #12016 |
601 |
| -# First, figure out the right values for SAGE_NUM_THREADS (default |
602 |
| -# number of threads) and SAGE_NUM_THREADS_PARALLEL (default number of |
603 |
| -# threads when parallel execution is asked explicitly). |
604 |
| -sage_num_threads_array=$(sage-num-threads.py 2>/dev/null || echo 1 2 1) |
605 |
| -sage_num_threads_array="${sage_num_threads_array% *}" # strip third item |
606 |
| -SAGE_NUM_THREADS="${sage_num_threads_array% *}" # keep first item |
607 |
| -SAGE_NUM_THREADS_PARALLEL="${sage_num_threads_array#* }" # keep second item |
608 |
| -export SAGE_NUM_THREADS |
609 |
| -export SAGE_NUM_THREADS_PARALLEL |
| 601 | +case "$SAGE_NUM_THREADS,$SAGE_NUM_THREADS_PARALLEL" in |
| 602 | + [1-9][0-9]*,[1-9][0-9]*) |
| 603 | + # Variables are set to positive values already, |
| 604 | + # sage-num-threads.py would just recompute them |
| 605 | + ;; |
| 606 | + *) |
| 607 | + # See Trac Ticket #12016 |
| 608 | + # First, figure out the right values for SAGE_NUM_THREADS (default |
| 609 | + # number of threads) and SAGE_NUM_THREADS_PARALLEL (default number of |
| 610 | + # threads when parallel execution is asked explicitly). |
| 611 | + sage_num_threads_array=$(sage-num-threads.py 2>/dev/null || echo 1 2 1) |
| 612 | + sage_num_threads_array="${sage_num_threads_array% *}" # strip third item |
| 613 | + SAGE_NUM_THREADS="${sage_num_threads_array% *}" # keep first item |
| 614 | + SAGE_NUM_THREADS_PARALLEL="${sage_num_threads_array#* }" # keep second item |
| 615 | + export SAGE_NUM_THREADS |
| 616 | + export SAGE_NUM_THREADS_PARALLEL |
| 617 | + ;; |
| 618 | +esac |
610 | 619 |
|
611 | 620 | # Multithreading in OpenBLAS does not seem to play well with Sage's attempts to
|
612 | 621 | # spawn new processes, see #26118. Apparently, OpenBLAS sets the thread
|
|
0 commit comments