From de8d65914bd5c0254d2024fe8643460f68406cfa Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Fri, 10 Mar 2017 17:22:47 +0000 Subject: [PATCH] Fix assertion failure when 'proclist' is used without 'explicit' in KMP_AFFINITY This change fixes an assertion failure the in case KMP_AFFINITY is set with 'proclist' specified but without 'explicit' e.g., KMP_AFFINITY=verbose,proclist=[0-31] Patch by Olga Malysheva Differential Revision: https://reviews.llvm.org/D30404 llvm-svn: 297480 --- openmp/runtime/src/kmp_settings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp index 3f8ec39a5dce..3d6bd4e7066f 100644 --- a/openmp/runtime/src/kmp_settings.cpp +++ b/openmp/runtime/src/kmp_settings.cpp @@ -2240,9 +2240,12 @@ __kmp_parse_affinity_env( char const * name, char const * value, if ( proclist ) { if ( ! type ) { KMP_WARNING( AffProcListNoType, name ); - __kmp_affinity_type = affinity_explicit; + *out_type = affinity_explicit; +# if OMP_40_ENABLED + __kmp_nested_proc_bind.bind_types[0] = proc_bind_intel; +# endif } - else if ( __kmp_affinity_type != affinity_explicit ) { + else if ( *out_type != affinity_explicit ) { KMP_WARNING( AffProcListNotExplicit, name ); KMP_ASSERT( *out_proclist != NULL ); KMP_INTERNAL_FREE( *out_proclist );