[Openmp-commits] [openmp] [OpenMP] Fix hyper barrier performance issue (PR #195473)

Kim Walisch via Openmp-commits openmp-commits at lists.llvm.org
Fri May 8 11:55:44 PDT 2026


kimwalisch wrote:

> Hmmm, my reply from yesterday seems to have disappeared. Trying again...
> 
> Another possible reason for the different performance could be related to the library execution mode in use. LLVM OMP's implementation of wait-policy has two aspects to it: blocktime (0 for passive; infinite for active), and library execution mode (throughput for passive; turnaround for active). The throughput setting is the default, and it means that threads will yield while spinning so that other work can be done. The turnaround setting does not yield. So you might try setting it to turnaround and seeing how your application does with that. See also KMP_USE_YIELD, which lets you also use yielding only in oversubscription cases.
> 
> I don't know how GOMP implements wait-policy, so it could be that by default it yields less even when the wait policy is passive.

I have now added the workaround you and @jprotze suggested by setting `kmp_set_defaults("OMP_WAIT_POLICY=ACTIVE");` in the primecount command-line app: https://github.com/kimwalisch/primecount/pull/117.

I do care about LLVM OpenMP and while it is good that it is configurable for specific use cases it would be even better if it scaled well on many-core systems by default. I do think that GCC OpenMP currently has better default settings for many-core systems.

Since I have now fixed this perfomance issue in my application, I close this pull request and the related issue.

Have a nice weekend!

https://github.com/llvm/llvm-project/pull/195473


More information about the Openmp-commits mailing list