<?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 See the attached presentation in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999538#M103293</link>
    <description>&lt;P&gt;See the attached presentation.&lt;A href="https://community.intel.com/legacyfs/online/drupal_files/443546"&gt;443546&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2015 14:44:04 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2015-05-13T14:44:04Z</dc:date>
    <item>
      <title>FORALL vs. nested DO construct / Compare - Contrast</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999535#M103290</link>
      <description>&lt;P&gt;I have code which has the following block:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;FORALL(I = 1:II, J = 1:JJ, K = 1:KK, NULL(I, J, K) == 1)
    V(I, J, K) = FRAC(I, J, K) * DX(I, J, K) * DY(I, J, K) * DZ(I, J, K)
    VN(I, J, K) = DX(I, J, K) * DY(I, J, K) * DZ(I, J, K)
END FORALL
&lt;/PRE&gt;

&lt;P&gt;In compiling / running the code after turning off my StackReserveSize number, I was noting this code was eating up stack. &amp;nbsp;So, I replaced it with&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;DO K = 1, KK
    DO J = 1, JJ
        DO I = 1, II
            IF (NULL(I, J, K) == 1) THEN
                V(I, J, K) = FRAC(I, J, K) * DX(I, J, K) * DY(I, J, K) * DZ(I, J, K)
                VN(I, J, K) = DX(I, J, K) * DY(I, J, K) * DZ(I, J, K)
            END IF
        END DO
    END DO
END DO
&lt;/PRE&gt;

&lt;P&gt;The code no longer gave me stack overflow errors, but it ran differently. &amp;nbsp;How can that be?&lt;/P&gt;

&lt;P&gt;Perplexed&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 21:40:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999535#M103290</guid>
      <dc:creator>NotThatItMatters</dc:creator>
      <dc:date>2015-05-12T21:40:35Z</dc:date>
    </item>
    <item>
      <title>FORALL is not a loop</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999536#M103291</link>
      <description>&lt;P&gt;FORALL is not a loop construct, to begin with. Your two code excerpts are not equivalent. FORALL is a series of masked array assignments. FORALL has been deprecated in the standard, replaced with DO CONCURRENT which has semantics more likely to be understood by the programmer (and also easier for the compiler to optimize.)&lt;/P&gt;

&lt;P&gt;That said, at a quick glance I would expect the end result to be the same. I am always suspicious of code fragments which, in my experience, often don't reflect the actual code. So, can you come up with a buildable and runnable test case that demonstrates the difference? Or at least explain what you mean by "ran differently"?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 23:07:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999536#M103291</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-05-12T23:07:21Z</dc:date>
    </item>
    <item>
      <title>Perhaps it is the non</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999537#M103292</link>
      <description>&lt;P&gt;Perhaps it is the non-optimization which is causing the differences. &amp;nbsp;The code snippets provided were the sum total difference between two executables of 20000 lines or more which "ran differently" as in one (the FORALL one) gave errors of 0.02% whereas the other (the DO one) gave errors of 1.76%. &amp;nbsp;The code snippet is executed once during array initialization. &amp;nbsp;I know this is not offering you much, but what it is providing me with is an opportunity to note LSB differences in code which, if not properly handled, can cause this sort of thing to be exacerbated.&lt;/P&gt;

&lt;P&gt;Are there any good references or rules of thumb on coding which might help in trying to eliminate the susceptibility of my code to this behavior?&lt;/P&gt;

&lt;P&gt;Perplexed&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 14:31:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999537#M103292</guid>
      <dc:creator>NotThatItMatters</dc:creator>
      <dc:date>2015-05-13T14:31:09Z</dc:date>
    </item>
    <item>
      <title>See the attached presentation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999538#M103293</link>
      <description>&lt;P&gt;See the attached presentation.&lt;A href="https://community.intel.com/legacyfs/online/drupal_files/443546"&gt;443546&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 14:44:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/FORALL-vs-nested-DO-construct-Compare-Contrast/m-p/999538#M103293</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-05-13T14:44:04Z</dc:date>
    </item>
  </channel>
</rss>

