Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP RT] Passive policy with dist barrier does not end #80664

Closed
mikaoP opened this issue Feb 5, 2024 · 1 comment · Fixed by #83058
Closed

[OpenMP RT] Passive policy with dist barrier does not end #80664

mikaoP opened this issue Feb 5, 2024 · 1 comment · Fixed by #83058
Assignees
Labels
openmp:libomp OpenMP host runtime openmp

Comments

@mikaoP
Copy link
Contributor

mikaoP commented Feb 5, 2024

// clang -fopenmp t1.c -o t1 && OMP_WAIT_POLICY=passive KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' ./t1
void test_omp_barrier()
{
  #pragma omp parallel
  {
    #pragma omp task
    {}
  }
}

int main()
{
  test_omp_barrier();
}

It seems to be a simple parallel with tasks and passive policy does not allow the dist barrier to progress and finish the execution. Removing passive or changing the barrier pattern makes the program work again.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 5, 2024

@llvm/issue-subscribers-openmp

Author: None (mikaoP)

```c // clang -fopenmp t1.c -o t1 && OMP_WAIT_POLICY=passive KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' ./t1 void test_omp_barrier() { #pragma omp parallel { #pragma omp task {} } }

int main()
{
test_omp_barrier();
}

It seems to be a simple parallel with tasks and passive policy does not allow the dist barrier to progress and finish the execution. Removing passive or changing the barrier pattern makes the program work again.
</details>

@jpeyton52 jpeyton52 self-assigned this Feb 7, 2024
@jpeyton52 jpeyton52 added the openmp:libomp OpenMP host runtime label Feb 7, 2024
jpeyton52 added a commit to jpeyton52/llvm-project that referenced this issue Feb 26, 2024
The resume thread logic inside __kmp_free_team() is faulty. Only
checking b_go for sleep status doesn't wake up distributed barrier.
Change to generic check for th_sleep_loc and calling
__kmp_null_resume_wrapper().

Fixes: llvm#80664
jpeyton52 added a commit that referenced this issue Feb 27, 2024
…3058)

The resume thread logic inside __kmp_free_team() is faulty. Only
checking b_go for sleep status doesn't wake up distributed barrier.
Change to generic check for th_sleep_loc and calling
__kmp_null_resume_wrapper().

Fixes: #80664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime openmp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants