-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pinning affects an external OpenMP library #94
Comments
Are you perhaps oversubscribing CPU cores? That is, are Julia threads and the external OpenMP threads maybe running on the same set of CPU cores? This would explain why it works better without thread pinning, because the OS scheduler then has the flexibility to avoid this (as much as possible). If that's the case you should either avoid thread pinning (as you did) or pin the OpenMP threads as well (e.g. through environment variables) - to different cores, of course. Otherwise, |
I do not think the cpu cores are oversubscribed. When the library is called, only a single thread is running. |
I don't understand, I thought you have multiple threads? Why would pinning or not pinning make a big/any difference if there is only a single thread running? In any case, (Also, you neither provide much information nor a MWE, which makes this hard/impossible to figure out.) |
The issue was intended as a heads up. I'm working on a minimal working example. The application runs with multiple threads. However at the point where the library gets called, only a single thread is running. The issue is real: enabling or disabling pin threading affects the performance of the external library. |
To be clear, I'm not arguing that your performance issue isn't real. I'm saying that it (almost certainly) isn't a bug in ThreadPinning.jl. Of course, feel free to continue the discussion in the Discourse thread. However, much more information will be needed, like:
|
Here is the minimal working example (https://www.dropbox.com/scl/fi/3dezt0lp10pdflcq9479z/mwe_eclgraphcolor.tgz?rlkey=14w67j59xz3uk3fczergzhhmu&dl=0). Here is a sample output:
Two Julia files are provided: one adds, uses ThreadPinning ( The other one does ( |
@carstenbauer Carsten, I am not saying that it is a bug in ThreadPinning. It would be interesting to find out why thread pinning affects OpenMP threads, though. Wouldn't you agree? |
TLDR: An external OpenMP-equipped C++ library shows no parallel speedup when thread pinning is used. Disabling pinning fixed the issue.
https://discourse.julialang.org/t/openmp-in-a-shared-library-opened-in-julia/113880/9
The text was updated successfully, but these errors were encountered: