writing to disk

writing to disk

I use read and write statements to save output from my applications to local hard-drives.  Some of the files involved are 25GB, and the write statements for these understandably take a fair bit of time to execute.  I have noticed, however, that if I copy and paste the resulting files to alternatives folders on the disk thourgh windows explorer, then the copies are created in a fraction of the time that the "write" commands take to complete.  Is there some way to speed up writing to the disk through Fortran?

Many thanks,


5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Do have a very large number if files in the folder where you are writing? I have experiance of that slowing things down.

No - the largest files are written into folders that contain just one or two other files.  

I hope enabling I/O Buffering speeds up write statements.  (/assume:buffered_io)

Buffering is one issue. The other issue is if you are using formatted writes, then the time to format (convert from binary to text) is significant. This formatting overhead will not be observed during file copy. If reducing this time to write has significant value, then consider adding code that perform the formatting for output using internal writes in a parallel manner, and then having a serial thread writing the preformatted text to the output file. A competent (parallel programmng) programmer should be able to add this feature for you. Without seeing the code, it would be hard to ascertain the degree of difficulty in doing this.

Note, Copy and Past operation may employ a background file copy operation. Meaning you have the appearance of copy complete. When your paste appears to complete how long does it take for your disk led to stop blinking?

Jim Dempsey

Leave a Comment

Please sign in to add a comment. Not a member? Join today