<?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 Data alignment in common blocks in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871334#M72245</link>
    <description>&lt;P&gt;Declare your COMMON with the BIND(C) attribute, like this:&lt;/P&gt;
&lt;P&gt;BIND(C) :: /COMMON_NAME/&lt;/P&gt;
&lt;P&gt;This will make Fortran lay out the variables exactly as C would in a struct. Fortran does not pad COMMONs by default, which is why you don't see an option for it.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Mar 2010 16:40:08 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2010-03-12T16:40:08Z</dc:date>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871332#M72243</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm currently developing a static library in Fortran containing common blocks. These COMMONswill be accessed from C++ application, that links the fortran library. As the C++ app requirement is that the data from extern "C" is aligned by 1 byte, I was hoping to set this in VF11 compiler settings, however I have only found /allign: commons (4 bytes) and/allign: dcommons (8 bytes). Is there a different way of solving this problem (e.g. in-line allignment macro)? I would be most grateful for your help.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Mario&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2010 15:29:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871332#M72243</guid>
      <dc:creator>rfvujm</dc:creator>
      <dc:date>2010-03-12T15:29:57Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871333#M72244</link>
      <description>&lt;P&gt;Generally speaking, it's unreliable to depend on schemes for including padding between variables in COMMON, particularly when interoperating between languages. Perhaps that is the point you are making.&lt;/P&gt;
&lt;P&gt;The traditional recommendation to declare all data in a COMMON in decreasing order of size is still good, to avoid requirements for padding to produce correct alignments. This is satisfactory, in the absence of requirement for efficient vectorization.&lt;/P&gt;
&lt;P&gt;In order to promote vectorization without inclusion of padding, we set arrays to specific sizes, such as multiples of 16. That may not be among your concerns.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2010 15:54:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871333#M72244</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2010-03-12T15:54:15Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871334#M72245</link>
      <description>&lt;P&gt;Declare your COMMON with the BIND(C) attribute, like this:&lt;/P&gt;
&lt;P&gt;BIND(C) :: /COMMON_NAME/&lt;/P&gt;
&lt;P&gt;This will make Fortran lay out the variables exactly as C would in a struct. Fortran does not pad COMMONs by default, which is why you don't see an option for it.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2010 16:40:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871334#M72245</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-03-12T16:40:08Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871335#M72246</link>
      <description>&lt;P&gt;My C++ appneeds to support the dataalignment by 1 for legacy reasons (porting from Alpha)and a chain structureof the set of software modules that passes this data. The fortran code is mid-way in this chain, it gets HUGE amount of REAL*4, INTEGER*2 and LOGICAL*1 variables and arrays and collects it in COMMONs in various order (so no natural alignment possible). Next, the C++ gets itby extern "C", wraps it into structures and passes it further on. At each stage, the offsets between each vaiable must be kept constant. I'd like to avoid low-level data manipulation and COMMONs redefinition, as the whole chain would be affected.&lt;/P&gt;
&lt;P&gt;Any way to 'hack' :) the IVF11 compiler?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2010 17:06:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871335#M72246</guid>
      <dc:creator>rfvujm</dc:creator>
      <dc:date>2010-03-12T17:06:13Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871336#M72247</link>
      <description>&lt;P&gt;As Steve pointed out, the iso_c_binding declaration guarantees consistency (almost certainly with no padding) between Fortran and extern "C"&lt;/P&gt;
&lt;P&gt;The mis-alignment would have been problematical on Alpha, and the code was intentionally non-portable, but Steve's suggestion seems best.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2010 17:29:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871336#M72247</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2010-03-12T17:29:32Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871337#M72248</link>
      <description>Even without BIND(C), Intel Fortran does not pad COMMONs unless you ask it to.</description>
      <pubDate>Fri, 12 Mar 2010 18:20:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871337#M72248</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-03-12T18:20:36Z</dc:date>
    </item>
    <item>
      <title>Data alignment in common blocks</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871338#M72249</link>
      <description>&lt;P&gt;Thanks guys!&lt;/P&gt;
&lt;P&gt;Mario&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2010 14:12:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Data-alignment-in-common-blocks/m-p/871338#M72249</guid>
      <dc:creator>rfvujm</dc:creator>
      <dc:date>2010-03-15T14:12:12Z</dc:date>
    </item>
  </channel>
</rss>

