[Openmp-commits] [openmp] r287557 - Merging r278332:

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 21 10:42:31 PST 2016


Author: jlpeyton
Date: Mon Nov 21 12:42:31 2016
New Revision: 287557

URL: http://llvm.org/viewvc/llvm-project?rev=287557&view=rev
Log:
Merging r278332:
------------------------------------------------------------------------
r278332 | achurbanov | 2016-08-11 08:04:00 -0500 (Thu, 11 Aug 2016) | 3 lines

Fixes for hierarchical barrier (possible hang if team size changed).

Differential Revision: http://reviews.llvm.org/D23175
------------------------------------------------------------------------

Modified:
    openmp/branches/release_39/   (props changed)
    openmp/branches/release_39/runtime/src/kmp_runtime.c

Propchange: openmp/branches/release_39/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 21 12:42:31 2016
@@ -1 +1 @@
-/openmp/trunk:278036
+/openmp/trunk:278036,278332

Modified: openmp/branches/release_39/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/branches/release_39/runtime/src/kmp_runtime.c?rev=287557&r1=287556&r2=287557&view=diff
==============================================================================
--- openmp/branches/release_39/runtime/src/kmp_runtime.c (original)
+++ openmp/branches/release_39/runtime/src/kmp_runtime.c Mon Nov 21 12:42:31 2016
@@ -4848,6 +4848,19 @@ __kmp_allocate_team( kmp_root_t *root, i
                 }
 #if KMP_NESTED_HOT_TEAMS
             } // (__kmp_hot_teams_mode == 0)
+            else {
+                // When keeping extra threads in team, switch threads to wait on own b_go flag
+                for (f=new_nproc; f<team->t.t_nproc; ++f) {
+                    KMP_DEBUG_ASSERT(team->t.t_threads[f]);
+                    kmp_balign_t *balign = team->t.t_threads[f]->th.th_bar;
+                    for (int b=0; b<bs_last_barrier; ++b) {
+                        if (balign[b].bb.wait_flag == KMP_BARRIER_PARENT_FLAG) {
+                            balign[b].bb.wait_flag = KMP_BARRIER_SWITCH_TO_OWN_FLAG;
+                        }
+                        KMP_CHECK_UPDATE(balign[b].bb.leaf_kids, 0);
+                    }
+                }
+            }
 #endif // KMP_NESTED_HOT_TEAMS
             team->t.t_nproc =  new_nproc;
             // TODO???: team->t.t_max_active_levels = new_max_active_levels;
@@ -5331,6 +5344,7 @@ __kmp_free_thread( kmp_info_t *this_th )
         if (balign[b].bb.wait_flag == KMP_BARRIER_PARENT_FLAG)
             balign[b].bb.wait_flag = KMP_BARRIER_SWITCH_TO_OWN_FLAG;
         balign[b].bb.team = NULL;
+        balign[b].bb.leaf_kids = 0;
     }
     this_th->th.th_task_state = 0;
 




More information about the Openmp-commits mailing list