<?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 Re: Fastest Read-Write arrays with direct access in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845146#M63115</link>
    <description>RECL=1?  It's not going to be too happy about that!&lt;BR /&gt;&lt;BR /&gt;I think I see where you're trying to go with this, so let me suggest the following:&lt;BR /&gt;&lt;BR /&gt;Open the file FORM='BINARY' and ACCESS='SEQUENTIAL' (leave off RECL).  To position in the file, call FSEEK (see on-disk documentation index).  Then do unformatted sequential READs of however much data you want.&lt;BR /&gt;&lt;BR /&gt;Note that the CONVERT='BIG_ENDIAN' is going to slow you down a lot. But if that's what you need, you can't avoid it.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
    <pubDate>Wed, 08 May 2002 21:55:12 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2002-05-08T21:55:12Z</dc:date>
    <item>
      <title>Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845139#M63108</link>
      <description>I have to write and read double precision arrays (hundreds or thousands of numbers). The access to the file is "direct" (it is essential, because I use pointers to the different array locations)... and the array is written secuentialy on the file.&lt;BR /&gt;Which is the fastest method to achieve this goal?&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 07 May 2002 22:57:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845139#M63108</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-07T22:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845140#M63109</link>
      <description>Memory mapped files.  See &lt;A href="http://msdn.microsoft.com/library/en-us/fileio/filemap_9dk7.asp"&gt;http://msdn.microsoft.com/library/en-us/fileio/filemap_9dk7.asp&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Wed, 08 May 2002 00:39:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845140#M63109</guid>
      <dc:creator>james1</dc:creator>
      <dc:date>2002-05-08T00:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845141#M63110</link>
      <description>Unfortunately my files are huge and a filemap would use too much memory. I just need to use something like &lt;BR /&gt;&lt;BR /&gt;DO I=1,n !n=70000&lt;BR /&gt;READ(unit,...) array(I)&lt;BR /&gt;ENDDO&lt;BR /&gt;&lt;BR /&gt;but I think this is not a fast method. Something faster (or fastest)?</description>
      <pubDate>Wed, 08 May 2002 17:34:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845141#M63110</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-08T17:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845142#M63111</link>
      <description>An array and a direct access file are two different things. The array is in memory, and the file is on disk. Can you clarify what you're doing?&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Wed, 08 May 2002 19:26:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845142#M63111</guid>
      <dc:creator>durisinm</dc:creator>
      <dc:date>2002-05-08T19:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845143#M63112</link>
      <description>The fastest way to read and write data is to read or write the entire array at once, not in a DO loop an element at a time.  However, if the array is very large, this can cause a problem with memory usage, so sometimes reading in a section of an array:&lt;BR /&gt;&lt;PRE&gt;
