SWMR start sequence in ver.2.0.0 (Fortran)

Hi.

In the Introduction to Single-Writer_Multiple-Reader (SWMR) (which is a little bit hard for me to read because of the lack of new line (e.g. before “Create a new file:“) and no distinction of appearance between explanation and code-snippets), we should

Call H5F_START_SWMR_WRITE to start SWMR access to the file.

With ver.1.14.6 of the library, I can do the following sequence:

     call H5Pset_libver_bounds_f(H5FAccProLst,
 &        H5F_LIBVER_LATEST_F,H5F_LIBVER_LATEST_F, h5error)
     call H5Fcreate_f(hdfoutname,
 &        IOR(H5F_ACC_TRUNC_F,INT(H5F_ACC_SWMR_WRITE_F)),
 &        h5fileId, h5error, H5FCreProLst, H5FAccProLst)

and later

     call H5Fstart_SWMR_write_f(h5fileId, h5error)

But with ver.2.0.0 the sequence above cause an error, saying that “file already in SWMR writing mode”, and I had to remove the call of H5Fstart_SWMR_write_f().

Has the policy been changed (from ver.2.0.0)? (In the User’s Guide there’s no call of H5Fstart_SWMR_write )

In what cases should we call the H5Fstart_SWMR_write?

By the way, in the sequence described in section 5.1 of the User’s Guide, the file is once closed (1.c.) and then reopen (2.a.). Are the close-(re)open steps essential for something? (it seems that the sequence written above (w/o the close-(re)open steps) is working

Hello

For both versions, when you call H5Fstart_swmr_write_f(), is the file still in the “open” state?

Thank you.

Yes.

Is the close-(re)open steps inevitable for some reasons?

Hello

I suggest creating the file in non-SWMR mode, create the datasets/groups and then call H5Fstart_swmr_write().

Thank you.