<?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 Hello aketh, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996914#M28499</link>
    <description>&lt;P&gt;Hello aketh,&lt;/P&gt;

&lt;P&gt;Can you please clarify what are you trying to achieve. You mentioned you want to setup the openmp number of threads to 240 but you are not compiling with -openmp flag. &amp;nbsp;Can you please try the following:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testset
 
include 'omp_lib.h'
!dir$ offload begin target(mic)
        call omp_set_num_threads(240)
!dir$ end offload
 
!dir$ offload begin target(mic)
!$omp parallel
        print *,'The number of threads are',omp_get_num_threads()
!$omp end parallel
!dir$ end offload
 
end program testset
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Compile with&lt;/P&gt;

&lt;P&gt;ifort -openmp -o testSet testSet.f90&lt;/P&gt;

&lt;P&gt;and execute&lt;/P&gt;

&lt;P&gt;./testSet&lt;/P&gt;

&lt;P&gt;Let me know if you still do not see number of threads set to 240.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2015 18:29:36 GMT</pubDate>
    <dc:creator>Sunny_G_Intel</dc:creator>
    <dc:date>2015-05-18T18:29:36Z</dc:date>
    <item>
      <title>problem in setting threads at MIC</title>
      <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996912#M28497</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;

&lt;P&gt;This a program, I had written in fortran.&lt;/P&gt;

&lt;P&gt;!dir$ offload begin target(mic)&lt;BR /&gt;
	call omp_set_num_threads(240)&lt;BR /&gt;
	!dir$ end offload&lt;/P&gt;

&lt;P&gt;!dir$ offload begin target(mic)&lt;BR /&gt;
	!$omp parallel&lt;BR /&gt;
	print *,The number of threads are',omp_get_num_threads()&lt;BR /&gt;
	!$omp end parallel&lt;BR /&gt;
	!dir$ end offload&lt;/P&gt;

&lt;P&gt;However in the final output I still get&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The number of threads are 1&lt;/P&gt;

&lt;P&gt;why? How do I set more threads?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 10:56:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996912#M28497</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2015-05-11T10:56:00Z</dc:date>
    </item>
    <item>
      <title>I did not compile with</title>
      <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996913#M28498</link>
      <description>&lt;P&gt;I did not compile with -openmp option as well&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2015 11:00:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996913#M28498</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2015-05-11T11:00:47Z</dc:date>
    </item>
    <item>
      <title>Hello aketh,</title>
      <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996914#M28499</link>
      <description>&lt;P&gt;Hello aketh,&lt;/P&gt;

&lt;P&gt;Can you please clarify what are you trying to achieve. You mentioned you want to setup the openmp number of threads to 240 but you are not compiling with -openmp flag. &amp;nbsp;Can you please try the following:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testset
 
include 'omp_lib.h'
!dir$ offload begin target(mic)
        call omp_set_num_threads(240)
!dir$ end offload
 
!dir$ offload begin target(mic)
!$omp parallel
        print *,'The number of threads are',omp_get_num_threads()
!$omp end parallel
!dir$ end offload
 
end program testset
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Compile with&lt;/P&gt;

&lt;P&gt;ifort -openmp -o testSet testSet.f90&lt;/P&gt;

&lt;P&gt;and execute&lt;/P&gt;

&lt;P&gt;./testSet&lt;/P&gt;

&lt;P&gt;Let me know if you still do not see number of threads set to 240.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2015 18:29:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996914#M28499</guid>
      <dc:creator>Sunny_G_Intel</dc:creator>
      <dc:date>2015-05-18T18:29:36Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996915#M28500</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;It worked. thank you. what I meant was I forgot to use -openmp option.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 04:25:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996915#M28500</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2015-05-19T04:25:06Z</dc:date>
    </item>
    <item>
      <title>A slight side issue, but...</title>
      <link>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996916#M28501</link>
      <description>&lt;P&gt;A slight side issue, but... explicitly forcing 240 threads is a bad idea on multiple grounds.&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;In offload one core is heavily loaded by the system transferring data, and your code would be better not using it&lt;/LI&gt;
	&lt;LI&gt;Forcing the number of threads makes your code non-portable (what if you try to run it on a card with fewer cores?)&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The system uses sensible defaults, so until you really understand what you're doing, don't change them! (And, when you do, use the envirables (KMP_PLACE_THREADS, KMP_AFFINITY), don't hard-wire these things into your code).&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 09:31:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problem-in-setting-threads-at-MIC/m-p/996916#M28501</guid>
      <dc:creator>James_C_Intel2</dc:creator>
      <dc:date>2015-05-19T09:31:06Z</dc:date>
    </item>
  </channel>
</rss>

