Hello All,

I am working with the C++ HDF5 API, and I am attempting to read in some simulation data.

I am able to open my file and open the appropriate data-set, but my problem occurs with the datatype being used.

I can verify that I am opening the correct data-set, but trying to use H5T_IEEE_F64LE gives me a segfault. Using NATIVE_FLOAT I am able to print out my data, but it is incorrect as this was not the format it was stored in., H5T_IEEE_F64LE); --> Does not load data segfault, H5T_NATIVE_FLOAT); --> Works, but data is not correct

Any help in resolving this is greatly appreciated!

Info: using h5++, hdf5 1.12


In, the DataType argument specifies the data type of the memory buffer, not the data type as stored in the file.

My guess is that you want to define rdata as double, not float, to avoid precision loss on an unwanted 64 to 32 bit automatic conversion. In that case, specify the DataType argument as H5T_NATIVE_DOUBLE, to match rdata.


Thank you for the answer! Changing rdata to double fixed the bit conversion problems also.