[OpenMP] libomp: fix dynamic loop dispatcher
authorAndreyChurbanov <andrey.churbanov@intel.com>
Tue, 22 Jun 2021 13:29:01 +0000 (16:29 +0300)
committerAndreyChurbanov <andrey.churbanov@intel.com>
Tue, 22 Jun 2021 13:29:01 +0000 (16:29 +0300)
commit5dd4d0d46fb892975bbb3a086da5a3a9996ced4d
tree70d96d5a140540fdc3d91e5bc266ca2179c9196f
parent82c1fb575034f81f861a299d8280a5668854a2bc
[OpenMP] libomp: fix dynamic loop dispatcher

Restructured dynamic loop dispatcher code.
Fixed use of dispatch buffers for nonmonotonic dynamic (static_steal) schedule:
- eliminated possibility of stealing iterations of the wrong loop when victim
  thread changed its buffer to work on another loop;
- fixed race when victim thread changed its buffer to work in nested parallel;
- eliminated "static" property of the schedule, that is now a single thread can
  execute whole loop.

Differential Revision: https://reviews.llvm.org/D103648
openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_dispatch.cpp
openmp/runtime/src/kmp_dispatch.h
openmp/runtime/src/kmp_dispatch_hier.h
openmp/runtime/src/kmp_settings.cpp
openmp/runtime/test/env/kmp_set_dispatch_buf.c
openmp/runtime/test/worksharing/for/kmp_set_dispatch_buf.c
openmp/runtime/test/worksharing/for/omp_for_schedule_runtime.c
openmp/runtime/test/worksharing/for/omp_par_in_loop.c [new file with mode: 0644]