./parallel/py-threadpoolctl, Helpers to limit the number of threads used

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ]


Branch: CURRENT, Version: 3.8.0, Package name: py314-threadpoolctl-3.8.0, Maintainer: pkgsrc-users

Python helpers to limit the number of threads used in the threadpool-backed of
common native libraries used for scientific computing and data science (e.g.
BLAS and OpenMP).


Master sites:

Filesize: 38.5 KB

Version history: (Expand)


CVS history: (Expand)


   2026-11-10 10:06:57 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-threadpoolctl: updated to 3.8.0

3.8.0

Run faster on Linux, where the new /proc/self/maps mechanism in 3.7.0 added \ 
quite a bit of overhead.

When OpenBLAS uses a non-OpenMP threading layer, you can only set the size of \ 
its thread pool from a single controlling thread; since it has a shared \ 
process-wide thread pool, having multiple Python threads fight over control \ 
wouldn't work well. A new API OpenBLASController.clear_controlling_thread() \ 
allows resetting which thread controlls OpenBLAS in these cases, and decorator \ 
and context manager limit APIs will automatically call that API when they are \ 
done.

Add a new API to get a cached ThreadpoolController instance \ 
(get_cached_controller()), as an optimization for cases where limits are set \ 
frequently. See the docstring for caveats.

Added official support for Python 3.15, and declared support for Python 3.14 in \ 
package metadata.

Faster performance when creating a ThreadpoolController.

Shared libraries are now cached across runs, whereas previously they would be \ 
unloaded after the ThreadpoolController was garbage collected.

A single shared library can no longer have multiple LibController instances.

When passing a list of dicts or a dict to threadpool_limits(limit=...) and \ 
related APIs, the "filepath" is used as the unique key identifying \ 
LibControllers, if available, falling back to "prefix". Previously the \ 
"prefix" was checked first.

Fixed limits="sequential_blas_under_openmp", which left all BLAS \ 
libraries unlimited as soon as OpenBLAS was loaded, whatever its threading \ 
layer, or a library used the OpenMP threading layer (e.g. BLIS). The limit is \ 
now only skipped when OpenBLAS uses the OpenMP threading layer, as documented.

Dropped official support for Python 3.9.

Fixed recursive @threadpool_limits.wrap() calls so they restore limits correctly.

Fixed @threadpool_limits.wrap() so it can use third-party libraries that were \ 
registered or imported after the function was decorated.
   2026-09-23 15:11:47 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-threadpoolctl: updated to 3.7.0

3.7.0 (2026-09-15)

Fixed an intermittent OSError on Windows when DLLs are loaded or unloaded \ 
concurrently during library discovery (for example when importing conda-forge \ 
OpenCV). On Python 3.14+, discovery uses ctypes.util.dllist when available. If \ 
dllist raises OSError, threadpoolctl emits a RuntimeWarning instead of crashing \ 
so the failure can be reported upstream with a minimal reproducer. Older Pythons \ 
use a Toolhelp snapshot enumerator, with graceful per-module fallbacks.

Added the ability to check whether a limiting API affects just the current \ 
thread or the whole process. Mainly aimed at debugging and diagnostics, and \ 
somewhat unreliable, it is therefore enabled by default only for command-line \ 
usage.

Only warn about simultaneous libomp and libiomp usage on Linux, where the \ 
incompatibility is known to cause crashes.

Fixed a deadlock triggered by getting or setting MKL's number of threads \ 
from parallel threads when using MKL with libiomp (Intel threading) on Linux.

Going forward, setting the number of threads will only have a thread-local \ 
impact if feasible (for example, at minimum the underlying library must support \ 
this option, and many don't.)

For MKL, setting the number of threads is now thread-local, i.e. limiting the \ 
number of threads won't impact MKL's thread pool size when using MKL \ 
in other Python threads.

For OpenBLAS compiled with OpenMP on Linux and macOS, setting the number of \ 
threads is now thread-local, i.e. won't impact OpenBLAS thread pool size in \ 
other Python threads. On Windows behavior is likely process-wide, but this may \ 
depend on how OpenBLAS was compiled with OpenMP.

Fix OpenBLAS detection for conda package on Windows

Fixed a deadlock on Linux when using threadpoolctl from multiple threads.

Start using Python 3.14's built-in support for listing shared libraries.

On Linux, start using /proc/self/maps for listing shared libraries.

Avoid importing ctypes.util on Linux (and load libc with ctypes.CDLL(None)) so \ 
threadpool_info() does not create libffi closures that can abort after os.fork() \ 
on some libffi builds.

Dropped official support for Python 3.9.
   2026-08-12 23:47:29 by Thomas Klausner | Files touched by this commit (3)
Log message:
py-threadpoolctl: fix build with flit_core 4.
   2025-03-13 16:09:25 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-threadpoolctl: updated to 3.6.0

3.6.0

Added support for libraries with a path longer than 260 on Windows. The \ 
supported path length is now 10 times higher but not unlimited for security \ 
reasons.

Dropped official support for Python 3.8.
   2025-02-23 20:33:50 by Thomas Klausner | Files touched by this commit (2)
Log message:
py-threadpoolctl: adapt for flit_core 3.11.

Bump PKGREVISION.
   2024-04-30 08:54:18 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-threadpoolctl: updated to 3.5.0

3.5.0 (2024-04-29)

- Added support for the Scientific Python version of OpenBLAS
  (https://github.com/MacPython/openblas-libs), which exposes symbols with different
  names than the ones of the original OpenBLAS library.
  https://github.com/joblib/threadpoolctl/pull/175
   2024-03-23 08:22:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-threadpoolctl: updated to 3.4.0

3.4.0 (2024-03-20)
==================

- Added support for Python interpreters statically linked against libc or linked \ 
against
  alternative implementations of libc like musl (on Alpine Linux for instance).
  https://github.com/joblib/threadpoolctl/pull/171

- Added support for Pyodide
  https://github.com/joblib/threadpoolctl/pull/169
   2024-02-14 22:31:01 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-threadpoolctl: updated to 3.3.0

3.3.0 (2024-02-14)
==================

- Extended FlexiBLAS support to be able to switch backend at runtime.
  https://github.com/joblib/threadpoolctl/pull/163

- Added support for FlexiBLAS
  https://github.com/joblib/threadpoolctl/pull/156

- Fixed a bug where an unsupported library would be detected because it shares a \ 
common
  prefix with one of the supported libraries. Now the symbols are also checked to
  identify the supported libraries.
  https://github.com/joblib/threadpoolctl/pull/151