diff options
| author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2017-11-29 22:27:18 +0000 | 
|---|---|---|
| committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2017-11-29 22:27:18 +0000 | 
| commit | 64249504b5d6a4e28921cf646833a11a5138ec96 (patch) | |
| tree | cb2cc17eff13959c5c4a733c8bab21ae1d76d71e | |
| parent | fa8fa044ec46b94e64971efa8852df0d58114062 (diff) | |
| download | bcm5719-llvm-64249504b5d6a4e28921cf646833a11a5138ec96.tar.gz bcm5719-llvm-64249504b5d6a4e28921cf646833a11a5138ec96.zip  | |
Warning is emitted when tiles are requested but cannot be used
Added two warnings:
1) Before building the topology map check if tiles are requested but the
   topo method is not hwloc;
2) After building the topology map check if tiles are requested but not
   detected by the library.
Patch by Olga Malysheva
Differential Revision: https://reviews.llvm.org/D40340
llvm-svn: 319374
| -rw-r--r-- | openmp/runtime/src/i18n/en_US.txt | 4 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp_affinity.cpp | 12 | 
2 files changed, 15 insertions, 1 deletions
diff --git a/openmp/runtime/src/i18n/en_US.txt b/openmp/runtime/src/i18n/en_US.txt index 40d0263ab6e..790fad4acbb 100644 --- a/openmp/runtime/src/i18n/en_US.txt +++ b/openmp/runtime/src/i18n/en_US.txt @@ -38,7 +38,7 @@ Language "English"  Country  "USA"  LangId   "1033"  Version  "2" -Revision "20170327" +Revision "20170523" @@ -325,6 +325,8 @@ StgIgnored                   "%1$s: ignored because %2$s has been defined"                                   # %1, -- name of ignored variable, %2 -- name of variable with higher priority.  OBSOLETE                     "%1$s: overrides %3$s specified before"                                   # %1, %2 -- name and value of the overriding variable, %3 -- name of overriden variable. +AffTilesNoHWLOC              "%1$s: Tiles are only supported if KMP_TOPOLOGY_METHOD=hwloc, using granularity=package instead" +AffTilesNoTiles              "%1$s: Tiles requested but were not detected on this HW, using granularity=package instead"  OmptOutdatedWorkshare        "OMPT: Cannot determine workshare type; using the default (loop) instead. "                               "This issue is fixed in an up-to-date compiler." diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index 1964ea714c0..df9e8387dca 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -3849,6 +3849,13 @@ static void __kmp_aux_affinity_initialize(void) {      }    } +  if (__kmp_affinity_gran == affinity_gran_tile && +      // check if user's request is valid +      __kmp_affinity_dispatch->get_api_type() == KMPAffinity::NATIVE_OS) { +    KMP_WARNING(AffTilesNoHWLOC, "KMP_AFFINITY"); +    __kmp_affinity_gran = affinity_gran_package; +  } +    int depth = -1;    kmp_i18n_id_t msg_id = kmp_i18n_null; @@ -4115,6 +4122,11 @@ static void __kmp_aux_affinity_initialize(void) {      return;    } +  if (__kmp_affinity_gran == affinity_gran_tile && __kmp_tile_depth == 0) { +    // tiles requested but not detected, warn user on this +    KMP_WARNING(AffTilesNoTiles, "KMP_AFFINITY"); +  } +    __kmp_apply_thread_places(&address2os, depth);    // Create the table of masks, indexed by thread Id.  | 

