<?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 Compiler not detecting missing OMP4 declare target variable in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958483#M94133</link>
    <description>&lt;P&gt;Most of the time, the compiler will complain if a global variable used in an OMP4 target region is not declared for the target (!$omp declare targt(foo))&lt;/P&gt;

&lt;P&gt;But now I had a (very big) program that compiled without errors (finally after fixing all the missing declares) but failed at runtime with the message:&lt;/P&gt;

&lt;P&gt;On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/56338/load_lib/ifortoutfGrs7D: undefined symbol: control_parameters_mp_surface_pressure_&lt;BR /&gt;
	On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/56338/load_lib/ifortoutfGrs7D: undefined symbol: control_parameters_mp_surface_pressure_"&lt;BR /&gt;
	offload error: cannot load library to the device 0 (error code 20)&lt;/P&gt;

&lt;P&gt;Investigating the code, I found that in module "control_parameters" a real variable "surface_pressure" was declared and used inside a target region. Nothing special there, just omp target, parallel do and do simd. However the compiler did not detect it.&lt;/P&gt;

&lt;P&gt;How is this possible? "Just" a bug in the compiler or are there (documented) circumstances where this might not work?&lt;BR /&gt;
	I cannot post the code itself, as it is part of the SPEC ACCEL suite and reducing it is hard due to the code consisting of ~160 files and in most of them, it detects the missing declare (even same module and/or same target region)&lt;/P&gt;</description>
    <pubDate>Mon, 24 Mar 2014 18:01:08 GMT</pubDate>
    <dc:creator>Grund__Aalexander</dc:creator>
    <dc:date>2014-03-24T18:01:08Z</dc:date>
    <item>
      <title>Compiler not detecting missing OMP4 declare target variable</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958483#M94133</link>
      <description>&lt;P&gt;Most of the time, the compiler will complain if a global variable used in an OMP4 target region is not declared for the target (!$omp declare targt(foo))&lt;/P&gt;

&lt;P&gt;But now I had a (very big) program that compiled without errors (finally after fixing all the missing declares) but failed at runtime with the message:&lt;/P&gt;

&lt;P&gt;On the remote process, dlopen() failed. The error message sent back from the sink is /tmp/coi_procs/1/56338/load_lib/ifortoutfGrs7D: undefined symbol: control_parameters_mp_surface_pressure_&lt;BR /&gt;
	On the sink, dlopen() returned NULL. The result of dlerror() is "/tmp/coi_procs/1/56338/load_lib/ifortoutfGrs7D: undefined symbol: control_parameters_mp_surface_pressure_"&lt;BR /&gt;
	offload error: cannot load library to the device 0 (error code 20)&lt;/P&gt;

&lt;P&gt;Investigating the code, I found that in module "control_parameters" a real variable "surface_pressure" was declared and used inside a target region. Nothing special there, just omp target, parallel do and do simd. However the compiler did not detect it.&lt;/P&gt;

&lt;P&gt;How is this possible? "Just" a bug in the compiler or are there (documented) circumstances where this might not work?&lt;BR /&gt;
	I cannot post the code itself, as it is part of the SPEC ACCEL suite and reducing it is hard due to the code consisting of ~160 files and in most of them, it detects the missing declare (even same module and/or same target region)&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 18:01:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958483#M94133</guid>
      <dc:creator>Grund__Aalexander</dc:creator>
      <dc:date>2014-03-24T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Some bugs appear to be fixed</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958484#M94134</link>
      <description>&lt;P&gt;Some bugs appear to be fixed in ifort 14.0 update 2, where a target data declaration in the same application with target map previously produced such a dlopen() error, with the data symbol apparently interpreted as a function reference.&lt;/P&gt;

&lt;P&gt;I didn't see how many moderately large applications could avoid running into this situation, which could come about without the source code being apparently&amp;nbsp;at fault.&lt;/P&gt;

&lt;P&gt;This seems not be the same situation as you describe (a shared variable not being covered by your target syntax but not flagged as an error?) but the end effect looks similar.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 20:16:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958484#M94134</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-03-24T20:16:01Z</dc:date>
    </item>
    <item>
      <title>I am using ifort 14.0.2.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958485#M94135</link>
      <description>&lt;P&gt;I am using ifort 14.0.2.&lt;/P&gt;

