By the way, we might want to modify sage.parallel.ncpus.ncpus for Python 3.13 to use process_cpu_count <https://docs.python.org/3/library/os.html#os.process_cpu_count> instead of cpu_count, since as of Python 3.13, this is what Python's multiprocessing package does.
On Wednesday, March 12, 2025 at 6:46:59 AM UTC-7 dim...@gmail.com wrote: > I just bumped it in https://github.com/sagemath/sage/pull/39680 > Please review. > > On Tue, Mar 11, 2025 at 8:30 PM John H Palmieri <jhpalm...@gmail.com> > wrote: > > > > I think the problem is Sphinx: my guess is that when the Sphinx version > got bumped in https://github.com/sagemath/sage/pull/39577, > sphinxcontrib-htmlhelp also needed a bump. If I look at the Sphinx build > log, I see: > > > > spkg-pipinst] ERROR: Could not find a version that satisfies the > requirement sphinxcontrib-htmlhelp>=2.0.6 (from sphinx) (from versions: > 2.0.5) > > [spkg-pipinst] ERROR: No matching distribution found for > sphinxcontrib-htmlhelp>=2.0.6 > > > > I also see this: > > [spkg-pipinst] Warning: The installation needed to use "--no-deps > --ignore-installed --ignore-requires-python" to succeed. This means that a > dependencies file in build/pkgs/ needs to be updated. Please report this to > sage-...@googlegroups.com, including the build log of this package. > > > > I don't know why the build was considered successful after this, but > apparently it was. Anyway, consider this as having been reported. > > > > On Tuesday, March 11, 2025 at 5:39:59 PM UTC-7 John H Palmieri wrote: > >> > >> I see this too (I'm using OS X, don't know the situation for other > platforms). I think the problem is somehow with Python3. If I modify the > src/bin/sage-env script (which is where SAGE_NUM_THREADS gets read and > perhaps modified) to directly run the script sage-num-threads.py, I get an > error, and that error means that sage-env uses the default value of "1" for > SAGE_NUM_THREADS. > >> > >> I applied this change: > >> > >> diff --git a/src/bin/sage-env b/src/bin/sage-env > >> index 5a53ab1d2c..3000b4d983 100644 > >> --- a/src/bin/sage-env > >> +++ b/src/bin/sage-env > >> @@ -580,6 +580,9 @@ case "$SAGE_NUM_THREADS,$SAGE_NUM_THREADS_PARALLEL" > in > >> # First, figure out the right values for SAGE_NUM_THREADS (default > >> # number of threads) and SAGE_NUM_THREADS_PARALLEL (default number of > >> # threads when parallel execution is asked explicitly). > >> + > >> + sage-num-threads.py > >> + > >> sage_num_threads_array=$(sage-num-threads.py 2>/dev/null || echo 1 2 1) > >> sage_num_threads_array="${sage_num_threads_array% *}" # strip third item > >> SAGE_NUM_THREADS="${sage_num_threads_array% *}" # keep first item > >> > >> If I run "sage" or "sage -sh", I see > >> > >> > /Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/bin/sage-num-threads.py:4: > > DeprecationWarning: pkg_resources is deprecated as an API. See > https://setuptools.pypa.io/en/latest/pkg_resources.html > >> __import__('pkg_resources').require('sagemath-standard==10.6b8') > >> Traceback (most recent call last): > >> File > "/Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/pkg_resources/__init__.py", > > line 656, in _build_master > >> ws.require(__requires__) > >> File > "/Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/pkg_resources/__init__.py", > > line 1063, in require > >> needed = self.resolve(parse_requirements(requirements)) > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> File > "/Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/pkg_resources/__init__.py", > > line 890, in resolve > >> dist = self._resolve_dist( > >> ^^^^^^^^^^^^^^^^^^^ > >> File > "/Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages/pkg_resources/__init__.py", > > line 936, in _resolve_dist > >> raise VersionConflict(dist, req).with_context(dependent_req) > >> pkg_resources.ContextualVersionConflict: (sphinxcontrib-htmlhelp 2.0.5 > (/Users/palmieri/Sage/git/sage/local/var/lib/sage/venv-python3.12/lib/python3.12/site-packages), > > Requirement.parse('sphinxcontrib-htmlhelp>=2.0.6'), {'sphinx'}) > >> > >> Sage provides sphinxcontrib-htmlhelp 2.0.5. I don't know what's looking > for 2.0.6; I got no hits when I ran 'git grep "2[.]0[.]6" '. > >> > >> On Tuesday, March 11, 2025 at 4:13:41 PM UTC-7 enriqu...@gmail.com > wrote: > >>> > >>> > >>> For 10.5 with python 3.12.5, sage.parallel.ncpus.ncpus() is 1 without > giving a value to SAGE_NUM_THREADS and 16 if sage is opened as > "SAGE_NUM_THREADS=16 sage". For 10.6.beta9 (python 3.13.2), the value is > always one; in another computer 10.6.beta9 is using python 3.12.5 and the > value is always one. > >>> El miércoles, 12 de marzo de 2025 a las 6:15:27 UTC+9, > dim...@gmail.com escribió: > >>>> > >>>> On Mon, Mar 10, 2025 at 4:28 AM enriqu...@gmail.com > >>>> <enriqu...@gmail.com> wrote: > >>>> > > >>>> > If I set the variable SAGE_NUM_THREADS to a number of cores before > opening a sage session (command line or jupyterlab) there is a different > behaviour in 10.5 and in 10.6beta; > >>>> > parallel computation can be done in 10.5, there is no effect in the > beta version (I do not know when it started to fail). In the beta version > parallel computation is possible declaring the number of cores using the > following hack (suggested to me at some point by Miguel Marco) > >>>> > def miscpus(): > >>>> > return "put here the number of cores" > >>>> > sage.parallel.ncpus.ncpus=miscpus > >>>> > Is it possible to know when SAGE_NUM_THREADS lost its effects? > >>>> > >>>> what is the output of sage.parallel.ncpus.ncpus() in 10.5 and in > >>>> 10.6.beta* for you? > >>>> (without using the hack above). Are they using the same Python > version? > >>>> > >>>> The code for sage.parallel.ncpus.ncpus didn't change for a year, > since 10.3. > >>>> > >>>> Dima > >>>> > >>>> > >>>> > >>>> > >>>> > Thanks, Enrique. > >>>> > > >>>> > -- > >>>> > 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 sage-devel+...@googlegroups.com. > >>>> > To view this discussion visit > https://groups.google.com/d/msgid/sage-devel/fe02ae5f-64ab-4fb5-a826-d97f3d418dccn%40googlegroups.com > . > > > > -- > > 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 sage-devel+...@googlegroups.com. > > To view this discussion visit > https://groups.google.com/d/msgid/sage-devel/aa44fb52-fec7-4975-a6eb-e291cf22c44cn%40googlegroups.com > . > -- 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 sage-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/sage-devel/893f747f-67a1-49ed-a2c5-c52627c1bf52n%40googlegroups.com.