Skip to content

Unify computation of number of parallel jobs #33317

@tobiasdiez

Description

@tobiasdiez

Currently, the number of jobs used for parallel operations is re-computed and set in various places. In this ticket, we unify this to one central place in sage.env, which is then reused across the whole infrastructure. The only exception is the script build/bin/sage-build-num-threads which is only needed in the build of the sage-conf package. This can probably be improved as well, but we leave it for a follow-up ticket.

Changes in detail:

  • Remove SAGE_NUM_THREADS_PARALLEL since it was only used for the docbuild.
  • Introduce the method thread_count in sage.env that based on the environment variable SAGE_NUM_THREADS and the number of CPUs computes the number of parallel jobs sage should use.
  • Use this method (or its cached value THREAD_COUNT) everywhere where previously SAGE_NUM_THREADS has been used.
  • Remove a few places that also calculated the number of CPUs or number of parallel jobs.
  • In particular, remove the computation of the number of threads to use in the make files. This is now exclusively handled through sage.env.
  • Don't specify SAGE_NUM_THREADS on CI, but let this be calculated using the number of CPUs available.

CC: @mkoeppe @jhpalmieri @tscrim @nthiery @fchapoton

Component: build

Branch/Commit: public/build/num_threads @ af4c3e2

Issue created by migration from https://trac.sagemath.org/ticket/33317

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions