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

Set OMP_PROC_BIND=false before calling omp_get_max_threads #1241

Merged
merged 2 commits into from
Aug 20, 2023

Conversation

rmjarvis
Copy link
Member

Some OMP implemenations have a bug where if omp_get_max_threads() is called (which is what this function does), it sets something called thread affinity.

The upshot of that is that multiprocessing (i.e. not even just omp threading) is confined to a single hardware thread. Yeah, it's idiotic, but that seems to be the case. The only solution found by @erykoff, who looked into it pretty hard, is to set the env variable OMP_PROC_BIND to "false". This seems to stop the bad behavior.

So this PR adds that to the two functions that could potentially call omp_get_max_threads in the C++ layer.

@rmjarvis rmjarvis added this to the v2.5 milestone Aug 19, 2023
@jmeyers314
Copy link
Member

LGTM

Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rmjarvis rmjarvis merged commit 2f45375 into main Aug 20, 2023
9 checks passed
@rmjarvis rmjarvis deleted the omp_proc_bind branch August 20, 2023 04:21
@rmjarvis rmjarvis added bug report Bug report desc Of possible interest to LSST DESC members looking for a project labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report desc Of possible interest to LSST DESC members looking for a project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants