Skip to content

IntervalArithmetic should respect the number of threads #782

Open

Description

@dpsanders

The IntervalArithmetic.jl initialization explicitly sets its OpenBLASConsistentFPCSR library to use Sys.CPU_THREADS ÷ 2 threads.

However it should respect OPENBLAS_NUM_THREADS=1 and LinearAlgebra.BLAS.set_num_threads(1) if these are set, so that users can clamp the number of threads used by their process to a given maximum number.

Of course this could be configurable somehow, but a user needs to be able to guarantee not to have half their CPU taken over by IntervalArithmetic without their knowledge or permission :)

Activity

  1. OlivierHnt commented on Oct 7, 2026

    @OlivierHnt
    Member

    I am not sure it makes sense for LinearAlgebra.BLAS.set_num_threads(1) to also impact OpenBLASConsistentFPCSR.

    I think we are doing the same as MKL.jl. Here is a quote from their README file:

    To set or get the global number of threads used by MKL, use MKL.{set/get}_num_threads. This does not affect specific domains where the number of threads is set with mkl_domain_set_num_threads. Calling LinearAlgebra.BLAS.{set/get}_num_threads is domain-specific and only refers to the BLAS domain (unlike other backends, where the number of threads used by LAPACK is also modified).

    Btw setting the number of threads is done via IntervalArithmetic.configure(; nthreads=1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions