aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/kmp_affinity.cpp
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2017-12-08 15:07:05 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2017-12-08 15:07:05 +0000
commita0542f78656841154035d5d8a2d6ed73c6801d6c (patch)
tree11b235ba7ad40c117264a7222113ec4f395db5a4 /runtime/src/kmp_affinity.cpp
parentc549ebcc764d60c3f187cbd10a7cb6112f841315 (diff)
Fix thread affinity on non-x86 Linux
To make thread affinity work according to the OpenMP spec, the runtime needs information about the hardware topology. On Linux the default way is to parse /proc/cpuinfo which contains this information for x86 machines but (at least) not for AArch64 and Power architectures. Fortunately, there is a different code path which is able to get that data from sysfs. The needed patch has landed in 2006 for Linux 2.6.16 which is safe to assume nowadays (even RHEL 5 had a kernel version derived from 2.6.18, and we are now at RHEL 7!). Differential Revision: https://reviews.llvm.org/D40357 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@320151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src/kmp_affinity.cpp')
-rw-r--r--runtime/src/kmp_affinity.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/src/kmp_affinity.cpp b/runtime/src/kmp_affinity.cpp
index c281397..d7a0eda 100644
--- a/runtime/src/kmp_affinity.cpp
+++ b/runtime/src/kmp_affinity.cpp
@@ -2030,7 +2030,7 @@ static int __kmp_affinity_create_cpuinfo_map(AddrUnsPair **address2os,
if (threadInfo[num_avail][osIdIndex] != UINT_MAX)
goto dup_field;
threadInfo[num_avail][osIdIndex] = val;
-#if KMP_OS_LINUX && USE_SYSFS_INFO
+#if KMP_OS_LINUX && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)
char path[256];
KMP_SNPRINTF(
path, sizeof(path),