H5Dread get data incompletely


#1

I want to read h5 file in C. Here is my code to read a compound dataset. I have 7 members in structure “Boundary”, which are floats or integers. However i can’t get the last member from H5Dread. The other 6 members have been read properly. I’ve checked with h5dump.exe, the h5 file is fine.
Have i done something wrong in my code?
´´´
Boundary **boundaries;
hid_t dset = H5Dopen(group, “Boundaries”, H5P_DEFAULT);
hid_t space = H5Dget_space(dset);
H5Sget_simple_extent_dims(space, dims, NULL);
hid_t type = H5Dget_type(dset);
hid_t memtype = H5Tcreate(H5T_COMPOUND, sizeof(Boundary));
int nmenber = H5Tget_nmembers(type);
for (int i = 0; i < nmenber; i++) {
const char *name = H5Tget_member_name(type, i);
size_t offset = H5Tget_member_offset(type, i);
hid_t membertype = H5Tget_member_type(type, i);
status = H5Tinsert(memtype, name, offset, membertype);
}
*boundaries = (Boundary *)malloc(dims[0] * sizeof(Boundary));
status = H5Dread(dset, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, *boundaries);

´´´