[Openmp-commits] [openmp] r298313 - Fix incorrect initial value of __kmp_affinity_type.

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Mar 20 15:04:02 PDT 2017


Author: jlpeyton
Date: Mon Mar 20 17:04:02 2017
New Revision: 298313

URL: http://llvm.org/viewvc/llvm-project?rev=298313&view=rev
Log:
Fix incorrect initial value of __kmp_affinity_type.

Affinity initialization code expects __kmp_affinity_type has the value
affinity_default by default, but the cleanup code does not properly set the
value back to affinity_default.  This may introduce some issues when multiple
roots are trying to initialize/uninitialize the runtime successively.

Patch by Hansang Bae

Differential Revision: https://reviews.llvm.org/D31012

Modified:
    openmp/trunk/runtime/src/kmp_affinity.cpp

Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=298313&r1=298312&r2=298313&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Mon Mar 20 17:04:02 2017
@@ -4197,6 +4197,7 @@ __kmp_affinity_uninitialize(void)
         __kmp_affin_fullMask = NULL;
     }
     __kmp_affinity_num_masks = 0;
+    __kmp_affinity_type = affinity_default;
 # if OMP_40_ENABLED
     __kmp_affinity_num_places = 0;
 # endif




More information about the Openmp-commits mailing list