<?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 The problem is omp_get_num in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015547#M35938</link>
    <description>&lt;P&gt;The problem is omp_get_num_devices().&amp;nbsp; Using this triggers compilation for the target.&amp;nbsp; We have a bug failed against this which we will address so when -qno-openmp-offload&amp;nbsp; is used and have omp_get_num_devices() in the code we will not trigger target compilation.&lt;/P&gt;

&lt;P&gt;For now try this&lt;/P&gt;

&lt;P&gt;#ifdef NOCARD&lt;BR /&gt;
	#define OMP_GET_NUM_DEVICES&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;
	#else&lt;BR /&gt;
	#define OMP_GET_NUM_DEVICES omp_get_num_devices()&lt;BR /&gt;
	#endif&lt;/P&gt;

&lt;P&gt;and in your code&lt;/P&gt;

&lt;P&gt;fprintf(stderr, "&amp;nbsp; max_threads = %d\n", OMP_GET_NUM_DEVICES);&lt;/P&gt;

&lt;P&gt;when compiling in environment where MPSS is not installed -DNOCARD -qno-openmp-offload -qopenmp&lt;/P&gt;

&lt;P&gt;Ravi&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2015 19:07:30 GMT</pubDate>
    <dc:creator>Ravi_N_Intel</dc:creator>
    <dc:date>2015-07-17T19:07:30Z</dc:date>
    <item>
      <title>How to protect code from triggering MIC build on non-MIC nodes</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015541#M35932</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
	we have two clusters in-house, one with MIC cards and another without. When we build code with OpenMP 4.x pragmas or functions for devices, we get a compilation error on the cluster without MIC cards:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;icc: warning #10362: Environment configuration problem encountered.
Please check for proper MPSS installation and environment setup.
testomp.c(1): catastrophic error: *MIC* cannot open source file "stdio.h"
   #include &amp;lt;stdio.h&amp;gt; &lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;This happens with Intel icc 14.0.3 and 15.0.2. The problem with stdio.h is just an example of missing headers, other compilations fail for different reasons because the MPSS is not installed on the non-MIC cluster. Both clusters use Linux, RHEL6 in the non-MIC, CentOS 6 in the MIC case.&lt;/P&gt;

&lt;P&gt;What #ifdefs need to be in place to build the same code on the non-MIC cluster as well as the MIC cluster?&lt;/P&gt;

&lt;P&gt;Perhaps I should add: the code portions triggering the error are already protected by&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;#if _OPENMP &amp;gt;= 201307

#endif&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards, Thomas&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 11:26:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015541#M35932</guid>
      <dc:creator>tjahns</dc:creator>
      <dc:date>2015-07-17T11:26:30Z</dc:date>
    </item>
    <item>
      <title>This may not require any</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015542#M35933</link>
      <description>&lt;P&gt;This may not require any special #ifdef's. Can you try compiling on the cluster without Xeon Phi cards using: &lt;STRONG&gt;-qno-openmp-offload&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;This disables the OpenMP 4.x offload compilation; there is more information &lt;A href="https://software.intel.com/en-us/node/522963" target="_blank"&gt;here &lt;/A&gt;in the C++ UG. This option was first introduced in 15.0 with initial support for OpenMP 4.x offloading. It would not be available in 14.x but then neither is the OpenMP 4.x offloading support.&lt;/P&gt;

&lt;P&gt;When using the Intel Language Extensions for Offload, there is a similar variant available of: &lt;STRONG&gt;-qno-offload&lt;/STRONG&gt;&amp;nbsp; described in the UG &lt;A href="https://software.intel.com/en-us/node/522799" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 13:34:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015542#M35933</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-07-17T13:34:19Z</dc:date>
    </item>
    <item>
      <title>I stand corrected. This</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015543#M35934</link>
      <description>&lt;P&gt;I stand corrected. This option was available in 14.x so perhaps if it delivers the functionality you need then it would be usable with 14.x also. Sorry for the confusion.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 13:53:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015543#M35934</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-07-17T13:53:15Z</dc:date>
    </item>
    <item>
      <title>Unfortunately, no-offload</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015544#M35935</link>
      <description>&lt;P&gt;Unfortunately, no-offload doesn't seem to make a difference:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;$ icc -O2 -qno-offload -fopenmp testomp.c 
icc: warning #10362: Environment configuration problem encountered.  Please check for proper MPSS installation and environment setup.
testomp.c(1): catastrophic error: *MIC* cannot open source file "stdio.h"
  #include &amp;lt;stdio.h&amp;gt;
                    ^

compilation aborted for testomp.c (code 4)
&lt;/PRE&gt;

