<?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 OpenMP and IPO in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764642#M19350</link>
    <description>Is NITS an integer parameter&lt;BR /&gt;Or an integer variable&lt;BR /&gt; If variable, can the compiler optimizer determine its value?&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
    <pubDate>Fri, 09 Mar 2012 23:09:12 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2012-03-09T23:09:12Z</dc:date>
    <item>
      <title>OpenMP and IPO</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764641#M19349</link>
      <description>I'm using MacOS 10.6.8 and Intel Fortran 11.1-046.

I have a code that looks like&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;real aa(MM,NITS)
&lt;BR /&gt;&lt;BR /&gt;
!$omp parallel do&lt;DIV&gt; do it = 1,NITS&lt;/DIV&gt;&lt;DIV&gt;  call mysub( aa(:,it) )&lt;/DIV&gt;&lt;DIV&gt; end do&lt;/DIV&gt;&lt;DIV&gt;!$omp end parallel do&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;It works great if NITS &amp;gt; 1 and I compile with -openmp -ipo.  Also works great with NITS = 1 and just -openmp.  Gives me nonsense for NITS = 1 and -openmp -ipo.  I suspect this is because IPO is removing the do loop and maybe OpenMP is trying to parallelize something in mysub.  Is this right?  If so, how do I stop it from happening?&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Mar 2012 22:26:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764641#M19349</guid>
      <dc:creator>briardew</dc:creator>
      <dc:date>2012-03-09T22:26:23Z</dc:date>
    </item>
    <item>
      <title>OpenMP and IPO</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764642#M19350</link>
      <description>Is NITS an integer parameter&lt;BR /&gt;Or an integer variable&lt;BR /&gt; If variable, can the compiler optimizer determine its value?&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Fri, 09 Mar 2012 23:09:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764642#M19350</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2012-03-09T23:09:12Z</dc:date>
    </item>
    <item>
      <title>OpenMP and IPO</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764643#M19351</link>
      <description>It's a parameter.</description>
      <pubDate>Fri, 09 Mar 2012 23:12:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764643#M19351</guid>
      <dc:creator>briardew</dc:creator>
      <dc:date>2012-03-09T23:12:08Z</dc:date>
    </item>
    <item>
      <title>OpenMP and IPO</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764644#M19352</link>
      <description>&amp;gt;&amp;gt;It's a parameter.&lt;BR /&gt;&lt;BR /&gt;If you can get a simple reproducer then send it in.&lt;BR /&gt;&lt;BR /&gt;This would be a problem with the optimizer.&lt;BR /&gt;Two work arounds come to mind:&lt;BR /&gt;&lt;BR /&gt;a) When the interation count is .lt. x (you decide what x is) then bypass the OpenMP parallel loop and run the loop directly. Note, there is an OpenMP clause to do this too, you can experiment with that too.&lt;BR /&gt;&lt;BR /&gt;b) Make the iteration limit an unknown variable to the compiler (including IPO where ie snoops around other files).&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Sat, 10 Mar 2012 13:21:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764644#M19352</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2012-03-10T13:21:28Z</dc:date>
    </item>
    <item>
      <title>OpenMP and IPO</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764645#M19353</link>
      <description>&lt;P&gt;Thanks for the response and sorry for the long reply time.&lt;/P&gt;

&lt;P&gt;I managed to reduce my problem down to something simpler. I can reproduce this w/ 11.1 and composer 2011 SP1 11.344.  Here is the code:&lt;/P&gt;

&lt;PRE&gt;
program omptest
  use omp_lib

  integer, parameter :: nits = 1
  integer, parameter :: ldx  = 10

  integer :: it
  real    :: xxen(ldx,nits), xx(ldx)

  xx = 1.0

!$omp parallel
!$omp single
  print *, 'Using OpenMP with ', omp_get_num_threads(), ' threads.'
  print *, '---'
!$omp end single
!$omp end parallel

!$omp parallel do
  do it = 1,nits
    print *, 'it = ',it
    xxen(:,it) = xx(:)
  end do
!$omp end parallel do

  print *, 'xxen = ',xxen
end program
&lt;/PRE&gt;

&lt;BR /&gt;
&lt;P&gt;If I compile with -fast and -openmp, it will print the iteration number N times, where N is the number of threads. If I take out the -ipo option (but keep -O3 -xHost, etc.), then I get the printed line once, as I should. Also, if I compile with -fast and -openmp and nits greater than 1, I get correct behavior. Finally, if xx is a scalar instead of an array, everything works correctly.&lt;/P&gt;&lt;P&gt;

&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Brad&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2012 23:51:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/OpenMP-and-IPO/m-p/764645#M19353</guid>
      <dc:creator>briardew</dc:creator>
      <dc:date>2012-07-13T23:51:13Z</dc:date>
    </item>
  </channel>
</rss>