&lt;P&gt;Setup is like this:&lt;BR /&gt;
	Module "control_parameters" with the variable in question listed as a real (among other definitions)&lt;BR /&gt;
	Program enters main data region in finction fooFunc of module foo (omp target data map(...)) and calls the function barFunc in module bar.&lt;BR /&gt;
	In barFunc I have something like:&lt;BR /&gt;
	[fortran]&lt;BR /&gt;
	!$omp target&lt;BR /&gt;
	!$omp parallel do&lt;BR /&gt;
	do i=0,x&lt;BR /&gt;
	!$omp simd&lt;BR /&gt;
	do j=0,y&lt;BR /&gt;
	newValue=someArray(i,j)*(someReal - surface_pressure)&lt;BR /&gt;
	!...&lt;BR /&gt;
	end do&lt;BR /&gt;
	end do&lt;BR /&gt;
	!$omp end target&lt;BR /&gt;
	[/fortran]&lt;/P&gt;

&lt;P&gt;I cannot provide full source in public, but it is possible to send it to Intel, if they are interested.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 21:09:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958485#M94135</guid>
      <dc:creator>Grund__Aalexander</dc:creator>
      <dc:date>2014-03-24T21:09:48Z</dc:date>
    </item>
    <item>
      <title>Hello Alexander,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958486#M94136</link>
      <description>&lt;P&gt;Hello Alexander,&lt;/P&gt;

&lt;P&gt;Yes, we are interested.&amp;nbsp; Can you file a Intel Premier support issue and attach your source code?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Tue, 25 Mar 2014 15:00:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958486#M94136</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2014-03-25T15:00:31Z</dc:date>
    </item>
    <item>
      <title>ifort-14.0.2 should have</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958487#M94137</link>
      <description>&lt;P&gt;ifort-14.0.2 should have detected that surface_pressure was not listed as '!$omp declare target' and produced error #8663, eg:&lt;/P&gt;

&lt;P&gt;error #8663: A global variable used in an OpenMP* TARGET region must have the DECLARE TARGET attribute. &amp;nbsp; [SURFACE_PRESSURE]&lt;/P&gt;

&lt;P&gt;This has been reported to the developers a defect #DPD200254915.&amp;nbsp; I'll keep this thread updates with the progress to repair.&lt;/P&gt;

&lt;P&gt;A development compiler does produce a comp fail, but that's not any easier to debug than the runtime error:&lt;/P&gt;

&lt;P&gt;/tmp/ifortMICkURAPG: In function `L_prandtl_fluxes__359__par_region18_2_19':&lt;BR /&gt;
	/pbkenned/ISN_Forums/U508218/intelerror2/prandtl_fluxes.F90:360: undefined reference to `control_parameters_mp_surface_pressure_'&lt;BR /&gt;
	/pbkenned/ISN_Forums/U508218/intelerror2/prandtl_fluxes.F90:360: undefined reference to `control_parameters_mp_surface_pressure_'&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Patrick&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 15:35:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958487#M94137</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2014-03-27T15:35:49Z</dc:date>
    </item>
    <item>
      <title>This issue is now fixed in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958488#M94138</link>
      <description>&lt;P&gt;This issue is now fixed in ifort 15.0 beta update #1, aka Version 15.0.0.040 Beta Build 20140428.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The compiler will now&amp;nbsp;see that variable surface_pressure was not annotated with the DECLARE TARGET attribute:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;$ ifort -V&lt;BR /&gt;
	Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.040 Beta Build 20140428&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;$ ifort -openmp -g -O0 -fpp -DSPEC -D__nopointers -D__lc -free -extend-source 132 -c *.F90&lt;/P&gt;

&lt;P&gt;prandtl_fluxes.F90(374): error #8663: A global variable used in an OpenMP* TARGET region must have the DECLARE TARGET attribute.&amp;nbsp;&amp;nbsp; [SURFACE_PRESSURE]&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; q(k,j,i) = 0.622 * e_q / ( surface_pressure - e_q )&lt;BR /&gt;
	----------------------------------------------^&lt;BR /&gt;
	compilation aborted for prandtl_fluxes.F90 (code 1)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Patrick&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2014 20:58:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Compiler-not-detecting-missing-OMP4-declare-target-variable/m-p/958488#M94138</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2014-05-27T20:58:33Z</dc:date>
    </item>
  </channel>
</rss>

