Hi all,

sorry for the delayed response.

John, AFAIK the restriction on not being able to open a write handle on a
file when a read handle is open is impose by HDF5. At the OS level it is up
to the flags passed to the CreateFile function how it will behave. In that
case you can very well open handles that all read, write - or any
combination thereof - to the file. My own locking mechanism locks the file
before it is needed. Locking guarantees that a handle with proper semantics
for the operation can be acquired.

Mark,

unless you're doing it on purpose you must be using the Windows native
functions. In that case you'd confront the problem that many people have
that writing in an HDF5 file from different threads or processes is not
synchronised. I think the error you get means that you open the file from
somewhere else and keep the file open but I believe this should work if it
was the HDF5 handle. The windows driver uses _open in a permissive way.

2010/5/20 Biddiscombe, John A. <[email protected]>

> Mark
>
> > For example, I
> > could inadvertently be using sec2 VFD when running on Windows. Could
> > that be the source of the problem?
>
> In the most recent hdf5 source base, (certainly the cmakeified version I'm
> using) - The default VFD is set to ... (some stuff snipped out)
> IF (WINDOWS)
>  SET (H5_HAVE_WINDOWS 1)
>  SET (H5_DEFAULT_VFD H5FD_WINDOWS)
> ELSE (WINDOWS)
>  SET (H5_DEFAULT_VFD H5FD_SEC2)
> ENDIF (WINDOWS)
>
> So unless the application is setting it manually, then the windows VFD
> should be used. If it isn't using it, I'm not sure how you'd know - can
> debug messages be enabled?
>
> I'm surprised that Dimitris is not getting a locking issue, I've always
> found that windows stops you writing to a file once another app has it open.
> If the post-processing app Opens/Reads/Closes the file as quickly as
> possible, and the simulation doesn't write whilst it is open, all should be
> fine. How one synchronizes is a good question though.
>
> However, if it is using another VFD, one option (that is a bit drastic) -
> If you don't have the source to the application and it is using a DLL, you
> could recompile the hdf5 lib, force the Windows VFD to be used (by
> overriding any calls to set_fapl code) and then replace the hdf5 dll with
> your 'modified' version.
>
> JB
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to