[Openmp-commits] [PATCH] D101082: [OpenMP] Fix deadlock for detachable task with child tasks

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 6 08:55:43 PDT 2021


protze.joachim added a comment.

I still have issues with this patch and I think, it's not the right solution. I wonder, why `__kmp_bottom_half_finish_proxy` is necessary at all - see the inline comment.
If it's necessary, I tend to change the "imaginary children" code to  `td_incomplete_child_tasks |= 0x4000000` and `td_incomplete_child_tasks &= !0x4000000`. Then wait while `(td_incomplete_child_tasks & 0x4000000) != 0`

Even with that change, for a testcase creating thousands of tasks, the execution gets stuck at some point with no task being executed and all threads trying to steal.

@AndreyChurbanov is there any good way to find all remaining tasks with open dependencies in a debugger?



================
Comment at: openmp/runtime/src/kmp_tasking.cpp:3881-3883
   children =
       KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks) - 1;
   KMP_DEBUG_ASSERT(children >= 0);
----------------
Why can't this be part of `__kmp_bottom_half_finish_proxy`? Is the proxy task supposed to be completed, before the __kmp_bottom_half_finish_proxy task executes?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101082/new/

https://reviews.llvm.org/D101082



More information about the Openmp-commits mailing list