[Openmp-commits] [PATCH] D58148: Make use of sched_yield optional in runtime

Terry Wilmarth via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 12 14:12:13 PST 2019


tlwilmar created this revision.
tlwilmar added reviewers: AndreyChurbanov, jlpeyton.
tlwilmar added a project: OpenMP.
Herald added subscribers: jdoerfert, jfb.

This patch cleans up the yielding code and makes it optional.  An environment variable, KMP_USE_YIELD, was added. Yielding is still on by default (KMP_USE_YIELD=1), but can be turned off completely (KMP_USE_YIELD=0), or turned on only when oversubscription is detected (KMP_USE_YIELD=2).  Note that oversubscription cannot always be detected by the runtime (for example, when the runtime is initialized and the process forks, oversubscription cannot be detected currently over multiple instances of the runtime).

Because yielding can be controlled by user now, the library mode settings (from KMP_LIBRARY) for throughput and turnaround have been adjusted by altering blocktime, unless that was also explicitly set.

In the original code, there were a number of places where a double yield might have been done under oversubscription. This version checks oversubscription and if that's not going to yield, then it does the spin check.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D58148

Files:
  runtime/src/dllexports
  runtime/src/exports_so.txt
  runtime/src/kmp.h
  runtime/src/kmp_csupport.cpp
  runtime/src/kmp_dispatch.cpp
  runtime/src/kmp_dispatch.h
  runtime/src/kmp_dispatch_hier.h
  runtime/src/kmp_global.cpp
  runtime/src/kmp_itt.h
  runtime/src/kmp_lock.cpp
  runtime/src/kmp_lock.h
  runtime/src/kmp_os.h
  runtime/src/kmp_runtime.cpp
  runtime/src/kmp_settings.cpp
  runtime/src/kmp_tasking.cpp
  runtime/src/kmp_taskq.cpp
  runtime/src/kmp_wait_release.h
  runtime/src/z_Linux_util.cpp
  runtime/src/z_Windows_NT_util.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58148.186540.patch
Type: text/x-patch
Size: 51678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190212/8a47496a/attachment-0001.bin>


More information about the Openmp-commits mailing list