Introduce dynamic affinity dispatch capabilities
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 14 Nov 2016 21:08:35 +0000 (21:08 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Mon, 14 Nov 2016 21:08:35 +0000 (21:08 +0000)
commit1cdd87adfd379d178c2aeae59b5bb05079ef67f5
tree3ea5a3378d309ca3307495e7ccab89d7aa337d66
parent22fc0078095c5806aba560a3ec9add1e9c11e647
Introduce dynamic affinity dispatch capabilities

This set of changes enables the affinity interface (Either the preexisting
native operating system or HWLOC) to be dynamically set at runtime
initialization. The point of this change is that we were seeing performance
degradations when using HWLOC. This allows the user to use the old affinity
mechanisms which on large machines (>64 cores) makes a large difference in
initialization time.

These changes mostly move affinity code under a small class hierarchy:

KMPAffinity
  class Mask {}
KMPNativeAffinity : public KMPAffinity
  class Mask : public KMPAffinity::Mask
KMPHwlocAffinity
  class Mask : public KMPAffinity::Mask

Since all interface functions (for both affinity and the mask implementation)
are virtual, the implementation can be chosen at runtime initialization.

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

llvm-svn: 286890
13 files changed:
openmp/runtime/cmake/LibompHandleFlags.cmake
openmp/runtime/cmake/config-ix.cmake
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_affinity.cpp
openmp/runtime/src/kmp_affinity.h
openmp/runtime/src/kmp_ftn_cdecl.c
openmp/runtime/src/kmp_ftn_entry.h
openmp/runtime/src/kmp_ftn_extra.c
openmp/runtime/src/kmp_global.c
openmp/runtime/src/kmp_runtime.c
openmp/runtime/src/kmp_settings.c
openmp/runtime/src/z_Linux_util.c
openmp/runtime/src/z_Windows_NT_util.c