<?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: Unformatted WRITE of user-defined datatype in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930654#M14704</link>
    <description>...btw, what happens when you try to WRITE into a binary file &lt;BR /&gt;a structure containing POINTERs to arrays or, still worse, &lt;BR /&gt;if it is a part of, say, linked list with POINTERs to another structures? &lt;BR /&gt; &lt;BR /&gt;AFAIK, CVF stores POINTERs to arrays inside a structure in an &lt;BR /&gt;array descriptor. Are array elements stored somewhere in the file also &lt;BR /&gt;(as a naive user would expect), or, as I suspect, isn't the descriptor just &lt;BR /&gt;copied byte-by-byte to disk, thus losing its association with the target &lt;BR /&gt;when the file is reloaded on, say, a later run of the application? What the &lt;BR /&gt;(F2k draft) standard say should happen? &lt;BR /&gt; &lt;BR /&gt;(Perhaps this belongs to another thread - but perhaps it has something &lt;BR /&gt;related with the problem of the original poster?) &lt;BR /&gt; &lt;BR /&gt;Regards, &lt;BR /&gt;Jugoslav</description>
    <pubDate>Mon, 11 Dec 2000 22:49:26 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2000-12-11T22:49:26Z</dc:date>
    <item>
      <title>Unformatted WRITE of user-defined datatype</title>
      <link>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930651#M14701</link>
      <description>I have a gigantic array (several dozen megabytes) of a user-defined datatype. I would like to write this array out to a binary file using unformatted I/O for fastest operation. &lt;BR /&gt;  &lt;BR /&gt;Let's say that my array is X. This is my line of code: &lt;BR /&gt;  &lt;BR /&gt;TYPE(MYTYPE), ALLOCATABLE :: X &lt;BR /&gt;     ... &lt;BR /&gt;WRITE(3) X &lt;BR /&gt;  &lt;BR /&gt;However, when I execute this line I get "stack overflow." I can avoid the stack overflow by increasing the stack size, but this eventually leads to a stack size equal to the amount of system memory. I can also avoid it by writing out one element of the array at a time, but then I don't get the excellent performance of the unformatted write. Finally, I could write out the array in many smaller chunks, but this leads to a bunch of messy code. &lt;BR /&gt;  &lt;BR /&gt;Are there any ways to solve this problem short of increasing the stack size to a gigantic size? &lt;BR /&gt;  &lt;BR /&gt;    Thank you, &lt;BR /&gt;    Michael Carr</description>
      <pubDate>Sat, 09 Dec 2000 04:58:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930651#M14701</guid>
      <dc:creator>michael-a-carr</dc:creator>
      <dc:date>2000-12-09T04:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unformatted WRITE of user-defined datatype</title>
      <link>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930652#M14702</link>
      <description>I can't reproduce this in 6.5.  I suggest you send a small but complete example to us at vf-support@compaq.com and we'll take a look.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Sat, 09 Dec 2000 07:23:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930652#M14702</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2000-12-09T07:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Unformatted WRITE of user-defined datatype</title>
      <link>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930653#M14703</link>
      <description>Hi Michael, your problem sounds like it's the same as if you tried to write   &lt;BR /&gt;an array in a subroutine, like this:  &lt;BR /&gt;  &lt;BR /&gt;     SUBROUTINE  SUBNAM(X,Y,Z)  &lt;BR /&gt;     DIMENSION X(*)  &lt;BR /&gt;  &lt;BR /&gt;     WRITE(IUNIT)X  &lt;BR /&gt;........  &lt;BR /&gt;  &lt;BR /&gt;The above does not work because "WRITE" has no way to know how many  &lt;BR /&gt;elements the array X has.  &lt;BR /&gt;  &lt;BR /&gt;In your case also, I would ask how the WRITE statement knows how big  &lt;BR /&gt;the "ALLOCATABLE" array is, as you did not show a line of code that   &lt;BR /&gt;allocated the size.  &lt;BR /&gt;  &lt;BR /&gt;I don't know what the disk format is for unformatted write in this compiler,  &lt;BR /&gt;but I can tell you that others I have used split large volume output into  &lt;BR /&gt;blocks anyway, like 256 bytes, starting with a block count and containing  &lt;BR /&gt;a CRC check.  I you can find out from COMPAQ what the block size is,  &lt;BR /&gt;then writing data in blocks that match the blocksize should be just as  &lt;BR /&gt;efficient.  &lt;BR /&gt;   Regards, Paul Dent</description>
      <pubDate>Mon, 11 Dec 2000 01:18:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930653#M14703</guid>
      <dc:creator>paulw</dc:creator>
      <dc:date>2000-12-11T01:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unformatted WRITE of user-defined datatype</title>
      <link>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930654#M14704</link>
      <description>...btw, what happens when you try to WRITE into a binary file &lt;BR /&gt;a structure containing POINTERs to arrays or, still worse, &lt;BR /&gt;if it is a part of, say, linked list with POINTERs to another structures? &lt;BR /&gt; &lt;BR /&gt;AFAIK, CVF stores POINTERs to arrays inside a structure in an &lt;BR /&gt;array descriptor. Are array elements stored somewhere in the file also &lt;BR /&gt;(as a naive user would expect), or, as I suspect, isn't the descriptor just &lt;BR /&gt;copied byte-by-byte to disk, thus losing its association with the target &lt;BR /&gt;when the file is reloaded on, say, a later run of the application? What the &lt;BR /&gt;(F2k draft) standard say should happen? &lt;BR /&gt; &lt;BR /&gt;(Perhaps this belongs to another thread - but perhaps it has something &lt;BR /&gt;related with the problem of the original poster?) &lt;BR /&gt; &lt;BR /&gt;Regards, &lt;BR /&gt;Jugoslav</description>
      <pubDate>Mon, 11 Dec 2000 22:49:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unformatted-WRITE-of-user-defined-datatype/m-p/930654#M14704</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2000-12-11T22:49:26Z</dc:date>
    </item>
  </channel>
</rss>

