What is threadpoolctl and when to use it
masterthreadpoolctl provides Python helpers to limit the number of threads used by the thread-pool-backed implementations of common native libraries used in scientific computing and data science, such as BLAS and OpenMP.
Fine control over the underlying thread-pool size is particularly useful for workloads involving nested parallelism to mitigate oversubscription issues (where too many threads compete for CPU resources, degrading performance).