Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#25779 closed defect (duplicate)

sage.parallel.ncpus.ncpus() reports wrong number of cores

Reported by: gh-lerouxje Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: scripts Keywords: parallel
Cc: saraedum Merged in:
Authors: Julian Rüth Reviewers: Julian Rüth
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by saraedum)

In recent docker images

docker run -it --rm sagemath/sagemath:latest sage
sage: sage.parallel.ncpus.ncpus()
1

in 8.0 this still returned the actual number of cores.

This seems to be unrelated to the fact that this is running in the docker image.

Change History (8)

comment:1 Changed 3 years ago by saraedum

If you just want to set the number of cores and ignore the automatic detection, you can do

$ docker run -e SAGE_NUM_THREADS=123 -it sagemath/sagemath sage -c 'print sage.parallel.ncpus.ncpus()'
Setting permissions of DOT_SAGE directory so only you can read and write it.
123
Last edited 3 years ago by saraedum (previous) (diff)

comment:2 Changed 3 years ago by saraedum

  • Component changed from PLEASE CHANGE to scripts
  • Description modified (diff)
  • Summary changed from Don't detect all cpus with last docker images of sagemath to sage.parallel.ncpus.ncpus() reports wrong number of cores

comment:3 Changed 3 years ago by saraedum

My first guess would be that something in the sage-num-threads.py script broke. I'll have a look.

comment:4 Changed 3 years ago by saraedum

To get the old behaviour, set SAGE_NUM_THREADS=0 btw.

comment:5 Changed 3 years ago by saraedum

  • Authors set to Julian Rüth
  • Milestone changed from sage-8.3 to sage-duplicate/invalid/wontfix
  • Reviewers set to Julian Rüth
  • Status changed from new to needs_review

This is essentially a duplicate of #24937.

comment:6 Changed 3 years ago by saraedum

  • Status changed from needs_review to positive_review

comment:7 Changed 3 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from positive_review to closed

Duplicate of #24937

comment:8 Changed 3 years ago by gh-lerouxje

thank you all for your help and sorry if I opened a ticket for a problem already identified and solved

Note: See TracTickets for help on using tickets.