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

Number of cpus #3

Open
danghvu opened this issue Sep 16, 2017 · 3 comments
Open

Number of cpus #3

danghvu opened this issue Sep 16, 2017 · 3 comments

Comments

@danghvu
Copy link

danghvu commented Sep 16, 2017

Hi,

I'm using Gemini and find out that the number of threads is set to the number of hardware threads. This is suboptimal in my experiment. It's better to set it to an entire core.

Can you confirm if it will work OK if I set number of threads to number of cores or is there any side effect ?

@coolerzxw
Copy link
Member

Hi. In your case, as long as the thread affinity is properly set, this change (to the number of threads) should not introduce side effects. You can use OpenMP environmental variables to ensure threads are allocated as expected.

@danghvu
Copy link
Author

danghvu commented Sep 17, 2017

Yes, my changes are simply:

-    threads = numa_num_configured_cpus();
+    threads = omp_get_max_threads();

And set the number of threads using OMP_NUM_THREADS and affinity with OMP_PLACES=cores

Is this your intention to use numa_num_configured_cpus for targeting hardware threads ? Or you didn't consider that case ?

@danghvu
Copy link
Author

danghvu commented Sep 17, 2017

Personally I think it's better to allow the user to chose how many threads to run and the binding accordingly.

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

2 participants