JuliaIO / JLD2.jl

HDF5-compatible file format in pure Julia
Other
534 stars 82 forks source link

Manually flush written data to file #555

Closed jebej closed 2 months ago

jebej commented 2 months ago

Hello, is it possible to flush already "written" data to a file, so that it may be opened and inspected (in read-only mode) by another process, without closing the file in the original process?

Thanks, Jeremy

JonasIsensee commented 2 months ago

Hi @jebej ,

JLD2 uses the hdf5 format which is hierarchical. It has something like a table of contents for each group (including the top level).

These are written or updated only when closing a file. If you want to read some data on one process while another might occasionally still write to it (A long running simulation code?)

Then it would be best to write the simulation code such that it always has the file closed and opens it in append mode to add data.

jebej commented 2 months ago

I see, thanks for the reply!