I'm currently dealing with some benchmarks that are highly dependent on OpenMP settings. I noticed that the results can vary greatly from setting values for variables such as OMP_PLACES OMP_PROC_BIND I would really like to get a reliable source of information on such variables, because now I find them in different parts of the Internet without a clear explanation of their role.
2 Answers
I would really like to get a reliable source of information on such variables, because now I find them in different parts of the Internet without a clear explanation of their role.
All of the OpenMP environment variables and associated internal control variables are described in the OpenMP standard, which you can find here.
In the latest standard (OpenMP 6.0) Internal Control Variables are described in chapter 3, Environment Variables in chapter 4.
Since this is the standard, it is the definitive reference for this information.
If you are investigating the binding of threads to hardware locations (as it seems you are), then it is also worth getting a copy of hwloc, so that you can understand which resources your hardware is providing.
Comments
Rule of thumb: OMP_PROC_BIND=true and OMP_PLACES=cores. That's good enough for most applications: it tells the OS not to migrate your threads, which evens the load and prevents multiple threads from winding up on the same core.
Longer explanation: https://theartofhpc.com/pcse/omp-affinity.html
Btw your question is in danger of being closed for being non-specific. Can you isolate the parts of your benchmark (or post the whole if not too long) that shows the variable-dependent behavior?