llvm-project/openmp/runtime/test
Shilei Tian 9d64275ae0 [OpenMP] Added the support for hidden helper task in RTL
The basic design is to create an outer-most parallel team. It is not a regular team because it is only created when the first hidden helper task is encountered, and is only responsible for the execution of hidden helper tasks.  We first use `pthread_create` to create a new thread, let's call it the initial and also the main thread of the hidden helper team. This initial thread then initializes a new root, just like what RTL does in initialization. After that, it directly calls `__kmpc_fork_call`. It is like the initial thread encounters a parallel region. The wrapped function for this team is, for main thread, which is the initial thread that we create via `pthread_create` on Linux, waits on a condition variable. The condition variable can only be signaled when RTL is being destroyed. For other work threads, they just do nothing. The reason that main thread needs to wait there is, in current implementation, once the main thread finishes the wrapped function of this team, it starts to free the team which is not what we want.

Two environment variables, `LIBOMP_NUM_HIDDEN_HELPER_THREADS` and `LIBOMP_USE_HIDDEN_HELPER_TASK`, are also set to configure the number of threads and enable/disable this feature. By default, the number of hidden helper threads is 8.

Here are some open issues to be discussed:
1. The main thread goes to sleeping when the initialization is finished. As Andrey mentioned, we might need it to be awaken from time to time to do some stuffs. What kind of update/check should be put here?

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D77609
2021-01-25 22:16:17 -05:00
..
affinity [OpenMP] Fixed a bug when displaying affinity 2020-11-12 22:27:32 -05:00
api [OpenMP][NFC] Fix test 2021-01-19 00:05:34 +03:00
atomic
barrier [OpenMP] Fix hierarchical barrier 2021-01-13 10:22:57 -06:00
critical
env [OpenMP] libomp: cleanup parsing of OMP_ALLOCATOR env variable. 2021-01-19 16:21:22 +03:00
flush Fix for bugzilla https://bugs.llvm.org/show_bug.cgi?id=39970 2018-12-13 10:04:10 +00:00
lock [OpenMP] NFC: Fix trivial typo 2020-04-04 12:06:54 +09:00
master
misc_bugs [OpenMP][Tests] Fix compiler warnings in OpenMP runtime tests 2020-11-11 20:13:21 +01:00
ompt [OpenMP][OMPT] Make sure that 0 is never used as ID in tests (NFC) 2020-12-04 18:41:56 +01:00
parallel [OpenMP 5.0] Add omp_get_supported_active_levels() 2019-02-19 18:51:11 +00:00
tasking [OpenMP] Added the support for hidden helper task in RTL 2021-01-25 22:16:17 -05:00
teams [OpenMP] Introduce GOMP teams support in runtime 2020-09-24 09:45:13 -05:00
threadprivate [OpenMP] NFC: Fix trivial typos in comments 2020-01-07 14:05:03 +08:00
worksharing [OpenMP] Added the support for hidden helper task in RTL 2021-01-25 22:16:17 -05:00
CMakeLists.txt [OpenMP][Tool] Extend reuse of OMPT testing 2020-06-14 15:55:32 +02:00
lit.cfg [OpenMP][Tests][NFC] Use FileCheck from cmake config 2020-11-30 23:16:56 +01:00
lit.site.cfg.in [OpenMP] Add scaffolding for negative runtime tests 2020-04-21 17:10:50 -04:00
omp_my_sleep.h
omp_testsuite.h