llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.6k stars 11.82k forks source link

OpenMP: Extra barrier policy debug assert hit #77575

Open mikaoP opened 9 months ago

mikaoP commented 9 months ago
int main()
{
  #pragma omp parallel num_threads(32)
  {
      #pragma omp task
      {
      }
      #pragma omp taskwait
  }
}

clang -fopenmp t1.c -o t1 && KMP_TASKING=1 ./t1 I've been playing with tskm_extra_barrier tasking mode and got an Assertion failure at kmp_tasking.cpp(3392): *unfinished_threads >= 0.

With gdb I see *unfinished_threads == -1. I think this happens because there is the assumption tt_unfinished_threads is the number of threads of the team when running execute_tasks. With extra_barrier tasking mode this is not respected because execute_tasks is run both in __kmp_tasking_barrier and __kmp_wait_template of the barrier.

llvmbot commented 9 months ago

@llvm/issue-subscribers-openmp

Author: None (mikaoP)

```cpp int main() { #pragma omp parallel num_threads(32) { #pragma omp task { } #pragma omp taskwait } } ``` `clang -fopenmp t1.c -o t1 && KMP_TASKING=1 ./t1` I've been playing with `tskm_extra_barrier` tasking mode and got an `Assertion failure at kmp_tasking.cpp(3392): *unfinished_threads >= 0.` With gdb I see `*unfinished_threads == -1`. I think this happens because there is the assumption `tt_unfinished_threads` is the number of threads of the team when running `execute_tasks`. With extra_barrier tasking mode this is not respected because execute_tasks is run both in `__kmp_tasking_barrier` and `__kmp_wait_template` of the barrier.