__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:
- lwts_info.c - contains serialized parallel region that encloses an explicit task that encloses another serialized parallel region.
- lwts_if_info.c - the same as previous with the difference that if(0) clause is used inside omp parallel and task directives
- nested_lwts_info.c - contains three nested serialized parallel regions that enclose three explicit tasks that enclose another three nested serialized parallel regions.
- nested_lwts_if0_info.c - the same as previous with the difference that if(0) clause is used inside omp parallel and task directives