Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openmp/runtime/src/kmp_sched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,12 @@ static void __kmp_dist_for_static_init(ident_t *loc, kmp_int32 gtid,
nth = th->th.th_team_nproc;
team = th->th.th_team;
KMP_DEBUG_ASSERT(th->th.th_teams_microtask); // we are in the teams construct
// skip optional serialized teams to prevent this from using the wrong teams
// information when called after __kmp_serialized_parallel
// TODO: make __kmp_serialized_parallel eventually call __kmp_fork_in_teams
// to address this edge case
while (team->t.t_parent && team->t.t_serialized)
team = team->t.t_parent;
nteams = th->th.th_teams_size.nteams;
team_id = team->t.t_master_tid;
KMP_DEBUG_ASSERT(nteams == (kmp_uint32)team->t.t_parent->t.t_nproc);
Expand Down