-
Hello, I want to extend an existing dataset in an already existing hdf5 file. I tried following the example of create_extensible_dataset.cpp, however I encounter the following error:
which seems the same error that this user encountered (on hdf5 forum). The solution is to H5Dwrite(dset, H5T_NATIVE_DOUBLE, mem_space, H5P_DEFAULT, hfield.getmemory()); Is there anyway to do this with HighFive without using the low level HDF5 library ? Here is the idea of the code that I use // somewhere before, I created a new dataset
HighFive::DataSpace dataspace({my_size}, {HighFive::DataSpace::UNLIMITED})
DataSet dataset = file.createDataSet(dataset_name, dataspace, create_datatype<double>(), props);
dataset.write(my_array);
// Now this part is executed later on, when the file has been closed before and reopened
DataSet dataset = file.getDataSet(dataset_name);
previous_size = dataset.getSpace().getDimensions()[0];
dataset.resize({ previous_size + my_new_array_size });
dataset.select({ previous_size }, { previous_size + my_new_array_size }).write(my_new_array, xfer_props); |
Beta Was this translation helpful? Give feedback.
Answered by
jokteur
Oct 3, 2024
Replies: 1 comment
-
I really should have re-read my code. dataset.select({ previous_size }, { previous_size + my_new_array_size }).write(my_new_array, xfer_props); instead of dataset.select({ previous_size }, { previous_size + my_new_array_size }).write(my_new_array, xfer_props); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jokteur
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I really should have re-read my code.
I should be doing
instead of