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

[OpenMP] Simplify accessing num-teams and team-num #131618

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hansangbae
Copy link
Contributor

We found an issue with accessing correct number of teams and team number when the enclosing region is serialized due to use of if clause. It appears that the existing method is not able to handle such cases, so this change proposes a simpler way of accessing the team struct bound to the implicit task invoked by each OpenMP team in the league.

We found an issue with accessing correct number of teams
and team number when the enclosing region is serialized due to
use of if clause. It appears that the existing method is not
able to handle such cases, so this change proposes a simpler way
of accessing the team struct bound to the implicit task invoked
by each OpenMP team in the league.
Copy link

github-actions bot commented Mar 17, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@jprotze
Copy link
Collaborator

jprotze commented Mar 17, 2025

Why is the extra team info necessary at all? There was a full team created and populated with information during creation of the league. For parallel execution, these thread data structures are used, but for a serialized team, a new data structure is used and populated with information !?!

@hansangbae
Copy link
Contributor Author

Why is the extra team info necessary at all? There was a full team created and populated with information during creation of the league. For parallel execution, these thread data structures are used, but for a serialized team, a new data structure is used and populated with information !?!

I think invocation of serialized parallel call (__kmpc_serialized_parallel) was not considered at all when the runtime started to support teams construct. The behavior of the entry itself does not have any problem when it is invoked outside of a teams region.
Anyway, we may be able to have a better fix when clang also uses __kmpc_fork_call_if.

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

Successfully merging this pull request may close these issues.

2 participants