Skip to content

Commit 8cb45c8

Browse files
committedJun 13, 2016
Exclude untied tasks from task stealing constraint
If either current_task or new_task is untied then skip task scheduling constraint checks, because untied tasks are not affected by the task scheduling constraints. Differential Revision: http://reviews.llvm.org/D21196 llvm-svn: 272570
1 parent fb2342d commit 8cb45c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎openmp/runtime/src/kmp_tasking.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ __kmp_remove_my_task( kmp_info_t * thread, kmp_int32 gtid, kmp_task_team_t *task
16441644
tail = ( thread_data -> td.td_deque_tail - 1 ) & TASK_DEQUE_MASK(thread_data->td); // Wrap index.
16451645
taskdata = thread_data -> td.td_deque[ tail ];
16461646

1647-
if (is_constrained) {
1647+
if (is_constrained && (taskdata->td_flags.tiedness == TASK_TIED)) {
16481648
// we need to check if the candidate obeys task scheduling constraint:
16491649
// only child of current task can be scheduled
16501650
kmp_taskdata_t * current = thread->th.th_current_task;
@@ -1751,7 +1751,7 @@ __kmp_steal_task( kmp_info_t *victim, kmp_int32 gtid, kmp_task_team_t *task_team
17511751
parent = parent->td_parent; // check generation up to the level of the current task
17521752
KMP_DEBUG_ASSERT(parent != NULL);
17531753
}
1754-
if ( parent != current ) {
1754+
if ( parent != current && (taskdata->td_flags.tiedness == TASK_TIED) ) { // untied is always allowed to be stolen
17551755
// If the tail task is not a child, then no other childs can appear in the deque (?).
17561756
__kmp_release_bootstrap_lock( & victim_td -> td.td_deque_lock );
17571757
KA_TRACE(10, ("__kmp_steal_task(exit #2): T#%d could not steal from T#%d: task_team=%p "

0 commit comments

Comments
 (0)
Please sign in to comment.