Fix implementation of OMP_THREAD_LIMIT
authorJonathan Peyton <jonathan.l.peyton@intel.com>
Thu, 27 Jul 2017 20:58:41 +0000 (20:58 +0000)
committerJonathan Peyton <jonathan.l.peyton@intel.com>
Thu, 27 Jul 2017 20:58:41 +0000 (20:58 +0000)
commitf43924632871052939f47b62b2482e720bab2205
treeb4f1aee05d041c71d96b3e9c3adad8d7b5f9e06c
parent1bf535daae78809c73efc9643921c78334184dfc
Fix implementation of OMP_THREAD_LIMIT

This change fixes the implementation of OMP_THREAD_LIMIT. The implementation of
this previously was not restricted to a contention group (but it should be,
according to the spec), and this is fixed here. A field is added to root thread
to store a counter of the threads in the contention group. An extra check is
added when reserving threads for a parallel region that checks this variable and
compares to threadlimit-var, which is implemented as a new global variable,
kmp_cg_max_nth. Associated settings changes were also made, and clean up of
comments that referred to OMP_THREAD_LIMIT, but should refer to the new
KMP_DEVICE_THREAD_LIMIT (added in an earlier patch).

Patch by Terry Wilmarth

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

llvm-svn: 309319
openmp/runtime/src/i18n/en_US.txt
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_ftn_entry.h
openmp/runtime/src/kmp_global.cpp
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/kmp_settings.cpp
openmp/runtime/test/env/omp_thread_limit.c [new file with mode: 0644]