[Openmp-commits] [openmp] r260306 - Proxy task fix: task_state stack push condition on fork

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 9 14:32:41 PST 2016


Author: jlpeyton
Date: Tue Feb  9 16:32:41 2016
New Revision: 260306

URL: http://llvm.org/viewvc/llvm-project?rev=260306&view=rev
Log:
Proxy task fix: task_state stack push condition on fork

The problem is that the master's thread state was not saved before entering a
parallel region so it does not remember tasks when it returns.

Modified:
    openmp/trunk/runtime/src/kmp_runtime.c

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=260306&r1=260305&r2=260306&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Tue Feb  9 16:32:41 2016
@@ -2093,7 +2093,8 @@ __kmp_fork_call(
         KA_TRACE( 20, ( "__kmp_fork_call: Master T#%d pushing task_team %p / team %p, new task_team %p / team %p\n",
                       __kmp_gtid_from_thread( master_th ), master_th->th.th_task_team,
                       parent_team, team->t.t_task_team[master_th->th.th_task_state], team ) );
-        if (level) {
+
+        if ( level || master_th->th.th_task_team ) {
             // Take a memo of master's task_state
             KMP_DEBUG_ASSERT(master_th->th.th_task_state_memo_stack);
             if (master_th->th.th_task_state_top >= master_th->th.th_task_state_stack_sz) { // increase size




More information about the Openmp-commits mailing list