I am writing my own VTKHDF files. After a file is read into Paraview and later the display model is deleted from the display, I cannot write to the same VTKHDF file unit again until Paraview is completely shutdown. So, the running instance of Paraview is “holding on the HDF5 file pointer” or some similar operation.
The write error is:
HDF5-DIAG: Error detected in HDF5 (1.14.1-2) thread 0:
#000: /.../src/H5F.c line 660 in H5Fcreate(): unable to synchronously create file
major: File accessibility
minor: Unable to create file
... SNIP ...
If I delete the file after unloading it from Paraview, I am able to again write the without any HDF5 issues.
@mwestphal I can confirm this is not fixed in ParaView 6.0.0 on Windows. I still need to completely shut Paraview to overwrite a file, even if it has been removed from the pipeline browser. Using python and h5py to write the files.
File "...\writer\vtkhdf.py", line 212, in write_vtkhdf_file
with h5py.File(self.path, 'w') as f:
~~~~~~~~~^^^^^^^^^^^^^^^^
File "...\.venv\Lib\site-packages\h5py\_hl\files.py", line 564, in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "...\.venv\Lib\site-packages\h5py\_hl\files.py", line 244, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py\\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\\h5f.pyx", line 122, in h5py.h5f.create
OSError: [Errno 0] Unable to synchronously create file (unable to lock file, errno = 0, error message = 'No error', Win32 GetLastError() = 33)
Sorry for being unclear. If I write simualtion data out to a vtkhdf file (using python and h5py) and load it into paraview, i can view the results and data. Then I close the mesh in the pipeline viewer becuase I want to edit the data in the vtkhdf file or just overwrite it with a newer version with updated results.
However it is not possible as ParaView keeps a lock on the file until it is closed - you need to shit paraview completely, even if you have other data you are still working on, to overwrite the vtkhdf file.
If you close paraview, then you can edit or overwrite the vtkhdf file.
But I guess the difference is that you are doing all of that within ParaView? Once I close the file in the pipline browser I am opening, editing or overwriting in another external software.
My workflow is slightly different:
Simulation solver writes .vtkhdf file
Open in ParaView and visulaise .vtkhdf file
Close in Paraview pipeline browser when done
Open python kernel in vscode and attempt to edit/overwrite .vtkhdf file
– this is when the error is thrown by vscode or pycharm
Although the file is closed in ParaView, it seem to have kept a lock on the file and prevents the write. As the original post says, if you want to write to the file you first need to delete the file if you leave ParaView open or else close ParaView.