Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User-controllable thread pool limits for parallel target to @vectorize and @guvectorize #1655

Closed
seibert opened this issue Jan 25, 2016 · 4 comments
Assignees

Comments

@seibert
Copy link
Contributor

seibert commented Jan 25, 2016

(As requested on the numba-users mailing list.)

Right now we always assume the number of threads for the parallel target is equal to the number of CPUs. There are plenty of situations where this is not desirable (multiple processes, etc), and so it is important to have some mechanism to limit the number of threads.

At a minimum, it would make sense to check the value of OMP_NUM_THREADS at startup, in order to mimic the behavior of other parallel libraries like MKL. We don't actually use OpenMP's thread pool (though maybe we could someday), but this variable is at least somewhat well known to users who want to control the number of threads.

We may also want an API in Numba to change the number of threads as well.

@stuartarchibald
Copy link
Contributor

Environment variable implemented in #1932.

@seibert
Copy link
Contributor Author

seibert commented Jun 14, 2016

Fixed by #1932. (We might further expand things to allow control per call as well.)

@seibert seibert closed this as completed Jun 14, 2016
@jzwinck
Copy link
Contributor

jzwinck commented May 15, 2018

For reference, #2713 is to make the number of threads controllable at runtime.

@jcmgray
Copy link

jcmgray commented Aug 22, 2018

OMP_NUM_THREADS is a very common way of setting the level of thread parallelism in a program. How do people feel about letting numba check this upon import as well? NUMBA_NUM_THREADS would of course take precedent if set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants