[Openmp-commits] [PATCH] D22365: Make balanced affinity work on AArch64 (and possibly other architectures too)

Andrey Churbanov via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 21 09:23:09 PDT 2016


AndreyChurbanov requested changes to this revision.
AndreyChurbanov added a comment.
This revision now requires changes to proceed.

The patch as it is does not work for the case of multi package non-uniform topology.

So this case should be either fixed or disabled.


================
Comment at: runtime/src/kmp_affinity.cpp:3994
@@ -3988,3 +3993,3 @@
             }
             int ncores = address2os[ __kmp_avail_proc - 1 ].first.labels[ core_level ] + 1;
             int nproc = nth_per_core * ncores;
----------------
This is number of cores in the last package, as the code supposed to be run on single package topology only.

================
Comment at: runtime/src/kmp_affinity.cpp:3995
@@ -3989,3 +3994,3 @@
             int ncores = address2os[ __kmp_avail_proc - 1 ].first.labels[ core_level ] + 1;
             int nproc = nth_per_core * ncores;
 
----------------
This code does not take into account number of packages (supposed to be run on single-package topology).

================
Comment at: runtime/src/kmp_affinity.cpp:4017
@@ -4011,3 +4016,3 @@
                 }
                 procarr[ core * nth_per_core + thread ] = proc;
             }
----------------
Here the memory gets overwritten when the last package has lesser number of cores than max available, because (core*nth_per_core+thread) can be bigger than nproc so that the write is out of array bound.

================
Comment at: runtime/src/kmp_affinity.cpp:4655
@@ -4621,3 +4654,3 @@
         // Number of cores - maximum value; it does not count trail cores with 0 processors
         int ncores = address2os[ __kmp_avail_proc - 1 ].first.labels[ core_level ] + 1;
 
----------------
This is the number of cores in the last package. Other packages are skipped (no threads bound there).


Repository:
  rL LLVM

https://reviews.llvm.org/D22365





More information about the Openmp-commits mailing list