read (1) (array(i),i=1,1000)
&lt;/PRE&gt;&lt;BR /&gt;is better - the compiler knows how to turn this style into a single transfer.&lt;BR /&gt;&lt;BR /&gt;Note that unformatted I/O is MUCH faster than formatted I/O.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 08 May 2002 20:40:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845143#M63112</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-08T20:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845144#M63113</link>
      <description>Of course, they are different things. I am trying to write the array (that is in memory) to a file (in the hard disk), and later, read the file into another array.&lt;BR /&gt;This process is quite slow (using big arrays and huge files). I am looking for the fastest method.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 08 May 2002 20:48:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845144#M63113</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-08T20:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845145#M63114</link>
      <description>Thanks, Steve. But I have an IOSTAT error 67. &lt;BR /&gt;What I am doing is:&lt;BR /&gt;Opening the file:&lt;BR /&gt;  OPEN(UNIT    =  uni             ,&amp;amp; &lt;BR /&gt;        FILE   =  fname           ,&amp;amp; &lt;BR /&gt;        CONVERT= 'BIG_ENDIAN'     ,&amp;amp; &lt;BR /&gt;        ACCESS = 'DIRECT'         ,&amp;amp; &lt;BR /&gt;        FORM   = 'UNFORMATTED'    ,&amp;amp; &lt;BR /&gt;        ACTION = 'READWRITE'      ,&amp;amp; &lt;BR /&gt;        RECL       =  1           ,&amp;amp; &lt;BR /&gt;        BUFFERED   ='YES'         ,&amp;amp; &lt;BR /&gt;        BLOCKSIZE  = 16384        ,&amp;amp; &lt;BR /&gt;        BUFFERCOUNT= 1            ,&amp;amp; &lt;BR /&gt;        IOSTAT     = Io)      &lt;BR /&gt;&lt;BR /&gt;and reading the file:&lt;BR /&gt;READ(UNIT=uni,REC=ir,IOSTAT=io) (vect(I), I=1,leng)&lt;BR /&gt;&lt;BR /&gt; where leng=20000 and vect is declared...&lt;BR /&gt; INTEGER vect(*) !(...from a big enought array)&lt;BR /&gt;&lt;BR /&gt;What is wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 08 May 2002 21:24:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845145#M63114</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-08T21:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845146#M63115</link>
      <description>RECL=1?  It's not going to be too happy about that!&lt;BR /&gt;&lt;BR /&gt;I think I see where you're trying to go with this, so let me suggest the following:&lt;BR /&gt;&lt;BR /&gt;Open the file FORM='BINARY' and ACCESS='SEQUENTIAL' (leave off RECL).  To position in the file, call FSEEK (see on-disk documentation index).  Then do unformatted sequential READs of however much data you want.&lt;BR /&gt;&lt;BR /&gt;Note that the CONVERT='BIG_ENDIAN' is going to slow you down a lot. But if that's what you need, you can't avoid it.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 08 May 2002 21:55:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845146#M63115</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-08T21:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845147#M63116</link>
      <description>Hy, Steve, thanks. I get it (I guess). But I have problems writing at the end of the file. For example, on an empty file:&lt;BR /&gt;offset=0&lt;BR /&gt;Io=FSEEK(uni,offset,0) !beginning of the file&lt;BR /&gt;WRITE(UNIT=uni, IOSTAT=io) variable !variable = 4&lt;BR /&gt;&lt;BR /&gt;It doesn't write anything.&lt;BR /&gt;&lt;BR /&gt;What to do?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 09 May 2002 00:28:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845147#M63116</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-09T00:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845148#M63117</link>
      <description>An example I tried, based on your fragment, worked ok.  You asked about writing to "the end of the file" but the code you showed wrote to the beginning. Is that what you want?&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 09 May 2002 01:45:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845148#M63117</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-09T01:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845149#M63118</link>
      <description>Just a note regarding the size of this data, if you are talking about 70000 doubles that is plenty small enough for mapped memory.  Anyhow whether you need any extra speed beyond what you can get through the language RTL depends upon your performance goals.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Thu, 09 May 2002 03:18:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845149#M63118</guid>
      <dc:creator>james1</dc:creator>
      <dc:date>2002-05-09T03:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845150#M63119</link>
      <description>You are right. But at the beginning, the end of the file is the beginning. ;o)&lt;BR /&gt;My problem was on the "BUFFERED Specifier". I was trying to read data before it was written. Is there any way to force the writing of the buffer?&lt;BR /&gt;&lt;BR /&gt;About FileMapping, I guess that if I want to read something on the 128kb position, the file image must have at least 128kb. My file can be 500 or 1000 Mb, quite big for memory.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Javier.</description>
      <pubDate>Thu, 09 May 2002 19:05:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845150#M63119</guid>
      <dc:creator>j_jimenez</dc:creator>
      <dc:date>2002-05-09T19:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845151#M63120</link>
      <description>Ah, I didn't try BUFFERED.  The whole point of BUFFERED is to allow the RTL to decide when the data should be written.  You can close the file and re-open it if you wish, but you may want to try the DFPORT routine "FLUSH" to see if that works (I'm not sure if it would.)&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 09 May 2002 20:07:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845151#M63120</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2002-05-09T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest Read-Write arrays with direct access</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845152#M63121</link>
      <description>Again, the file sizes that you are talking about are not a problem.  Think about it, this is just a different way of using the same amount of memory.&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 10 May 2002 00:31:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-Read-Write-arrays-with-direct-access/m-p/845152#M63121</guid>
      <dc:creator>james1</dc:creator>
      <dc:date>2002-05-10T00:31:53Z</dc:date>
    </item>
  </channel>
</rss>

