Registry / data / threadpoolctl

threadpoolctl

JSON →
library3.6.0pypypi✓ verified 35d ago

Threadpoolctl is a Python library that provides helpers to limit the number of threads used in threadpool-backed native libraries, such as BLAS and OpenMP, commonly used in scientific computing and data science. The current version is 3.6.0, released on March 13, 2025. The library is actively maintained with regular updates to support new Python versions and improve functionality.

dataai-ml
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ensure correct import path to access threadpool_info function.

from threadpoolctl import threadpool_info

Ensure correct import path to access threadpool_limits function.

from threadpoolctl import threadpool_limits

This script demonstrates how to introspect threadpool information and limit the number of threads used by BLAS libraries using threadpoolctl.

import numpy as np from threadpoolctl import threadpool_info, threadpool_limits # Introspect threadpool information info = threadpool_info() for lib in info: print(f"Library: {lib['internal_api']} ({lib['user_api']})") print(f" Version: {lib['version']}") print(f" Threads: {lib['num_threads']}") print(f" Path: {lib['filepath']}") # Limit threads for BLAS with threadpool_limits(limits=1, user_api='blas'): a = np.random.randn(1000, 1000) a_squared = a @ a
Debug
Known footguns
breakingDropped official support for Python 3.8 in version 3.6.0.
gotchaUsing threadpoolctl with both libomp (LLVM OpenMP) and libiomp (Intel OpenMP) loaded may cause crashes or deadlocks.
breakingRequired package 'numpy' is not installed.
breakingRequired package 'numpy' is not found. Ensure all necessary dependencies are installed.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources