new KMP_PLACE_THREADS OpenMP affinity variable in Update 2 compiler

Are you using OpenMP with the Intel Composer XE 2013 Update 2 for Intel(R) Xeon Phi Coprocessors?

Did you know there is a new environment variable to control thread affinity and topology on Phi in the Composer XE 2013 Update 2 compiler ( It was in the Release Notes for Composer XE 2013 Update 2, so surely you read it there. :)

If you did hear about KMP_PLACE_THREADS, also keep in mind IT DOES NOT REPLACE KMP_AFFINITY, rather, it WORKS WITH KMP_AFFINITY.

With KMP_PLACE_THREADS you can easily control thread placement for most common usages WITHOUT resorting to a ghastly EXPLICIT KMP_AFFINITY list.  Here's an example stolen from our extensive article on OpenMP Thread affinity, part of our Compiler Methodology masterwork:

example:  If we have a 61 core Phi, we decide to use 60 cores for an application, all 4 threads per core.  The application is an offload application on the host with 2 processes.  We want to use cores 0..29 for process 1.  We want to use cores 30..60 for process 2.  Here is an example of doing this:

  1. Process 1 offload environment var setup: 
    export PHI_KMP_AFFINITY=compact
    export PHI_KMP_PLACE_THREADS=30c,4t,0O
    export PHI_OMP_NUM_THREADS=120
  2. Process 2 offload environment var setup: 
    export PHI_KMP_AFFINITY=compact
    export PHI_KMP_PLACE_THREADS=30c,4t,30O
    export PHI_OMP_NUM_THREADS=120

This is how Offset can be used to effectively partition the Phi cores and prevent processes from colliding on the same cores.  If you've tried to do something similar with explicit lists and KMP_AFFINITY you will appreciate the simplicity of this new solution. 

Remember, KMP_PLACE_THREADS is only available in Composer XE 2013 Update 2 (Version Build 20130121) and newer.  It is not present in older compilers.  This variable only affects the OpenMP runtime for Phi, either native or offload.

For all the details, visit the full article on OpenMP Thread Affinity.

Thanks for reading!

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.