<?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 Fastest way to read/write binary data? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781628#M28041</link>
    <description>Since you're using ACCESS='STREAM' you can decide how much to read at a time. If you can overlap the reading, computation and writing you might want to look into using ASYCHRONOUS='YES' option on opening the file and doing the I/O. Read more about that in the documentation, though I'd advise you to use version 12 (Composer XE 2011) for best results.&lt;BR /&gt;&lt;BR /&gt;It is not clear to me that OpenMP will help you here, but there are many experienced parallel applications programmers in this forum who I am sure will offer opinions.&lt;BR /&gt;&lt;BR /&gt;How do you know that it's the I/O that is the limiting factor?</description>
    <pubDate>Tue, 15 Mar 2011 20:09:45 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2011-03-15T20:09:45Z</dc:date>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781625#M28038</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;I am reading/writing large datasets of double precision real data and single precision integer data and would like to know if there is a way I can speed up the I/O. I do my I/O using binary data and am using Intel FORTRAN 11.1. In particular, I open my files by,&lt;BR /&gt;&lt;BR /&gt;open(unit=fid, file = 'foo.dat', form = 'unformatted', access = 'stream')&lt;BR /&gt;&lt;BR /&gt;I READ and WRITE my data as,&lt;BR /&gt;&lt;BR /&gt;do i = 1,N&lt;BR /&gt;read(fid) x(i)&lt;BR /&gt;write(fid) x(i)&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt;Is there a way to use OpenMP to help speed up the I/O?&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help.&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Tue, 15 Mar 2011 18:12:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781625#M28038</guid>
      <dc:creator>david_sallngc_com</dc:creator>
      <dc:date>2011-03-15T18:12:18Z</dc:date>
    </item>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781626#M28039</link>
      <description>You're reading an element at a time, which has a lot of overhead. Can you read a whole array at a time, process it and then write a whole array?</description>
      <pubDate>Tue, 15 Mar 2011 18:47:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781626#M28039</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-03-15T18:47:05Z</dc:date>
    </item>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781627#M28040</link>
      <description>Hi Steve!&lt;BR /&gt;&lt;BR /&gt;Yes, I can write an entire vector at one time. It is a very large vector though. Is there a way I can check, apriori, via some code, to make sure I have enoughmemory to write it in one chunk or is this not even a concern?&lt;BR /&gt;&lt;BR /&gt;Is is possible to use OpenMP in some way to write different chunks of data to a file at the same time?&lt;BR /&gt;&lt;BR /&gt;Is writing entire vectors at one time the fastest I can do?&lt;BR /&gt;&lt;BR /&gt;Thanks Steve.&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Tue, 15 Mar 2011 18:58:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781627#M28040</guid>
      <dc:creator>david_sallngc_com</dc:creator>
      <dc:date>2011-03-15T18:58:20Z</dc:date>
    </item>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781628#M28041</link>
      <description>Since you're using ACCESS='STREAM' you can decide how much to read at a time. If you can overlap the reading, computation and writing you might want to look into using ASYCHRONOUS='YES' option on opening the file and doing the I/O. Read more about that in the documentation, though I'd advise you to use version 12 (Composer XE 2011) for best results.&lt;BR /&gt;&lt;BR /&gt;It is not clear to me that OpenMP will help you here, but there are many experienced parallel applications programmers in this forum who I am sure will offer opinions.&lt;BR /&gt;&lt;BR /&gt;How do you know that it's the I/O that is the limiting factor?</description>
      <pubDate>Tue, 15 Mar 2011 20:09:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781628#M28041</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-03-15T20:09:45Z</dc:date>
    </item>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781629#M28042</link>
      <description>&amp;gt;&amp;gt;Is is possible to use OpenMP in some way to write different chunks of data to a file at the same time?&lt;BR /&gt;&lt;BR /&gt;real :: YourData(BigSize)&lt;BR /&gt;integer, volatile :: ElementsInsertedIntoBuffer&lt;BR /&gt;logical :: InsertionsFinished&lt;BR /&gt;integer, volatile :: LastElementWritten&lt;BR /&gt;logical :: WriteError&lt;BR /&gt;ElementsInsertedIntoBuffer = 0&lt;BR /&gt;InsertionsFinished = .false.&lt;BR /&gt;LastElementWritten = 0&lt;BR /&gt;WriteError = .false.&lt;BR /&gt;&lt;BR /&gt;!$omp parallel sections &lt;BR /&gt;do while((.not. InsertionsFinished) .and. (.not. WriteError))&lt;BR /&gt;InsertionsFinished = AppendDataToBuffer(YourData, ElementsInsertedIntoBuffer)&lt;BR /&gt;end do&lt;BR /&gt;!$omp section&lt;BR /&gt;do while((.not. InsertionsFinished) .or. (ElementsInsertedIntoBuffer .gt. LastElementWritten))&lt;BR /&gt; if(ElementsInsertedIntoBuffer .gt. LastElementWritten) then&lt;BR /&gt; WriteError= WriteDataFromBuffer(YourData, LastElementWritten)&lt;BR /&gt; if(WriteError) exit&lt;BR /&gt; else&lt;BR /&gt; sleepqq(100)&lt;BR /&gt; endif&lt;BR /&gt;end do&lt;BR /&gt;!$omp end parallel sections&lt;BR /&gt;&lt;BR /&gt;Something like that will do. I will let you write the functions.&lt;BR /&gt;&lt;BR /&gt;Note, you can also use two data arrays as a double buffer or use a smaller large array as a circular buffer (with logic to avoid overrunning the writes).&lt;BR /&gt;&lt;BR /&gt;A similar thing can be done for reading the data.&lt;BR /&gt;&lt;BR /&gt;Note, the writes in your WriteDataFromBuffer would be normal writes.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Tue, 15 Mar 2011 21:31:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781629#M28042</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-03-15T21:31:54Z</dc:date>
    </item>
    <item>
      <title>Fastest way to read/write binary data?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781630#M28043</link>
      <description>Dear Jim and Steve!&lt;BR /&gt;&lt;BR /&gt;Thank you both very much for your suggestions. Sounds fantastic.&lt;BR /&gt;&lt;BR /&gt;Now for some fun coding!!&lt;BR /&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Wed, 16 Mar 2011 14:09:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Fastest-way-to-read-write-binary-data/m-p/781630#M28043</guid>
      <dc:creator>david_sallngc_com</dc:creator>
      <dc:date>2011-03-16T14:09:25Z</dc:date>
    </item>
  </channel>
</rss>

