Prevent accidental increase of the thread count inside a parallel region - #5949
Open
martin-frbg wants to merge 1 commit into
Open
Prevent accidental increase of the thread count inside a parallel region#5949martin-frbg wants to merge 1 commit into
martin-frbg wants to merge 1 commit into
Conversation
Closed
Contributor
|
I added a test case in #5950 that would hopefully catch a future regression in case you wanted to port something like it over to this PR |
Collaborator
Author
|
Thanks - now you've got me worrying if my patch could be too simple. But as far as I'm aware, trying to run more than one thread when already inside a parallel region is invoking undefined behavior at least with older OpenMP versions (and I think even with the latest one). And the openblas_num_threads_local is unfinished and unrelated to OpenMP. |
Contributor
|
I don't think nested parallel regions (at least with the current standard) is undefined behavior. If it was then the omp_set_max_active_levels API doesn't make much sense https://www.openmp.org/spec-html/5.0/openmpsu125.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #5947