Add new envirable KMP_TEAMS_THREAD_LIMIT
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Wed, 2 Aug 2017 20:04:45 +0000 (20:04 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Wed, 2 Aug 2017 20:04:45 +0000 (20:04 +0000)
commit4f90c82aecdb23539b2b2b4ab844017387153c6a
treee41020eb96ea872af250cdf49aa8d7ae93a1f5a5
parent0d7ac5f037f1b929e34ad3fb05471b09102f0520
Add new envirable KMP_TEAMS_THREAD_LIMIT

This change adds a new environment variable, KMP_TEAMS_THREAD_LIMIT, which is
used to set a new global variable, __kmp_teams_max_nth, which is checked when
determining the size and quantity of teams that will be created in the teams
construct. Specifically, it is a limit on the total number of threads in a given
teams construct. It differentiates the limits for the teams construct from the
limits for regular parallel regions (KMP_DEVICE_THREAD_LIMIT/__kmp_max_nth and
OMP_THREAD_LIMIT/__kmp_cg_max_nth). When each individual team is formed, it is
still subject to those limits. After the clauses to the teams construct are
parsed and calculated, we check to make sure we are within this limit, and if
not, reduce num_threads per team and/or number of teams, accordingly. The
default value is set to the number of available processors on the system.

Patch by Terry Wilmarth

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

llvm-svn: 309874
openmp/runtime/src/i18n/en_US.txt
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_global.cpp
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/kmp_settings.cpp