- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Recently one of our developers wrote some code where a file that is already opened is opened (and read) again during this routine.
Neither g95 nor gfortran think that is acceptable. IVF lets it go by.
(open is read access, theoretically, I suppose it's okay. just doesn't seem like a good idea).
I think the standard leaves it up to the compiler.
Do IVF developers think this might be a bug in their compiler?
Linda
Neither g95 nor gfortran think that is acceptable. IVF lets it go by.
(open is read access, theoretically, I suppose it's okay. just doesn't seem like a good idea).
I think the standard leaves it up to the compiler.
Do IVF developers think this might be a bug in their compiler?
Linda
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the Intel Fortran Reference, Open Statement Overview:
The OPEN statement connects an external file to a unit, creates a new file and connects it to a unit, creates a preconnected file, or changes certain properties of a connection.
Note that OPEN may be used to change the properties of an existing connection, or to implicitly close the file to which the unit was previously connected and open a connection to the currently specified file.
The OPEN statement connects an external file to a unit, creates a new file and connects it to a unit, creates a preconnected file, or changes certain properties of a connection.
Note that OPEN may be used to change the properties of an existing connection, or to implicitly close the file to which the unit was previously connected and open a connection to the currently specified file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you open the same file on the same unit, that is the F77 feature "OPEN on a connected unit" (which I detest) - it lets you change certain attributes of the file. If you open a different file on a unit where a file is open, the old one is silently closed and the new one open.
If you're talking about opening the same file on different units, yes, we deliberately allow that if the OS does. Most OSes permit some sort of shared file access. You can control it with OPEN keywords. It is true that the standard disallows this, but that is a restriction on the program, not the compiler, and the compiler is not required to be able to diagnose that.
If you're talking about opening the same file on different units, yes, we deliberately allow that if the OS does. Most OSes permit some sort of shared file access. You can control it with OPEN keywords. It is true that the standard disallows this, but that is a restriction on the program, not the compiler, and the compiler is not required to be able to diagnose that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting Steve Lionel (Intel)
If you're talking about opening the same file on different units, yes, we deliberately allow that if the OS does. Most OSes permit some sort of shared file access. You can control it with OPEN keywords. It is true that the standard disallows this, but that is a restriction on the program, not the compiler, and the compiler is not required to be able to diagnose that.
Yes, talking about this one. So, it's "beyond" the standard and IVF is currently allowing that.
Thanks, Steve.
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>If you're talking about opening the same file on different units, yes, we deliberately allow that if the OS does.
This is a good feature, especially in light of multi-threaded applications whereby different threads in the application want to perform independent and non-conflicting buffered stream access to the same file (but at different locations within the file). Without this feature, excessive seeking on file access may occur.
Jim Dempsey
This is a good feature, especially in light of multi-threaded applications whereby different threads in the application want to perform independent and non-conflicting buffered stream access to the same file (but at different locations within the file). Without this feature, excessive seeking on file access may occur.
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page