Re: ACTION='read' in OPEN statement
From: Paul van Delst (paul.vandelst_at_noaa.gov)
Date: Thu, 09 Oct 2003 11:08:26 -0400
Chris Murray wrote:
> Hi all,
> Will an ACTION='read' clause in an OPEN statement prevent that file
> from being locked from simultaneous accesses to that same file from a
> parallel instance of the same fortran program? My question is
> specific to Windows NT and CVF.
I can't speak to the applicability to CVF, but that was the recommendation made to me by
the IBM folks when I was faced with an I/O speed problem. I have code where hundreds of
separate processes (fortran programs running on different nodes/cpus) read from one file
(sequential, unformatted), and the use of ACTION='read' was considered good form for this
sort of file access. The default on the IBM machine I was using was to allow this multiple
access anyway but only if the file permission is set to read only. (Unfortunately the I/O
speed problem was due to something else...not my code though).
But, on the other hand, isn't this sort of thing an implementation issue? Or does the
standard state that use of ACTION='read' means that multiple processes (whatever that
means) can access the same file independently? I didn't think the std made statements like
> My code is smart enough
> from one run to the next, to look for a unique name of that data file
> (i.e. "prefix".h2o, where prefix is peculiar to a given run), but that
> means that I need to make 1200 copies of an 8 Mb file during the
> course of a complete run through all regression tests.
Yoicks. You should not have to create 1200 copies of the same file.
> I tried just
> creating hard links (I do all this under cygwin) and/or symlinks from
> the "prefix".h2o to a master file, but CVF still recognized the file
> as locked.
My processing code creates multiple symlinks to the same file so it should be possible
(especially in CVF...they're pretty good about that sort of stuff). I remember doing
similar things decades ago (bloody hell!) on a VAX/VMS machine with the same code (i.e.
running multiple instances of the same program reading from one database file. Isn't the
VAX fortran a distant ancestor of CVF?? :o)
-- Paul van Delst CIMSS @ NOAA/NCEP/EMC Ph: (301)763-8000 x7748 Fax:(301)763-8545