question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do you setup NUM_THREADS env variables?

See original GitHub issue

Following 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:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
guillaumeebcommented, Oct 23, 2018

As pointed by the code on the other issue, the interface is different between schedulers. It would be good to unify the apis for the number of cores.

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.

0reactions
louisabrahamcommented, Oct 24, 2018

I swear we don’t know each other!

Agreed to close this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found