cctbx / dxtbx

Diffraction Experiment Toolbox
BSD 3-Clause "New" or "Revised" License
2 stars 18 forks source link

Test for `H5Dread` capability #372

Closed dagewa closed 3 years ago

dagewa commented 3 years ago

CCP4 builds of DIALS often have failures in dxtbx that produce a fairly useless error message, like this:

RuntimeError: dxtbx Internal Error: /home/jenkins/workspace/CCP4/py3-g8-new/devtools/co/cctbx-packages/dxtbx/format/boost_python/nexus_ext.cc(126): DXTBX_ASSERT(status2 >= 0) failure.

It seems this is often (always?) a failure related to HDF5 plugins (see #102), but it isn't clear what exactly fails. The H5Dread function produces "a negative value" if it fails, but I haven't found anything that suggests that different negative values have any more detailed meaning about the mode of failure.

It would be useful if dxtbx had a test of that would specifically check which plugins are available. I'm not sure at this stage how to query plugin availability, other than trying to read with H5Dread and failing.

ndevenish commented 3 years ago

I have in the past discovered that apparently you can get useful error messages out of HDF5, but not by default, and it’s hard to get it to just print the useful parts e.g. the error trace you can get back from HDF5 for “no plugin” is mixed into:


  #000: H5Dio.c line 192 in H5Dread(): can't read data
    major: Dataset
    minor: Read failed
  #001: H5VLcallback.c line 2080 in H5VL_dataset_read(): dataset read failed
    major: Virtual Object Layer
    minor: Read failed
  #002: H5VLcallback.c line 2046 in H5VL__dataset_read(): dataset read failed
    major: Virtual Object Layer
    minor: Read failed
  #003: H5VLnative_dataset.c line 167 in H5VL__native_dataset_read(): can't read data
    major: Dataset
    minor: Read failed
  #004: H5Dio.c line 567 in H5D__read(): can't read data
    major: Dataset
    minor: Read failed
  #005: H5Dchunk.c line 2594 in H5D__chunk_read(): unable to read raw data chunk
    major: Low-level I/O
    minor: Read failed
  #006: H5Dchunk.c line 3957 in H5D__chunk_lock(): data pipeline read failed
    major: Dataset
    minor: Filter operation failed
  #007: H5Z.c line 1311 in H5Z_pipeline(): required filter 'bitshuffle; see https://github.com/kiyo-masui/bitshuffle' is not registered
    major: Data filters
    minor: Read failed
  #008: H5PLint.c line 274 in H5PL_load(): search in path table failed
    major: Plugin for dynamically loaded library
    minor: Can't get value
  #009: H5PLpath.c line 604 in H5PL__find_plugin_in_path_table(): search in path /usr/local/hdf5/lib/plugin encountered an error
    major: Plugin for dynamically loaded library
    minor: Can't get value
  #010: H5PLpath.c line 656 in H5PL__find_plugin_in_path(): can't open directory: /usr/local/hdf5/lib/plugin
    major: Plugin for dynamically loaded library
    minor: Can't open directory or file```
dagewa commented 3 years ago

Ah that's interesting though. Can this be coaxed out of our standard build, or does it need special compile time options?

dagewa commented 3 years ago

Ok, looks like this needs a call to H5Eprint. I'll try working that in just ahead of the DXTBX_ASSERT(status2 >= 0);. If this does give useful information then we don't really need a test for H5Dread capability because there are already tests that trigger this. We just need to know why they are failing.