diff --git a/runtime/src/kmp_tasking.cpp b/runtime/src/kmp_tasking.cpp index 672f9582fee5bdd114dc0d6f5a9f74b97aa10071..d5c67e77e2346eb33961bc7c768327d606135419 100644 --- a/runtime/src/kmp_tasking.cpp +++ b/runtime/src/kmp_tasking.cpp @@ -2208,7 +2208,7 @@ static kmp_queue_data_t *__kmp_select_queue( CHECK_RETURN(¤t_team->tt.tt_task_private_queues[KMP_LEVEL_NUMA][node]); CHECK_RETURN(¤t_team->tt.tt_task_queues[KMP_LEVEL_CORE][cpu]); // cpu CHECK_RETURN(¤t_team->tt.tt_task_queues[KMP_LEVEL_NUMA][node]); - //KMP_YIELD( __kmp_library == library_throughput ); // Yield before executing next task + KMP_YIELD( __kmp_library == library_throughput ); // Yield before executing next task } *islocal = 1; CHECK_RETURN(¤t_team->tt.tt_task_queues[KMP_LEVEL_THREAD][tid]); // cpu @@ -2669,6 +2669,7 @@ static inline int __kmp_execute_tasks_template( if (victim >= tid) { ++victim; // Adjusts random distribution to exclude self } + // Found a potential victim other_thread = threads_data[victim].td.td_thr; // There is a slight chance that __kmp_enable_tasking() did not wake @@ -2847,9 +2848,8 @@ static inline int __kmp_execute_tasks_template( #endif #if LIBOMP_USE_AFFINITY || LIBOMP_USE_THEQUEUE //TG: avoid to return if flag condition is not check - WARN: threads are higly active - if (1) //(flag != NULL && flag->done_check()) + if (flag != NULL && flag->done_check()) #else - if (nthreads !=1) #endif { KA_TRACE(15, @@ -2861,14 +2861,22 @@ static inline int __kmp_execute_tasks_template( GTID_TO_OMPT_THREAD_ID(gtid), (uint64_t)IDLE_STATE, cpu, node ); } #endif - return FALSE; + return FALSE; } +#if LIBOMP_USE_AFFINITY || LIBOMP_USE_THEQUEUE + if (final_spin) + { + return FALSE; + } +#else else { + return FALSE; use_own_tasks=1; victim=-2; new_victim=0; } +#endif } }