backwards compatibility and SWMR

131 views
Skip to first unread message

Samuel Lotz

unread,
Mar 7, 2019, 12:17:36 PM3/7/19
to h5py
I'm kind of confused with the designations of earliest and latest for libver. I wrote a bunch of files using the default settings ('earliest'). Can I open them with libver='latest' and write to them in SWMR mode? I have 1.10 installed but if I try to set swmr mode I get this error message with default libver='earliest':

In [40]: f.swmr_mode = True                                                                
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-40-51ff9809e37c> in <module>
----> 1 f.swmr_mode = True

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

~/anaconda3/envs/myenv/lib/python3.6/site-packages/h5py/_hl/files.py in swmr_mode(self, value)
    300             # pylint: disable=missing-docstring
    301             if value:
--> 302                 self.id.start_swmr_write()
    303                 self._swmr_mode = True
    304             else:

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/h5f.pyx in h5py.h5f.FileID.start_swmr_write()

ValueError: Unable to convert file format (file superblock version - should be at least 3)



Is there a way to check: 1) what libver you actually have a file open in? 2) Is there a way to find out which version a file was written with?

Also if anyone can explain what the deal with earliest and latest for libver means that be very helpful, I can't seem to find the answer here https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds

and if I check this attribute: 

In [95]: f = h5py.File('test.h5', mode='w', libver='latest')                               

In [96]: f.id.get_access_plist().get_libver_bounds()                                       
Out[96]: (2, 2)

In [97]: f.close()                                                                         

In [98]: f = h5py.File('test.h5', mode='w', libver='earliest')                             

In [99]: f.id.get_access_plist().get_libver_bounds()                                       
Out[99]: (0, 2)

I can see that the bounds change, but what actually is this indexing (if it is an index as I presume)?

~Sam
Reply all
Reply to author
Forward
0 new messages