SAM / DAM files
SAM / DAM files
Posted Apr 11, 2022 18:28 UTC (Mon) by joib (subscriber, #8541)In reply to: SAM / DAM files by Wol
Parent article: Readahead: the documentation I wanted to read
Sounds like an OS designed for Fortran, which has sequential access and direct access I/O. Or well, nowadays Fortran additionally has stream access as well, which is more like the stream of bytes model Unix and Windows provide. Fortran sequential files allow stepping forwards or backwards one record at a time (or going all the way to the beginning or end), but going forwards or backwards N records is an O(N) operation. Direct access, conceptually, is a bunch of fixed size records allowing access in any order.
Needless to say, on a modern day OS which provides only the stream-of-bytes model, it's the task of the Fortran runtime library to implement direct and sequential access on top of the stream-of-bytes model that the OS provides.
> Is there any way this sort of information could be fed through to these routines, because there's clearly no point reading-ahead a dam file, while there is no point caching a sam file once that bit of data has been synchronously read ...
At least from the perspective of the typical Fortran applications I've seen, this would be a very simplistic and bad caching strategy. For instance, reading direct access files sequentially (as in, first read record #1, then record #2, etc) is actually very common, as is rereading files (maybe by rerunning the applications with partially different input parameters etc.).