Hi Dana,
This sounds interesting to me. We have a Windows use case and I'd like to inquire to see if this new HDF5 release addresses it.
The problem we have involves multiple executables but only one writer.
We run Ale3d tutorials. Ale3d is a simulation application and it writes HDF5 files.
We view the resulting files in another application called VisIt.
The problem on Windows is that when VisIt has the file open for reading, a subsequent run of Ale3d is unable to write to the file until VisIt has closed it.
We don't need VisIt to see the new contents of the file until *after* VisIt re-opens the file. However, in this case, the problem is that because one application, VisIt, has the file open for reading, another application, Ale3d, is unable to open (and eventually overwrite) the file.
The behavior is specific to Windows. We don't have same issues on Linux or OS X.
Does newest feature you refer to here address this?
Mark
···
From: Hdf-forum <hdf-forum-bounces@lists.hdfgroup.org<mailto:hdf-forum-bounces@lists.hdfgroup.org>> on behalf of Dana Robinson <derobins@hdfgroup.org<mailto:derobins@hdfgroup.org>>
Reply-To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Date: Monday, November 16, 2015 9:58 AM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Subject: Re: [Hdf-forum] Multiply Opened Files
Hi David,
Yes, a similar mechanism to that used on POSIX is used on Windows. We use the file index and volume serial number to detect if a file is being re-opened, which should work on NTFS but has caveats on FAT-based systems. Keep in mind that this is only from the same process; we don't detect if files are open across processes. The upcoming 1.10.0 will include a file locking mechanism that should mitigate certain bad use cases like multiple processes opening a file for write access, though. That should work on Windows as well, though we are still in the process of generating a Win32 equivalent.
Dana Robinson
Software Engineer
The HDF Group
From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of David
Sent: Monday, November 16, 2015 12:46 PM
To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org<mailto:hdf-forum@lists.hdfgroup.org>>
Subject: [Hdf-forum] Multiply Opened Files
I found this in the reference manual about H5Fopen():
"In some cases, such as files on a local Unix file system, the HDF5 library can detect that a file is multiply opened and will maintain coherent access among the file identifiers"
Does HDF5 maintain multi-open coherent access on Windows also?
Ideally I'd like to have the file locked so that multiple opens are not possible but I can't figure out a way to do that on Windows. Something like the flock() method for Unix I've seen on this forum would be fine but I only see file locking available via CreateFile() in the Windows API.
- David