[all-commits] [llvm/llvm-project] 844296: [OpenMP] Fix task wait doesn't work as expected in...

Shilei Tian via All-commits all-commits at lists.llvm.org
Tue Aug 31 09:15:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8442967fe32453ada32913d1e0fdd97b19520df2
      https://github.com/llvm/llvm-project/commit/8442967fe32453ada32913d1e0fdd97b19520df2
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

  Changed paths:
    M openmp/runtime/src/kmp_tasking.cpp
    M openmp/runtime/test/tasking/hidden_helper_task/depend.cpp
    M openmp/runtime/test/tasking/hidden_helper_task/gtid.cpp

  Log Message:
  -----------
  [OpenMP] Fix task wait doesn't work as expected in serialized team

As discussed in D107121, task wait doesn't work when a regular task T depends on
a detached task or a hidden helper task T' in a serialized team. The root cause is,
since the team is serialized, the last task will not be tracked by
`td_incomplete_child_tasks`. When T' is finished, it first releases its
dependences, and then decrements its parent counter. So far so good. For the thread
that is running task wait, if at the moment it is still spinning and trying to
execute tasks, it is fine because it can detect the new task and execute it.
However, if it happends to finish the function `flag.execute_tasks(...)`, it will
be broken because `td_incomplete_child_tasks` is 0 now.

In this patch, we update the rule to track children tasks a little bit. If the
task team encounters a proxy task or a hidden helper task, all following tasks
will be tracked.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D107496




More information about the All-commits mailing list