[OMPT] fix __ompt_get_teaminfo to consult lwt entries of parent teams
The comment already states, that this function should work similarly as __ompt_get_taskinfo.
The function only looked for lwt entries of the current team, but not when unrolling the parents. This fix aligns the implementation to __ompt_get_taskinfo.
The new test case creates a single theaded team (->lwt) and then a nested active team.
Before the innermost print_id(1) would deliver a different team then the outer print_id(0).
Patch by Joachim Protze!
Differential Revision: https://reviews.llvm.org/D23309
llvm-svn: 281466
diff --git a/openmp/runtime/src/ompt-specific.c b/openmp/runtime/src/ompt-specific.c
index 506b282..9a962f4 100644
--- a/openmp/runtime/src/ompt-specific.c
+++ b/openmp/runtime/src/ompt-specific.c
@@ -60,7 +60,12 @@
// next heavyweight team (if any) after
// lightweight teams are exhausted
- if (!lwt && team) team=team->t.t_parent;
+ if (!lwt && team) {
+ team=team->t.t_parent;
+ if (team) {
+ lwt = LWT_FROM_TEAM(team);
+ }
+ }
depth--;
}