[Openmp-commits] [PATCH] D132005: Add non-blocking support for target nowait regions

Guilherme Valarini via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 17 15:59:02 PDT 2022


gValarini added a comment.

In D132005#3727803 <https://reviews.llvm.org/D132005#3727803>, @ye-luo wrote:

> Existing target nowait implementation doesn't distinguish using helper tasks or not. Setting LIBOMP_USE_HIDDEN_HELPER_TASK=0 dispatchs target tasks as regular tasks. As long as there are available OpenMP threads, these tasks can still run concurrently and gain asynchronicity although this scheme has the issue of active waiting and consuming host thread resource. I think this is the same issue you are trying to address in helper tasks.

You have a good point. I thought you were talking about using the re-enqueueing scheme with the normal OpenMP tasks regions.

> Your scheme of splitting target tasks doesn't seem necessary tied to helper tasks. Do you have a a specific reason restricting this feature to only target tasks?

There was no specific reason to limit that to hidden helper tasks. I have updated the code so it can also work when `LIBOMP_USE_HIDDEN_HELPER_TASK=0`. Here is the new implemented behavior:

- HHT enabled: `target nowait` regions **will use** the new non-blocking synchronization scheme, and tasks will be re-enqueued/pushed to other **hidden helper threads**.
- HHT disabled / Task **with** a task team: `target nowait` regions **will use** the new non-blocking synchronization scheme, and tasks will be re-enqueued/pushed to others the other **OpenMP threads** of the same tasking team. E.g., when a `target nowait` is created inside a parallel region.
- HHT disabled /Task **without** a task team: target nowait regions **will not use** the new non-blocking synchronization scheme. Synchronization will be done in a blocking manner as before, respecting the case where the target task is serialized. E.g., when a `target nowait` is created outside any parallel region.

What do you think about this implementation?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132005/new/

https://reviews.llvm.org/D132005



More information about the Openmp-commits mailing list