This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][OMPT] lightweight tasks and explicit tasks
Needs ReviewPublic

Authored by vladaindjic on Sep 29 2021, 5:58 AM.

Details

Summary

__ompt_get_task_info_internal function was extended to support arbitrary
nesting of explicit tasks and serialized parallel regions. In
particular, this fixes problems that occur when a serialized parallel
region is nested inside an explicit task which is at the same time
enclosed by another serialized parallel region.

While forming a serialized parallel region nested inside an explicit task,
a new lightweight task descriptor is created to represent the information
about the explicit task. To indicate whether a lightweight task descriptor
corresponds to an explicit or an implicit task, it now contains td_flags field
of kmp_tasking_flags_t type. Now, the ompt_get_task_info can determine
the right information about the task type.

When a serialized parallel region R2 is nested inside a chain of explicit tasks
belonging to an enclosing serialized parallel region R1, all explicit tasks nested
in R1 and R1’s implicit task share the same ompt_team_info stored inside the lwt
that represents the innermost explicit task in R1. (before nested loop)

The following tests are provided to show that the patch fixes described problems:

  1. lwts_info.c - contains serialized parallel region that encloses an explicit task that encloses another serialized parallel region.
  2. lwts_if_info.c - the same as previous with the difference that if(0) clause is used inside omp parallel and task directives
  3. nested_lwts_info.c - contains three nested serialized parallel regions that enclose three explicit tasks that enclose another three nested serialized parallel regions.
  4. nested_lwts_if0_info.c - the same as previous with the difference that if(0) clause is used inside omp parallel and task directives

Diff Detail

Event Timeline

vladaindjic created this revision.Sep 29 2021, 5:58 AM
vladaindjic requested review of this revision.Sep 29 2021, 5:58 AM
Herald added a project: Restricted Project. · View Herald Transcript

Some comments has been clarified.
Also, the diffs in ompt-specific.cpp has been clang-formatted.

Please update the diff with context (-U9999)

vladaindjic updated this revision to Diff 380633.EditedOct 19 2021, 3:31 AM

The diff context should have been provided. @protze.joachim
Also, some comments have been rewritten for clarification.

  • [OpenMP][OMPT] clang-formatted diffs of kmp_tasking_flags.h and ompt-specific.cpp