From 66e5109686d6faf01e8517504cb26250e5325548 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 12:45:39 -0700 Subject: [PATCH 1/9] build/pkgs/gnumake_tokenpool: New --- build/pkgs/gnumake_tokenpool/SPKG.rst | 21 +++++++++++++++++++ build/pkgs/gnumake_tokenpool/checksums.ini | 5 +++++ build/pkgs/gnumake_tokenpool/dependencies | 1 + .../gnumake_tokenpool/install-requires.txt | 1 + .../gnumake_tokenpool/package-version.txt | 1 + build/pkgs/gnumake_tokenpool/spkg-install.in | 2 ++ build/pkgs/gnumake_tokenpool/type | 1 + 7 files changed, 32 insertions(+) create mode 100644 build/pkgs/gnumake_tokenpool/SPKG.rst create mode 100644 build/pkgs/gnumake_tokenpool/checksums.ini create mode 100644 build/pkgs/gnumake_tokenpool/dependencies create mode 100644 build/pkgs/gnumake_tokenpool/install-requires.txt create mode 100644 build/pkgs/gnumake_tokenpool/package-version.txt create mode 100644 build/pkgs/gnumake_tokenpool/spkg-install.in create mode 100644 build/pkgs/gnumake_tokenpool/type diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst new file mode 100644 index 00000000000..87ae8d01c27 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -0,0 +1,21 @@ +gnumake_tokenpool: Jobclient and jobserver for the GNU make tokenpool protocol +============================================================================== + +Description +----------- + +The project has implementations in multiple languages. + +We only install the implementation in Python. + + +License +------- + +MIT + + +Upstream Contact +---------------- + +https://github.com/milahu/gnumake-tokenpool diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini new file mode 100644 index 00000000000..9362f2e52f4 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -0,0 +1,5 @@ +tarball=gnumake_tokenpool-VERSION.tar.gz +sha1=6b5cf8f6327055941e9f52ff2b2dd20242675e7e +md5=bc890dd499ba91a2f8d6aa47884e0fb2 +cksum=612068075 +upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz diff --git a/build/pkgs/gnumake_tokenpool/dependencies b/build/pkgs/gnumake_tokenpool/dependencies new file mode 100644 index 00000000000..25a25c98198 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/dependencies @@ -0,0 +1 @@ + | $(PYTHON) $(PYTHON_TOOLCHAIN) diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt new file mode 100644 index 00000000000..6911b62dd9b --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -0,0 +1 @@ +git+https://github.com/milahu/gnumake-tokenpool@54435c300e3b660cc75ffd8d63e518df322e6891#egg=gnumake_tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt new file mode 100644 index 00000000000..5b5ac0b3599 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -0,0 +1 @@ +54435c300e3b660cc75ffd8d63e518df322e6891 diff --git a/build/pkgs/gnumake_tokenpool/spkg-install.in b/build/pkgs/gnumake_tokenpool/spkg-install.in new file mode 100644 index 00000000000..37ac1a53437 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/spkg-install.in @@ -0,0 +1,2 @@ +cd src +sdh_pip_install . diff --git a/build/pkgs/gnumake_tokenpool/type b/build/pkgs/gnumake_tokenpool/type new file mode 100644 index 00000000000..a6a7b9cd726 --- /dev/null +++ b/build/pkgs/gnumake_tokenpool/type @@ -0,0 +1 @@ +standard From a47112daed745ac2da4177e0f9efebd1223b63ed Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:12:30 -0700 Subject: [PATCH 2/9] src/sage/doctest/forker.py: Use gnumake_tokenpool if available --- pkgs/sagemath-categories/tox.ini | 1 + src/sage/doctest/forker.py | 56 +++++++++++++++++++------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/pkgs/sagemath-categories/tox.ini b/pkgs/sagemath-categories/tox.ini index 5469be55b3c..b4bb49d132a 100644 --- a/pkgs/sagemath-categories/tox.ini +++ b/pkgs/sagemath-categories/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index 05bd5d0fd8e..ede127ff48e 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -1803,6 +1803,16 @@ def parallel_dispatch(self): """ opt = self.controller.options + job_client = None + try: + from gnumake_tokenpool import JobClient, NoJobServer + try: + job_client = JobClient() + except NoJobServer: + pass + except ImportError: + pass + source_iter = iter(self.controller.sources) # If timeout was 0, simply set a very long time @@ -1925,6 +1935,9 @@ def sel_exit(): w.copied_pid = w.pid w.close() finished.append(w) + if job_client: + job_client.release() + workers = new_workers # Similarly, process finished workers. @@ -1959,28 +1972,25 @@ def sel_exit(): break # Start new workers if possible - while source_iter is not None and len(workers) < opt.nthreads: - try: - source = next(source_iter) - except StopIteration: - source_iter = None - else: - # Start a new worker. - import copy - worker_options = copy.copy(opt) - if target_endtime is not None: - worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) - w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) - heading = self.controller.reporter.report_head(w.source) - if not self.controller.options.only_errors: - w.messages = heading + "\n" - # Store length of heading to detect if the - # worker has something interesting to report. - w.heading_len = len(w.messages) - w.start() # This might take some time - w.deadline = time.time() + opt.timeout - workers.append(w) - restart = True + while ((source := next(source_iter, None)) is not None + and len(workers) < opt.nthreads + and (not job_client or job_client.acquire())): + # Start a new worker. + import copy + worker_options = copy.copy(opt) + if target_endtime is not None: + worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) + w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) + heading = self.controller.reporter.report_head(w.source) + if not self.controller.options.only_errors: + w.messages = heading + "\n" + # Store length of heading to detect if the + # worker has something interesting to report. + w.heading_len = len(w.messages) + w.start() # This might take some time + w.deadline = time.time() + opt.timeout + workers.append(w) + restart = True # Recompute state if needed if restart: @@ -2040,6 +2050,8 @@ def sel_exit(): sleep(die_timeout) for w in workers: w.kill() + if job_client: + job_client.release() finally: os._exit(0) From afd277d9a5a2c6f50a7327dc40a7efdfc4d60c7d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:15:29 -0700 Subject: [PATCH 3/9] build/pkgs/gnumake_tokenpool: Update to ba838b031da2f20af237159ad6e91ada038ef921 --- build/pkgs/gnumake_tokenpool/SPKG.rst | 3 ++- build/pkgs/gnumake_tokenpool/checksums.ini | 8 ++++---- build/pkgs/gnumake_tokenpool/install-requires.txt | 2 +- build/pkgs/gnumake_tokenpool/package-version.txt | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst index 87ae8d01c27..85711b4d778 100644 --- a/build/pkgs/gnumake_tokenpool/SPKG.rst +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -18,4 +18,5 @@ MIT Upstream Contact ---------------- -https://github.com/milahu/gnumake-tokenpool +- https://github.com/milahu/gnumake-tokenpool (upstream) +- https://github.com/mkoeppe/gnumake-tokenpool (patch) diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index 9362f2e52f4..2bb9bb4ff53 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -1,5 +1,5 @@ tarball=gnumake_tokenpool-VERSION.tar.gz -sha1=6b5cf8f6327055941e9f52ff2b2dd20242675e7e -md5=bc890dd499ba91a2f8d6aa47884e0fb2 -cksum=612068075 -upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz +sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 +md5=13896c774e66c610adc5e70e86b9946b +cksum=663994353 +upstream_url=https://github.com/mkoeppe/gnumake-tokenpool/archive/VERSION.tar.gz diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt index 6911b62dd9b..15d38f1a86b 100644 --- a/build/pkgs/gnumake_tokenpool/install-requires.txt +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -1 +1 @@ -git+https://github.com/milahu/gnumake-tokenpool@54435c300e3b660cc75ffd8d63e518df322e6891#egg=gnumake_tokenpool +git+https://github.com/mkoeppe/gnumake-tokenpool@ba838b031da2f20af237159ad6e91ada038ef921#egg=gnumake_tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt index 5b5ac0b3599..dc46dd046a9 100644 --- a/build/pkgs/gnumake_tokenpool/package-version.txt +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -1 +1 @@ -54435c300e3b660cc75ffd8d63e518df322e6891 +ba838b031da2f20af237159ad6e91ada038ef921 From 84b9b68f68667174082d84132e3dee9302a2d133 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Fri, 3 Nov 2023 18:44:00 -0700 Subject: [PATCH 4/9] pkgs/sagemath-*/tox.ini: passenv MAKEFLAGS --- pkgs/sagemath-environment/tox.ini | 1 + pkgs/sagemath-objects/tox.ini | 1 + pkgs/sagemath-repl/tox.ini | 1 + pkgs/sagemath-standard/tox.ini | 1 + 4 files changed, 4 insertions(+) diff --git a/pkgs/sagemath-environment/tox.ini b/pkgs/sagemath-environment/tox.ini index ff2eef44f66..6bf1f2a6ebb 100644 --- a/pkgs/sagemath-environment/tox.ini +++ b/pkgs/sagemath-environment/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-objects/tox.ini b/pkgs/sagemath-objects/tox.ini index 0ca92ea9570..a8f5a6d6a76 100644 --- a/pkgs/sagemath-objects/tox.ini +++ b/pkgs/sagemath-objects/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-repl/tox.ini b/pkgs/sagemath-repl/tox.ini index 6944df002f5..679153a2947 100644 --- a/pkgs/sagemath-repl/tox.ini +++ b/pkgs/sagemath-repl/tox.ini @@ -26,6 +26,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels diff --git a/pkgs/sagemath-standard/tox.ini b/pkgs/sagemath-standard/tox.ini index c14f97f8bbf..6aae1ef1bfa 100644 --- a/pkgs/sagemath-standard/tox.ini +++ b/pkgs/sagemath-standard/tox.ini @@ -75,6 +75,7 @@ passenv = # Parallel build SAGE_NUM_THREADS SAGE_NUM_THREADS_PARALLEL + MAKEFLAGS # SAGE_VENV only for referring to the basepython or finding the wheels sagepython, sagewheels: SAGE_VENV # Location of the wheels From d0763bbd71bb770c45237ea7455b2c7603a2ccfe Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 10:14:14 -0700 Subject: [PATCH 5/9] build/pkgs/gnumake_tokenpool: Use upstreamed fix --- build/pkgs/gnumake_tokenpool/SPKG.rst | 1 - build/pkgs/gnumake_tokenpool/checksums.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/build/pkgs/gnumake_tokenpool/SPKG.rst b/build/pkgs/gnumake_tokenpool/SPKG.rst index 85711b4d778..a5c43be63b5 100644 --- a/build/pkgs/gnumake_tokenpool/SPKG.rst +++ b/build/pkgs/gnumake_tokenpool/SPKG.rst @@ -19,4 +19,3 @@ Upstream Contact ---------------- - https://github.com/milahu/gnumake-tokenpool (upstream) -- https://github.com/mkoeppe/gnumake-tokenpool (patch) diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index 2bb9bb4ff53..f01142e694c 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -2,4 +2,4 @@ tarball=gnumake_tokenpool-VERSION.tar.gz sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 md5=13896c774e66c610adc5e70e86b9946b cksum=663994353 -upstream_url=https://github.com/mkoeppe/gnumake-tokenpool/archive/VERSION.tar.gz +upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz From 56cbd03493db3c02c03ae574d7040bdf04178f77 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 10:46:35 -0700 Subject: [PATCH 6/9] build/pkgs/gnumake_tokenpool: Switch to PyPI release --- build/pkgs/gnumake_tokenpool/checksums.ini | 10 +++++----- build/pkgs/gnumake_tokenpool/install-requires.txt | 2 +- build/pkgs/gnumake_tokenpool/package-version.txt | 2 +- build/pkgs/gnumake_tokenpool/spkg-install.in | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 build/pkgs/gnumake_tokenpool/spkg-install.in diff --git a/build/pkgs/gnumake_tokenpool/checksums.ini b/build/pkgs/gnumake_tokenpool/checksums.ini index f01142e694c..62f631ea40a 100644 --- a/build/pkgs/gnumake_tokenpool/checksums.ini +++ b/build/pkgs/gnumake_tokenpool/checksums.ini @@ -1,5 +1,5 @@ -tarball=gnumake_tokenpool-VERSION.tar.gz -sha1=34e7b5aaeda4eb5edfaafc2db7f177320b2a5a90 -md5=13896c774e66c610adc5e70e86b9946b -cksum=663994353 -upstream_url=https://github.com/milahu/gnumake-tokenpool/archive/VERSION.tar.gz +tarball=gnumake_tokenpool-VERSION-py3-none-any.whl +sha1=a060f03e0306a85bc1a91a450e457be83ed371e9 +md5=834ccc4d6d52741c5eabac1bdb8f39b2 +cksum=1679797266 +upstream_url=https://pypi.io/packages/py3/g/gnumake_tokenpool/gnumake_tokenpool-VERSION-py3-none-any.whl diff --git a/build/pkgs/gnumake_tokenpool/install-requires.txt b/build/pkgs/gnumake_tokenpool/install-requires.txt index 15d38f1a86b..0ee4452edd3 100644 --- a/build/pkgs/gnumake_tokenpool/install-requires.txt +++ b/build/pkgs/gnumake_tokenpool/install-requires.txt @@ -1 +1 @@ -git+https://github.com/mkoeppe/gnumake-tokenpool@ba838b031da2f20af237159ad6e91ada038ef921#egg=gnumake_tokenpool +gnumake-tokenpool diff --git a/build/pkgs/gnumake_tokenpool/package-version.txt b/build/pkgs/gnumake_tokenpool/package-version.txt index dc46dd046a9..bcab45af15a 100644 --- a/build/pkgs/gnumake_tokenpool/package-version.txt +++ b/build/pkgs/gnumake_tokenpool/package-version.txt @@ -1 +1 @@ -ba838b031da2f20af237159ad6e91ada038ef921 +0.0.3 diff --git a/build/pkgs/gnumake_tokenpool/spkg-install.in b/build/pkgs/gnumake_tokenpool/spkg-install.in deleted file mode 100644 index 37ac1a53437..00000000000 --- a/build/pkgs/gnumake_tokenpool/spkg-install.in +++ /dev/null @@ -1,2 +0,0 @@ -cd src -sdh_pip_install . From 8945746e3fe60218bc2688751a4aafcc6f0b32c1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 4 Nov 2023 14:46:52 -0700 Subject: [PATCH 7/9] src/sage/doctest/forker.py: Fix/simplify last change --- src/sage/doctest/forker.py | 42 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py index ede127ff48e..4315cd1ba9f 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py @@ -1972,25 +1972,31 @@ def sel_exit(): break # Start new workers if possible - while ((source := next(source_iter, None)) is not None - and len(workers) < opt.nthreads + while (source_iter is not None and len(workers) < opt.nthreads and (not job_client or job_client.acquire())): - # Start a new worker. - import copy - worker_options = copy.copy(opt) - if target_endtime is not None: - worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) - w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) - heading = self.controller.reporter.report_head(w.source) - if not self.controller.options.only_errors: - w.messages = heading + "\n" - # Store length of heading to detect if the - # worker has something interesting to report. - w.heading_len = len(w.messages) - w.start() # This might take some time - w.deadline = time.time() + opt.timeout - workers.append(w) - restart = True + try: + source = next(source_iter) + except StopIteration: + source_iter = None + if job_client: + job_client.release() + else: + # Start a new worker. + import copy + worker_options = copy.copy(opt) + if target_endtime is not None: + worker_options.target_walltime = (target_endtime - now) / (max(1, pending_tests / opt.nthreads)) + w = DocTestWorker(source, options=worker_options, funclist=[sel_exit]) + heading = self.controller.reporter.report_head(w.source) + if not self.controller.options.only_errors: + w.messages = heading + "\n" + # Store length of heading to detect if the + # worker has something interesting to report. + w.heading_len = len(w.messages) + w.start() # This might take some time + w.deadline = time.time() + opt.timeout + workers.append(w) + restart = True # Recompute state if needed if restart: From 791200341ce283f30eb8f326dd5943459d2e183a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 6 Nov 2023 10:12:37 -0800 Subject: [PATCH 8/9] Update documentation --- src/bin/sage-runtests | 3 ++- src/doc/en/developer/doctesting.rst | 5 ++++- src/doc/en/installation/source.rst | 17 +++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/bin/sage-runtests b/src/bin/sage-runtests index 01b7ca44868..e25cebb48a8 100755 --- a/src/bin/sage-runtests +++ b/src/bin/sage-runtests @@ -26,7 +26,8 @@ if __name__ == "__main__": ".py, .pyx, .pxd, .pxi, .sage, .spyx, .tex, .rst.") parser.add_argument("-p", "--nthreads", dest="nthreads", type=int, nargs='?', const=0, default=1, metavar="N", - help="tests in parallel using N threads with 0 interpreted as max(2, min(8, cpu_count()))") + help="test in parallel using N threads, with 0 interpreted as max(2, min(8, cpu_count())); " + "when run under the control of the GNU make jobserver (make -j), request as most N job slots") parser.add_argument("-T", "--timeout", type=int, default=-1, help="timeout (in seconds) for doctesting one file, 0 for no timeout") what = parser.add_mutually_exclusive_group() what.add_argument("-a", "--all", action="store_true", default=False, help="test all files in the Sage library") diff --git a/src/doc/en/developer/doctesting.rst b/src/doc/en/developer/doctesting.rst index 589c9260134..f7c54bbbeec 100644 --- a/src/doc/en/developer/doctesting.rst +++ b/src/doc/en/developer/doctesting.rst @@ -512,7 +512,10 @@ doctests. This determines the number of threads by reading the environment variable :envvar:`MAKE`: if it is set to ``make -j12``, then use 12 threads. If :envvar:`MAKE` is not set, then by default it uses the number of CPU cores (as determined by the Python function -``multiprocessing.cpu_count()``) with a minimum of 2 and a maximum of 8. +:func:`multiprocessing.cpu_count`) with a minimum of 2 and a maximum of 8. +(When this runs under the control of the `GNU make jobserver +`_, then Sage +will request as most this number of job slots.) In any case, this will test the Sage library with multiple threads:: diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index b16fd8e7295..c9de73dd724 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -782,14 +782,19 @@ Here are some of the more commonly used variables affecting the build process: Some users on single-core macOS machines have reported problems when building Sage with ``MAKE='make -jNUM'`` with ``NUM`` greater than one. -- :envvar:`SAGE_NUM_THREADS` - if set to a number, then when building the - documentation, parallel doctesting, or running ``sage -b``, use this many - threads. +- :envvar:`SAGE_NUM_THREADS` - if set to a number, then when rebuilding with + ``sage -b`` or parallel doctesting with ``sage -t -p 0``, use at most this + many threads. + If this is not set, then determine the number of threads using the value of the :envvar:`MAKE` (see above) or :envvar:`MAKEFLAGS` environment variables. - If none of these specifies a number of jobs, use one thread (except for - parallel testing: there we use a default of the number of CPU cores, with a - maximum of 8 and a minimum of 2). + If none of these specifies a number of jobs, + - ``sage -b`` only uses one thread + - ``sage -t -p 0`` uses a default of the number of CPU cores, with a + maximum of 8 and a minimum of 2. + + When ``sage -t -p`` runs under the control of the GNU ``make`` + jobserver, then Sage will request as most this number of job slots. - :envvar:`V` - if set to ``0``, silence the build. Instead of showing a detailed compilation log, only one line of output is shown From 1dc6d36ae8541731300a326a7f90e4f86a03cbc2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 9 Dec 2023 10:14:07 -0800 Subject: [PATCH 9/9] src/doc/en/installation/source.rst: Fix markup --- src/doc/en/installation/source.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/doc/en/installation/source.rst b/src/doc/en/installation/source.rst index c9de73dd724..485d4916ec8 100644 --- a/src/doc/en/installation/source.rst +++ b/src/doc/en/installation/source.rst @@ -789,7 +789,9 @@ Here are some of the more commonly used variables affecting the build process: If this is not set, then determine the number of threads using the value of the :envvar:`MAKE` (see above) or :envvar:`MAKEFLAGS` environment variables. If none of these specifies a number of jobs, + - ``sage -b`` only uses one thread + - ``sage -t -p 0`` uses a default of the number of CPU cores, with a maximum of 8 and a minimum of 2.