[Openmp-commits] [PATCH] D101882: [OpenMP] Fix hidden helper + affinity assignment

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed May 5 06:24:41 PDT 2021


tianshilei1992 added a comment.

Thanks for helping with the issue! And thanks @ronlieb for testing.

In D101882#2738720 <https://reviews.llvm.org/D101882#2738720>, @protze.joachim wrote:

> @tianshilei1992 this patch is just another case, confirming my statement in D77609 <https://reviews.llvm.org/D77609>:
>
>> I think, the fundamental issue of this patch is, that it broke the implicit assumption, that entries in __kmp_threads are handed out contiguously.
>
> I wonder, whether it would improve the situation, if we move the hidden helper threads to `__kmp_threads[-8:-1]`, i.e., below the initial thread?

Yeah, that should be the most ideal way to do that. However, it doesn't work because negative gtids have special uses, e.g. for locks. We could not potentially set those special gtids to a very "large" negative value (or very small in math) because we don't know the maximum number of helper threads. Since helper thread is not part of spec, we could arguably set a maximum number, and move those special gtids out of this range, but the drawback is, if in the future, helper threads (or similar concept) is adopted to the spec, and if the spec doesn't set a maximum number (which I think is very possible), then we need to "redesign" again. That's why I chose to use the first few slots for helper thread, but didn't expect to break the affinity configuration. :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101882



More information about the Openmp-commits mailing list