Jump to content
  • Advertisement
Sign in to follow this  
Misery

Does omp_set_num_threads() works globally?

This topic is 2032 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!