Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Possible HDF5 Reading Errors #32

Open
ranocha opened this issue Mar 15, 2019 · 2 comments
Open

Handle Possible HDF5 Reading Errors #32

ranocha opened this issue Mar 15, 2019 · 2 comments

Comments

@ranocha
Copy link
Member

ranocha commented Mar 15, 2019

We should check possible errors while reading (and writing) HDF5 files and print appropriate error messages. For example, if settings/kernel_settings is missing, I get the cryptic output

Available devices: 1
Intel(R) Core(TM) i5-4590S CPU @ 3.00GHz
OpenCL version: OpenCL 2.1 (Build 0)
Memory limit: 8279801856
WG limit: 8192

Reading kernel from file: copy_kernel_py2.cl... 
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140244994254656:
  #000: ../../../src/H5D.c line 296 in H5Dopen2(): unable to open dataset
    major: Dataset
    minor: Can't open object
  #001: ../../../src/H5Dint.c line 1463 in H5D__open_name(): not found
    major: Dataset
    minor: Object not found
  #002: ../../../src/H5Gloc.c line 430 in H5G_loc_find(): can't find object
    major: Symbol table
    minor: Object not found
  #003: ../../../src/H5Gtraverse.c line 869 in H5G_traverse(): internal path traversal failed
    major: Symbol table
    minor: Object not found
  #004: ../../../src/H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed
    major: Symbol table
    minor: Callback failed
  #005: ../../../src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 'kernel_settings' doesn't exist
    major: Symbol table
    minor: Object not found
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140244994254656:
  #000: ../../../src/H5D.c line 449 in H5Dget_type(): not a dataset
    major: Invalid arguments to routine
    minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140244994254656:
  #000: ../../../src/H5T.c line 2045 in H5Tis_variable_str(): not a datatype
    major: Invalid arguments to routine
    minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140244994254656:
  #000: ../../../src/H5D.c line 375 in H5Dget_space(): not a dataset
    major: Invalid arguments to routine
    minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (1.10.0-patch1) thread 140244994254656:
  #000: ../../../src/H5S.c line 865 in H5Sget_simple_extent_ndims(): not a dataspace
    major: Invalid arguments to routine
    minor: Inappropriate type
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
@philipheinisch
Copy link
Member

Maybe we could check, if the necessary entries are available and in the right format before we start reading in the configuration? This could be wrapped in some kind of helper function and would allow us to generate appropriate error messages and gracefully terminate execution.

@ranocha
Copy link
Member Author

ranocha commented Mar 15, 2019

That's a good idea. I would like to have informative error messages telling the user what to do. Nevertheless, we should add some error checks in the HDF5 functions.

I can do that next week.

ranocha added a commit to ranocha/toolkitICL that referenced this issue Mar 22, 2019
philipheinisch pushed a commit that referenced this issue Mar 23, 2019
* improved filename parsing; closes #31

* improved command line argument parsing; closes #34

* add more error checks in hdf5 read routines; cf. #32

* fix build on Travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants