• Advertisement
Sign in to follow this  

Does omp_set_num_threads() works globally?

This topic is 1759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there,

 

I am writing a code that cosists of many different functions using OpenMP. I wonder if there is a good way to set number of used threads once.

Can O do this using omp_set_num_threads()? Or I need to call it in every function that uses OpenMP?

 

Thanks in advance,

Misery

Share this post


Link to post
Share on other sites
Advertisement

I believe it's global, but this kind of thing is trivial to test...

 

I did test it and it seems global. But since the documentation is (gently speaking) - a bit unsufficient, I thought I'd ask, to avoid stepping on a mine after writing next 10k lines of code :]

 

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement