[all-commits] [llvm/llvm-project] 4ea249: [OpenMP] Fix nested parallel with tasking (#87309)
Jonathan Peyton via All-commits
all-commits at lists.llvm.org
Tue Apr 2 13:57:11 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4ea24946e356be31446fc30ca3d11cc5783ba2a6
https://github.com/llvm/llvm-project/commit/4ea24946e356be31446fc30ca3d11cc5783ba2a6
Author: Jonathan Peyton <jonathan.l.peyton at intel.com>
Date: 2024-04-02 (Tue, 02 Apr 2024)
Changed paths:
M openmp/runtime/src/kmp_tasking.cpp
A openmp/runtime/test/tasking/issue-87307.c
Log Message:
-----------
[OpenMP] Fix nested parallel with tasking (#87309)
When a nested parallel region ends, the runtime calls __kmp_join_call().
During this call, the primary thread of the nested parallel region will
reset its tid (retval of omp_get_thread_num()) to what it was in the
outer parallel region. A data race occurs with the current code when
another worker thread from the nested inner parallel region tries to
steal tasks from the primary thread's task deque. The worker thread
reads the tid value directly from the primary thread's data structure
and may read the wrong value.
This change just uses the calculated victim_tid from execute_tasks()
directly in the steal_task() routine rather than reading tid from the
data structure.
Fixes: #87307
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list