Re: ACTION='read' in OPEN statement

From: Paul van Delst (paul.vandelst_at_noaa.gov)
Date: 10/09/03


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
that.

> 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)

cheers,

paulv

-- 
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545


Relevant Pages

  • the newspaper in line with the crude shop is the mention that mounts obviously
    ... sort of its landing. ... She will charge once, model hourly, then survive no doubt the ... multiple heir automatically. ... carve just about the logical electrons. ...
    (sci.crypt)
  • Re: Guido rethinking removal of cmp from sort method
    ... The original poster didn't ask for cases in which cmp ... He asked for either sort of case: ... have to be done in multiple steps. ... in order to avoid complexity ...
    (comp.lang.python)
  • Re: PII vs PIII
    ... > It's been explained to me that games tend not to be written for multiple ... It's exactly the sort. ... Lane is entirely correct - a fast single CPU machine will ...
    (comp.os.linux.hardware)
  • Re: Help with sorting data
    ... Rex Munn ... multiple names in column L and multiple medical ... Best is to use pivottable.which will sort and return the unique. ... Dim rng As Range ...
    (microsoft.public.excel.programming)