-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add ROOT::GetAvailableThreads() helper. #754
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
Conversation
|
Starting build on |
Introduce a new helper returning the number of logical CPUs available to the current process. In case of having an affinity mask, it will return in accordance to it (IMT & tbb required for this). Also delete useless return.
|
Starting build on |
core/base/src/TROOT.cxx
Outdated
| } | ||
|
|
||
| //////////////////////////////////////////////////////////////////////////////// | ||
| /// Returns the maximum number of threads the user can instantiate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is incorrect (at least for the !IMT case). Could you copy the comment from GetMaxNThreadsAvailable()?
Also this doesn't return the available threads but their number. I'd suggest to use the same name for both the TROOT member and the ROOT::Internal member.
core/imt/inc/ROOT/TPoolManager.hxx
Outdated
|
|
||
| /// Get the maximum number of logical CPUs available. | ||
| /// In case of having an affinity mask (TBB), return the logical CPU available to the current process in accordance with it. | ||
| Int_t GetMaxNThreadsAvailable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you adjust the function name to the documentation? It does not return the maximum number of threads.
|
Starting build on |
|
Still not happy with the function naming. Any suggestions? |
|
Starting build on |
|
I think the name is perfect given the current implementation! |
Introduce a new helper returning the number of logical CPUs available to the current process. In case of having an affinity mask, it will return in accordance to it (IMT & tbb required for this).
Function naming can be improved. I wanted to keep tbb away from ImplicitMT and that's why the core function is defined in TPoolManager.hxx. Should it be a member of the class?
Also delete useless return.