<?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 bug on ifc openmp with complex array in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/bug-on-ifc-openmp-with-complex-array/m-p/980228#M5713</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;P&gt;I found a big bug on ifc openmp compiler when using complex arrays. The simple following code runs serial but not with openmp. Placing comments on declaration of a variable and on a=(0.d0,1d0) and write(*,*) a(1,1) runs parallel correctly with openmp. I runned with a dual Xeon machine 3.06Ghz, with Linux redhat 9.0. ifc -openmp -o test test.f Used 2 threads with command setenv OMP_NUM_THREADS 2.&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;Arnaldo &lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;
&lt;BR /&gt;&lt;/P&gt;&lt;HR /&gt;
&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;program main&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;parameter(nx=512,np=512)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;implicit real*8 (A-H,O-Z)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;real*8 u(nx,np),f(nx,np)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;complex*16 a(nx,np)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;a=(0.d0,1.d0)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) 'passed 1'&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) a(1,1)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;!$omp parallel do private(xx,yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;do j = 1,nx&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;do i = 1,np&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;xx = -1.0 + dx * dble(i-1) ! -1 &amp;lt; x &amp;lt; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;yy = -1.0 + dy * dble(j-1) ! -1 &amp;lt; y &amp;lt; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;u(i,j) = 0.0&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;f(i,j) = -alpha *(1.0-xx*xx)*(1.0-yy*yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;amp; - 2.0*(1.0-xx*xx)-2.0*(1.0-yy*yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;enddo&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;enddo&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;!$omp end parallel &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;do&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) 'passed 2'&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;END&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Message Edited by MADhagabb on &lt;SPAN class="date_text"&gt;12-11-2003&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:15 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Nov 2003 01:00:46 GMT</pubDate>
    <dc:creator>gammal</dc:creator>
    <dc:date>2003-11-20T01:00:46Z</dc:date>
    <item>
      <title>bug on ifc openmp with complex array</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/bug-on-ifc-openmp-with-complex-array/m-p/980228#M5713</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;P&gt;I found a big bug on ifc openmp compiler when using complex arrays. The simple following code runs serial but not with openmp. Placing comments on declaration of a variable and on a=(0.d0,1d0) and write(*,*) a(1,1) runs parallel correctly with openmp. I runned with a dual Xeon machine 3.06Ghz, with Linux redhat 9.0. ifc -openmp -o test test.f Used 2 threads with command setenv OMP_NUM_THREADS 2.&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;Arnaldo &lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;
&lt;BR /&gt;&lt;/P&gt;&lt;HR /&gt;
&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;program main&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;parameter(nx=512,np=512)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;implicit real*8 (A-H,O-Z)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;real*8 u(nx,np),f(nx,np)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;complex*16 a(nx,np)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;a=(0.d0,1.d0)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) 'passed 1'&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) a(1,1)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;!$omp parallel do private(xx,yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;do j = 1,nx&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;do i = 1,np&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;xx = -1.0 + dx * dble(i-1) ! -1 &amp;lt; x &amp;lt; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;yy = -1.0 + dy * dble(j-1) ! -1 &amp;lt; y &amp;lt; 1&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;u(i,j) = 0.0&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;f(i,j) = -alpha *(1.0-xx*xx)*(1.0-yy*yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;amp; - 2.0*(1.0-xx*xx)-2.0*(1.0-yy*yy)&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;enddo&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;enddo&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;!$omp end parallel &lt;/FONT&gt;&lt;FONT face="Courier New"&gt;do&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;write(*,*) 'passed 2'&lt;/FONT&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;END&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Message Edited by MADhagabb on &lt;SPAN class="date_text"&gt;12-11-2003&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:15 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2003 01:00:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/bug-on-ifc-openmp-with-complex-array/m-p/980228#M5713</guid>
      <dc:creator>gammal</dc:creator>
      <dc:date>2003-11-20T01:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: bug on ifc openmp with complex array</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/bug-on-ifc-openmp-with-complex-array/m-p/980229#M5714</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;P&gt;Hi Arnaldo,&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;I reproduced the bug but I don't think it has anything to do with complex variables. The program is overflowing stack. Replace the complex*16 declaration with two real*8 arrays and the program still crashes, i.e.: &lt;/P&gt;&lt;PRE&gt;      real*8 u(nx,np), f(nx,np)
&lt;BR /&gt;!      complex*16 a(nx,np)
&lt;BR /&gt;      real*8 a(nx,np), b(nx,np)
&lt;BR /&gt;&lt;/PRE&gt;For some reason, the compiler is putting the arrays on the stack instead of the heap. The program works if you declare your arrays ALLOCATABLE, i.e.: &lt;PRE&gt;      real*8, allocatable :: u(:,:), f(:,:)
&lt;BR /&gt;      complex*16, allocatable :: a(:,:)
&lt;BR /&gt;      allocate (u(nx,np), f(nx,np), a(nx,np))
&lt;BR /&gt;&lt;/PRE&gt;
&lt;BR /&gt;&lt;P&gt;Dynamically allocated arrays go on the heap. Please submit this bug to &lt;A href="http://www.intel.com/software/products/support/#premier" target="_blank"&gt;Intel Premier Support&lt;/A&gt;.&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;Thanks,&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;Henry&lt;/P&gt;
&lt;BR /&gt;&lt;P&gt;Message Edited by MADhagabb on &lt;SPAN class="date_text"&gt;12-11-2003&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:16 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by MADhagabb on &lt;SPAN class="date_text"&gt;12-11-2003&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:17 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Nov 2003 05:09:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/bug-on-ifc-openmp-with-complex-array/m-p/980229#M5714</guid>
      <dc:creator>Henry_G_Intel</dc:creator>
      <dc:date>2003-11-20T05:09:01Z</dc:date>
    </item>
  </channel>
</rss>

