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

Exception when using append API with clang #69

Closed
mohabouje opened this issue Dec 23, 2020 · 3 comments
Closed

Exception when using append API with clang #69

mohabouje opened this issue Dec 23, 2020 · 3 comments

Comments

@mohabouje
Copy link

Thanks for this amazing job, It's by far the cleanest interface to interact with HDF5 in C++ that I've seen so far.

My idea is to create a dataset with N columns and an unlimited number of rows to append data from a sensor. I'm trying to run a simple example to append data into an existing dataset.

#include <h5cpp/all>
#include <filesystem>

int main() {
    h5::fd_t fd = h5::create("example.h5", H5F_ACC_TRUNC);
    std::vector<int> stream(83);
    std::iota(std::begin(stream), std::end(stream), 1);
    h5::pt_t pt = h5::create<int>(fd, "stream of integral", h5::max_dims{H5S_UNLIMITED, 3, 5},
                                  h5::chunk{2, 3, 5} | h5::gzip{9} | h5::fill_value<int>(3));
    for (auto record : stream) {
        h5::append(pt, record);
    }
}

I'm getting this exception:

C++ exception with description "h5cpp/h5cpp/H5Dappend.hpp line#  105 : CTOR: unable to create handle from dataset..." 

I'm using:

  • Clang version 11.0.3 (clang-1103.0.32.62)
  • libc++ version 9000
  • hdf5/1.10.6
  • Compiling with C++17 standard
@steven-varga
Copy link
Owner

Thank you for the interest! On spack I found [email protected]+shared_libs or master branch, will be using the former, with [email protected]%[email protected]~cxx~debug~fortran~hl~java~mpi+pic+shared+szip~threadsafe api=v110
Let me recreate the environment, confirm the issue, and will let you know if I can fix this before the upcoming Canadian holidays.

@steven-varga
Copy link
Owner

H5CPP with LLVM 11.0.0

Hi, it works for me with llvm 11.0.0 , you find the source and details here

Other than something is wrong with your setup, keep in mind append is like push for a stack datastructure, each row should be conveniently organised for retrieval -- often in a struct data structure.

anyhow, here is the dump:

h5dump  example.h5 
HDF5 "example.h5" {
GROUP "/" {
   DATASET "stream of integral" {
      DATATYPE  H5T_STD_I32LE
      DATASPACE  SIMPLE { ( 6, 3, 5 ) / ( H5S_UNLIMITED, 3, 5 ) }
      DATA {
      (0,0,0): 1, 2, 3, 4, 5,
      (0,1,0): 6, 7, 8, 9, 10,
      (0,2,0): 11, 12, 13, 14, 15,
      (1,0,0): 16, 17, 18, 19, 20,
      (1,1,0): 21, 22, 23, 24, 25,
      (1,2,0): 26, 27, 28, 29, 30,
      (2,0,0): 31, 32, 33, 34, 35,
      (2,1,0): 36, 37, 38, 39, 40,
      (2,2,0): 41, 42, 43, 44, 45,
      (3,0,0): 46, 47, 48, 49, 50,
      (3,1,0): 51, 52, 53, 54, 55,
      (3,2,0): 56, 57, 58, 59, 60,
      (4,0,0): 61, 62, 63, 64, 65,
      (4,1,0): 66, 67, 68, 69, 70,
      (4,2,0): 71, 72, 73, 74, 75,
      (5,0,0): 76, 77, 78, 79, 80,
      (5,1,0): 81, 82, 83, 3, 3,
      (5,2,0): 3, 3, 3, 3, 3
      }
   }
}
}

Merry Christmas/Happy Holidays: steve

@mohabouje
Copy link
Author

Thanks looks like a downgrade of the LLVM environment solved the issue.

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