[Bug libgomp/113698] GNU OpenMP with OMP_PROC_BIND alters thread affinity in a way that negatively affects performance

2024-02-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113698

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |MOVED

--- Comment #5 from Andrew Pinski  ---
Moved and looks to be fixed

[Bug libgomp/113698] GNU OpenMP with OMP_PROC_BIND alters thread affinity in a way that negatively affects performance

2024-02-09 Thread kugan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113698

--- Comment #4 from kugan at gcc dot gnu.org ---
Thanks for looking into this. The main reason we ere seeing performance issue
turned out to be due to glibc malloc issue in
https://sourceware.org/bugzilla/show_bug.cgi?id=30945

[Bug libgomp/113698] GNU OpenMP with OMP_PROC_BIND alters thread affinity in a way that negatively affects performance

2024-02-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113698

--- Comment #3 from Jakub Jelinek  ---
You can use GOMP_CPU_AFFINITY or different setting of OMP_PROC_BIND together
with OMP_PLACES to bind the initial thread to different CPU.
While the OpenMP spec allows moving the initial thread from unspecified place
to the requested one only before the first active parallel region, doing that
there would add to the overhead of #pragma omp parallel and what exactly the
application wants is hard to guess, whether the allocations done in the initial
thread prior to the first parallel are meant for the initial thread or other
threads too.
And, if you just add an empty #pragma omp parallel at the start of main, then
OpenMP requires the thread to be bound there.
There are OpenMP allocators one can use and request specific thread binding for
the allocations, or perform the allocations from the threads.

[Bug libgomp/113698] GNU OpenMP with OMP_PROC_BIND alters thread affinity in a way that negatively affects performance

2024-01-31 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113698

--- Comment #2 from Andrew Pinski  ---
Actually I misread the testcase, because it looks like LLVM's libomp follows
the same as GCC's.

And it looks like the OpenMP spec is specific about that behavior too.

[Bug libgomp/113698] GNU OpenMP with OMP_PROC_BIND alters thread affinity in a way that negatively affects performance

2024-01-31 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113698

--- Comment #1 from Andrew Pinski  ---
https://www.openmp.org/spec-html/5.0/openmpse52.html

> Otherwise, the execution environment should not move OpenMP threads between 
> OpenMP places, thread affinity is enabled, and __the initial thread is bound 
> to the first place in the OpenMP place list prior to the first active 
> parallel region__.

Hmm. Maybe LLVM's libomp does not follow the openmp spec.