<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic new KMP_PLACE_THREADS OpenMP affinity variable in Update 2 compiler in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/new-KMP-PLACE-THREADS-OpenMP-affinity-variable-in-Update-2/m-p/946007#M18294</link>
    <description>&lt;P&gt;Are you using OpenMP with the Intel Composer XE 2013 Update 2 for Intel(R) Xeon Phi Coprocessors?&lt;/P&gt;
&lt;P&gt;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 (13.1.0.146)? It was in the Release Notes for Composer XE 2013 Update 2, so surely you read it there. :)&lt;/P&gt;
&lt;P&gt;If you did hear about KMP_PLACE_THREADS, also keep in mind&lt;STRONG&gt; IT DOES NOT REPLACE KMP_AFFINITY&lt;/STRONG&gt;, rather, it &lt;STRONG&gt;WORKS WITH KMP_AFFINITY&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;With KMP_PLACE_THREADS you can easily control thread placement for most common usages WITHOUT resorting to a ghastly EXPLICIT KMP_AFFINITY list.&amp;nbsp; Here's an example stolen from our extensive article on &lt;A href="http://software.intel.com/en-us/articles/openmp-thread-affinity-control"&gt;OpenMP Thread affinity&lt;/A&gt;, part of our &lt;A href="http://software.intel.com/en-us/articles/programming-and-compiling-for-intel-many-integrated-core-architecture"&gt;Compiler Methodology masterwork&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;example:&amp;nbsp; If we have a 61 core Phi, we decide to use 60 cores for an application, all 4 threads per core.&amp;nbsp; The application is an offload application on the host with 2 processes.&amp;nbsp; We want to use cores 0..29 for process 1.&amp;nbsp; We want to use cores 30..60 for process 2.&amp;nbsp; Here is an example of doing this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Process 1 offload environment var setup:&amp;nbsp; &lt;BR /&gt;export MIC_ENV_PREFIX=PHI&lt;BR /&gt;export PHI_KMP_AFFINITY=compact&lt;BR /&gt;export PHI_KMP_PLACE_THREADS=30c,4t,0O&lt;BR /&gt;export PHI_OMP_NUM_THREADS=120&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Process 2 offload environment var setup:&amp;nbsp; &lt;BR /&gt;export MIC_ENV_PREFIX=PHI&lt;BR /&gt;export PHI_KMP_AFFINITY=compact&lt;BR /&gt;export PHI_KMP_PLACE_THREADS=30c,4t,30O&lt;BR /&gt;export PHI_OMP_NUM_THREADS=120&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This is how Offset can be used to effectively partition the Phi cores and prevent processes from colliding on the same cores.&amp;nbsp; If you've tried to do something similar with explicit lists and KMP_AFFINITY you will appreciate the simplicity of this new solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember, KMP_PLACE_THREADS is only available in Composer XE 2013 Update 2 (Version 13.1.0.146 Build 20130121) and newer.&amp;nbsp; It is not present in older compilers.&amp;nbsp; This variable only affects the OpenMP runtime for Phi, either native or offload.&lt;/P&gt;
&lt;P&gt;For all the details, visit the full article on &lt;A href="http://software.intel.com/en-us/articles/openmp-thread-affinity-control"&gt;OpenMP Thread Affinity&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;ron&lt;/P&gt;</description>
    <pubDate>Fri, 15 Feb 2013 22:08:10 GMT</pubDate>
    <dc:creator>Ron_Green</dc:creator>
    <dc:date>2013-02-15T22:08:10Z</dc:date>
    <item>
      <title>new KMP_PLACE_THREADS OpenMP affinity variable in Update 2 compiler</title>
      <link>https://community.intel.com/t5/Software-Archive/new-KMP-PLACE-THREADS-OpenMP-affinity-variable-in-Update-2/m-p/946007#M18294</link>
      <description>&lt;P&gt;Are you using OpenMP with the Intel Composer XE 2013 Update 2 for Intel(R) Xeon Phi Coprocessors?&lt;/P&gt;
&lt;P&gt;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 (13.1.0.146)? It was in the Release Notes for Composer XE 2013 Update 2, so surely you read it there. :)&lt;/P&gt;
&lt;P&gt;If you did hear about KMP_PLACE_THREADS, also keep in mind&lt;STRONG&gt; IT DOES NOT REPLACE KMP_AFFINITY&lt;/STRONG&gt;, rather, it &lt;STRONG&gt;WORKS WITH KMP_AFFINITY&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;With KMP_PLACE_THREADS you can easily control thread placement for most common usages WITHOUT resorting to a ghastly EXPLICIT KMP_AFFINITY list.&amp;nbsp; Here's an example stolen from our extensive article on &lt;A href="http://software.intel.com/en-us/articles/openmp-thread-affinity-control"&gt;OpenMP Thread affinity&lt;/A&gt;, part of our &lt;A href="http://software.intel.com/en-us/articles/programming-and-compiling-for-intel-many-integrated-core-architecture"&gt;Compiler Methodology masterwork&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;example:&amp;nbsp; If we have a 61 core Phi, we decide to use 60 cores for an application, all 4 threads per core.&amp;nbsp; The application is an offload application on the host with 2 processes.&amp;nbsp; We want to use cores 0..29 for process 1.&amp;nbsp; We want to use cores 30..60 for process 2.&amp;nbsp; Here is an example of doing this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Process 1 offload environment var setup:&amp;nbsp; &lt;BR /&gt;export MIC_ENV_PREFIX=PHI&lt;BR /&gt;export PHI_KMP_AFFINITY=compact&lt;BR /&gt;export PHI_KMP_PLACE_THREADS=30c,4t,0O&lt;BR /&gt;export PHI_OMP_NUM_THREADS=120&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Process 2 offload environment var setup:&amp;nbsp; &lt;BR /&gt;export MIC_ENV_PREFIX=PHI&lt;BR /&gt;export PHI_KMP_AFFINITY=compact&lt;BR /&gt;export PHI_KMP_PLACE_THREADS=30c,4t,30O&lt;BR /&gt;export PHI_OMP_NUM_THREADS=120&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This is how Offset can be used to effectively partition the Phi cores and prevent processes from colliding on the same cores.&amp;nbsp; If you've tried to do something similar with explicit lists and KMP_AFFINITY you will appreciate the simplicity of this new solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember, KMP_PLACE_THREADS is only available in Composer XE 2013 Update 2 (Version 13.1.0.146 Build 20130121) and newer.&amp;nbsp; It is not present in older compilers.&amp;nbsp; This variable only affects the OpenMP runtime for Phi, either native or offload.&lt;/P&gt;
&lt;P&gt;For all the details, visit the full article on &lt;A href="http://software.intel.com/en-us/articles/openmp-thread-affinity-control"&gt;OpenMP Thread Affinity&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;ron&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2013 22:08:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/new-KMP-PLACE-THREADS-OpenMP-affinity-variable-in-Update-2/m-p/946007#M18294</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2013-02-15T22:08:10Z</dc:date>
    </item>
  </channel>
</rss>

