<?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 Hard to guess without context in Intel® MPI Library</title>
    <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046592#M4348</link>
    <description>Hard to guess without context.</description>
    <pubDate>Wed, 05 Nov 2014 19:07:52 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2014-11-05T19:07:52Z</dc:date>
    <item>
      <title>IFORT constant numbers</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046590#M4346</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have frequently heard that in C++ HPC xeon phi applications, it is beneficial to declare variables as const, if possible. However, I cannot seem to ascertain whether or not this is possible in Fortran. Is there a way to do this type of optimization using ifort&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 03:15:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046590#M4346</guid>
      <dc:creator>conor_p_</dc:creator>
      <dc:date>2014-11-05T03:15:27Z</dc:date>
    </item>
    <item>
      <title>I have seen that used for</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046591#M4347</link>
      <description>&lt;P&gt;I have seen that used for doubles and ints. Would that work for an array that I am passing to a subroutine as well?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 15:15:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046591#M4347</guid>
      <dc:creator>conor_p_</dc:creator>
      <dc:date>2014-11-05T15:15:11Z</dc:date>
    </item>
    <item>
      <title>Hard to guess without context</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046592#M4348</link>
      <description>Hard to guess without context.</description>
      <pubDate>Wed, 05 Nov 2014 19:07:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046592#M4348</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-11-05T19:07:52Z</dc:date>
    </item>
    <item>
      <title>I think you're asking the</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046593#M4349</link>
      <description>&lt;P&gt;I think you're asking the wrong question - the question you want to ask is 'what is the most efficient way to pass array arguments?' - this is really what you're after, correct?&lt;/P&gt;

&lt;P&gt;Read this: &amp;nbsp;&lt;A href="https://software.intel.com/en-us/articles/fortran-array-data-and-arguments-and-vectorization"&gt;https://software.intel.com/en-us/articles/fortran-array-data-and-arguments-and-vectorization&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;while written for Xeon Phi it also applies to any Intel processor using the Intel Fortran compilers.&lt;/P&gt;

&lt;P&gt;Don't forget that job #1 is to align your data and tell the compiler it is aligned: &amp;nbsp;https://software.intel.com/en-us/articles/data-alignment-to-assist-vectorization. &amp;nbsp; If you're using Phi, YOU MUST ALIGN YOUR DATA for performance. &amp;nbsp;Anything else is window dressing and minor tweaks.&lt;/P&gt;

&lt;P&gt;You should read through the rest of the Methodology guide for more details on tuning: &amp;nbsp;&lt;A href="https://software.intel.com/en-us/articles/programming-and-compiling-for-intel-many-integrated-core-architecture"&gt;https://software.intel.com/en-us/articles/programming-and-compiling-for-intel-many-integrated-core-architecture&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also, I recommend using -fno-alias -fno-fnalias if you're sure your code is not aliasing.&lt;/P&gt;

&lt;P&gt;Ron&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 14:53:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046593#M4349</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2014-11-10T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Ronald I am not quite sure if</title>
      <link>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046594#M4350</link>
      <description>&lt;P&gt;Ronald I am not quite sure if that is my question, here is an example of what I am talking about&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subroutine calc_sum(A,B,n,sumval)
    implicit none
    double precision :: A(n),B(n)
    double precision :: A1,B1
    double precision:: sumval
    integer :: loop1,loop2

&amp;nbsp;   sumval = 0.0d0
    do loop1 = 1,n
         A1 = A(loop1)
         do loop2 = 1,n
              B1 = B(loop2)

              sumval = sumval + A1+B
         enddo
    enddo
end subroutine
    &lt;/PRE&gt;

&lt;P&gt;I do not know how to tell the compiler that, for the purposes of this subroutine, the array elements are constant. For instance, if the code I were writing were in C++ (which I don't actually know, so I apologize if there is a typo in the following code) I would write the following&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;void calc_sum(const double A, const double B, const int n, double sumval)&lt;/PRE&gt;

&lt;P&gt;I have frequently seen these types of optimizations implemented in xeon phi codes. Does the -fno-alias handle this?&lt;/P&gt;

&lt;P&gt;Just a side question about alignment, consider the case that A were an array of structures with an odd number of double elements&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;type a_elements
       double precision :: a1,a2,a3
end type a_elements

type(a_elements) :: A(n)&lt;/PRE&gt;

&lt;P&gt;When I run for a Xeon phi, does EVERY array element have to be aligned or just the first array element? In this example, the first array element, A(1), would be aligned when I compile with -align array64byte, but the remaining array elements would not be. If all array elements need to be aligned, how would I pad this data structure to accomplish this in Fortran?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 14:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-MPI-Library/IFORT-constant-numbers/m-p/1046594#M4350</guid>
      <dc:creator>conor_p_</dc:creator>
      <dc:date>2014-11-11T14:19:00Z</dc:date>
    </item>
  </channel>
</rss>

