[cfe-dev] Does Clang v5.0.0 OpenMP Implementation recognize OMP_PLACES=threads env variable?

Jonas Hahnfeld via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 27 02:46:34 PDT 2018


On 2018-09-20 19:56, Dawson, Mark via cfe-dev wrote:
> Clang v5.0.0 is stated to be based on OpenMP 3.1 and *SOME* 4.0. Did
> it pick up OpenMP 4.0’s introduction of the “OMP_PLACES=threads”
> environment variable?

Yes, the LLVM OpenMP runtime supports Thread Affinity as introduced by 
OpenMP 4.0. However one possible problem might be that the library can't 
determine your machine's hardware topology (mapping of OS processors to 
threads, cores, sockets...). This should work fine for x86_64 and PPC64 
on Linux and probably on Windows. Any other combination might require 
changes to the detection routines.

You can run your program with KMP_AFFINITY=verbose which should give 
enough details to understand what the library does. I'd experiment with 
setting the variables (OMP_PLACES, OMP_PROC_BIND) to different values 
and see what happens.

Hope this helps,
Jonas



More information about the cfe-dev mailing list