&lt;P&gt;I'd like to post the code here, but even when it's trivial I'll need to get permission from the author first, who is going to be around again on Monday.&lt;/P&gt;

&lt;P&gt;Regards, Thomas&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 14:08:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015544#M35935</guid>
      <dc:creator>tjahns</dc:creator>
      <dc:date>2015-07-17T14:08:04Z</dc:date>
    </item>
    <item>
      <title>The -no-offload (-qno-offload</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015545#M35936</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;-no-offload&lt;/STRONG&gt; (&lt;STRONG&gt;-qno-offload&lt;/STRONG&gt; in 15.x and later) option will only apply when using Intel's offload language extensions. If you are using the OpenMP 4.x &lt;STRONG&gt;TARGET &lt;/STRONG&gt;device constructs then use the OpenMP specific form of the option: &lt;STRONG&gt;-qno-openmp-offload&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;It should work from what I'm seeing.&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;$ icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.5.212 Build 20150212
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

$ icc -c t2.c -fopenmp -openmp-offload
icc: warning #10362: Environment configuration problem encountered.  Please check for proper MPSS installation and environment setup.

$ icc -c t2.c -fopenmp -no-openmp-offload
t2.c(8): warning #3180: unrecognized OpenMP #pragma
  #pragma omp target
          ^
&lt;/PRE&gt;

&lt;P&gt;Note the 14.x compiler had not adopted the leading "q" in the option. That came in 15.x and later.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 14:43:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015545#M35936</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-07-17T14:43:33Z</dc:date>
    </item>
    <item>
      <title>That still doesn't work for</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015546#M35937</link>
      <description>&lt;P&gt;That still doesn't work for the test program I have here:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;$ icc -O2 -qno-offload -fopenmp testomp.c 
icc: warning #10362: Environment configuration problem encountered.  Please check for proper MPSS installation and environment setup.
testomp.c(1): catastrophic error: *MIC* cannot open source file "stdio.h"
  #include &amp;lt;stdio.h&amp;gt;
                    ^

compilation aborted for testomp.c (code 4)
&lt;/PRE&gt;

&lt;P&gt;The program is simple, please see the uploaded attachment. &lt;STRONG&gt;omp_get_num_devices()&lt;/STRONG&gt; seems to have a different effect on the compiler than having a target construct.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:47:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015546#M35937</guid>
      <dc:creator>tjahns</dc:creator>
      <dc:date>2015-07-17T18:47:27Z</dc:date>
    </item>
    <item>
      <title>The problem is omp_get_num</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015547#M35938</link>
      <description>&lt;P&gt;The problem is omp_get_num_devices().&amp;nbsp; Using this triggers compilation for the target.&amp;nbsp; We have a bug failed against this which we will address so when -qno-openmp-offload&amp;nbsp; is used and have omp_get_num_devices() in the code we will not trigger target compilation.&lt;/P&gt;

&lt;P&gt;For now try this&lt;/P&gt;

&lt;P&gt;#ifdef NOCARD&lt;BR /&gt;
	#define OMP_GET_NUM_DEVICES&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;
	#else&lt;BR /&gt;
	#define OMP_GET_NUM_DEVICES omp_get_num_devices()&lt;BR /&gt;
	#endif&lt;/P&gt;

&lt;P&gt;and in your code&lt;/P&gt;

&lt;P&gt;fprintf(stderr, "&amp;nbsp; max_threads = %d\n", OMP_GET_NUM_DEVICES);&lt;/P&gt;

&lt;P&gt;when compiling in environment where MPSS is not installed -DNOCARD -qno-openmp-offload -qopenmp&lt;/P&gt;

&lt;P&gt;Ravi&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:07:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015547#M35938</guid>
      <dc:creator>Ravi_N_Intel</dc:creator>
      <dc:date>2015-07-17T19:07:30Z</dc:date>
    </item>
    <item>
      <title>Thank you for the example.</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015548#M35939</link>
      <description>&lt;P&gt;Thank you for the example. This looks like a compiler defect. &lt;STRONG&gt;omp_get_num_devices()&lt;/STRONG&gt; is a host-side routine so I would not expect it to trigger the target compilation which it what happens and leads to the error.&lt;/P&gt;

&lt;P&gt;This was reported earlier to Development (see internal tracking id below).&lt;/P&gt;

&lt;P&gt;(Internal tracking id: DPD200364738)&lt;/P&gt;

&lt;P&gt;&amp;lt;Updated&amp;gt; As Ravi noted, this was reported earlier and we will have this fixed in a future release.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-protect-code-from-triggering-MIC-build-on-non-MIC-nodes/m-p/1015548#M35939</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-07-17T19:10:00Z</dc:date>
    </item>
  </channel>
</rss>

