[all-commits] [llvm/llvm-project] c765d1: [OpenMP] Fix hidden helper + affinity

Jonathan Peyton via All-commits all-commits at lists.llvm.org
Tue May 11 06:55:52 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c765d140fe45906fb503d843acccf5838e775245
      https://github.com/llvm/llvm-project/commit/c765d140fe45906fb503d843acccf5838e775245
  Author: Peyton, Jonathan L <jonathan.l.peyton at intel.com>
  Date:   2021-05-11 (Tue, 11 May 2021)

  Changed paths:
    M openmp/runtime/src/kmp.h
    M openmp/runtime/src/kmp_affinity.cpp
    M openmp/runtime/src/kmp_runtime.cpp

  Log Message:
  -----------
  [OpenMP] Fix hidden helper + affinity

When KMP_AFFINITY is set, each worker thread's gtid value is used as an
index into the place list to determine the thread's placement. With hidden
helpers enabled, this gtid value is shifted down leading to unexpected
shifted thread placement. This patch restores the previous behavior by
adjusting the mask index to take the number of hidden helper threads
into account.

Hidden helper threads are given the full initial mask and do not
participate in any of the other affinity mechanisms (place partitioning,
balanced affinity). Their affinity is only printed for debug builds.

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




More information about the All-commits mailing list