- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
program WriteScratch Character*32 Test REAL secnds,t0,t1,MBit,MByte Test=' ' t0=0. t1=0. secnd=0. Mbit=0. Mbyte=13.3 OPEN(11,FILE='Count',STATUS='replace',FORM='FORMATTED', & ACCESS='SEQUENTIAL',IOSTAT=IERROR,ERR=9000) t0 = secnds(0.0) do i =1,1000000 Write(11,*) 'Hello World' END DO REWIND(11) READ(11,'(A32)') Test t1 = secnds(t0) Mbit=(Mbyte*8)/t1 OPEN(12,FILE='TIME',STATUS='replace',FORM='FORMATTED', & ACCESS='SEQUENTIAL',IOSTAT=IERROR,ERR=9001) write(12,10) t1 write(12,20) Mbit 10 Format (' Dauer:',F10.3,' sec') 20 Format (' Geschwindigkeit:',F10.3,' Mbit/s') 9000 CLOSE(11) 9001 CLOSE(12) end program WriteScratch
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What are compile options are you using?
Is your example code really all that relevant to your production code? I assume not - in which case the example isn't particularly useful.
The compiler's implementation of IO will have changed between those versions to support things like user defined IO.
I think I've also seen changes in how files are buffered (but this isn't something that I've paid any attention to, and perhaps it doesn't apply to formatted sequential IO). Have you experimented with the open specifiers and environment variables that affect buffering? I suspect a program with so many small writes and reads would be particularly sensitive to buffering options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can also confirm significant performance loss due to file operations over that time. Adding "buffered" to all OPENs seems to have alleviated the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Andreas, if the burden of modifying the source code is the main obstacle to reducing the I/O penalty, perhaps you do not care much about the contents of the files that your application creates, and it may not matter if those files do not have shared access. If so, why not solve the problem by changing the location of those files to a local drive or even a suitably sized ramdisk?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page