How do you setup NUM_THREADS env variables?
See original GitHub issueFollowing this discussion, I would like to make the dask tasks use only one thread each, even if they use BLAS / OMP.
I’m not sure here is the best place to ask, but how can we achieve that on a cluster?
I suppose we could modify the command line of the job scheduler to be able to export some variables.
Without dask, I have seen some other solutions with pure python code that modify os.environ
before importing numpy, but I’m not sure how dask handles the imports.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Setting the Number of Threads Using an OpenMP ...
You can set the number of threads using the environment variable OMP_NUM_THREADS . To change the number of threads, use the appropriate command...
Read more >Setting the Number of Threads Using an OpenMP ... - Intel
Setting the Number of Threads Using an OpenMP* Environment Variable. You can set the number of threads using the environment variable.
Read more >Environment variables for OpenMP - IBM
OpenMP runtime options affecting parallel processing are set by specifying OMP environment variables. These environment variables use syntax of the form:
Read more >OpenMP Environment Variables | Microsoft Learn
Sets the maximum number of threads in the parallel region, unless overridden by omp_set_num_threads or num_threads. OMP_DYNAMIC, Specifies ...
Read more >OMP_NUM_THREADS - OpenMP
See Section 2.5 on page 171 for a comprehensive set of rules about the interaction between the OMP_NUM_THREADS environment variable, the num_threads clause,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes I think your totally right about this. So I will not try to argue as there is two of you needing this (is this a friend of you 🙂 ?). As this issue was first on ENV var, and I think we’ve answer that part. I propose to close this issue in favor of #181 which is focused on the second problem you mention. Happy to leave it open though if you think you need to clarify things in the docs or anywhere in the code.
I swear we don’t know each other!
Agreed to close this.