detect member fields of compound datatype

Hi, everyone:

    I am confusing with compound datatype in HDF5! Recently I am working with HDF5 files with my C code, and when detecting datatypes of a dataset which is a compound type dataset, I find that using HDF5 APIs fail to get the correct number of fields in that datatype.

    My testing data is hdf5_test.h5, which is a sample file under Samples subfoler in my HDFView(v2.5) installation directory. There is a compound dataset named "ArrayOfStructures" in this file. In my C code I did :
    hid_t hDataType = H5Dget_type(DatasetID); //get dataset's datatype, and use it to get the class
    H5T_class_t tClass = H5Tget_class(hDataType); //with this, I use tClass == H5T_COMPOUND and find that it is compound type dataset.
    int nMems = H5Tget_nmembers(hDataType); //then I use this to get the number of member fields, it gets 4!!! This is different from what I saw in HDFView
    //In HDFView(2.5), this dataset has 5 member fields with names : a_name, c_name, b_name, nested_name->a_name, nested_name->c_name.
    //In my C code, I get 4 fields with names : a_name, c_name, b_name, nested_name.

    Can anyone figure out what's wrong with my code? Any help will be appreciated!

···

--

Hi all,

Below is the latest RFC on h5diff floating point data comparison.
http://www.hdfgroup.uiuc.edu/RFC/HDF5/h5diff/RFC_h5diff_floating_point_data_comparison.pdf

I would like to ask your feedback on what epsilon values to use in h5diff.

Thanks
--pc

There is a nested compound.

The members of the first level compound are a_name, c_name, b_name, and nested_name.
The members of nested_name (2nd level compound) are a_name and c_name.

HDFView does not deal with nested compound directly. I shows a nested compound as a
flat list of all members and submembers. "->" indicates a compound structure in HDFView.

Thanks
--pc

ĺÈçÑ© wrote:

···

Hi, everyone:
I am confusing with compound datatype in HDF5! Recently I am working with HDF5 files with my C code, and when detecting datatypes of a dataset which is a compound type dataset, I find that using HDF5 APIs fail to get the correct number of fields in that datatype.
My testing data is hdf5_test.h5, which is a sample file under Samples subfoler in my HDFView(v2.5) installation directory There is a compound dataset named "ArrayOfStructures" in this file. In my C code I did :
hid_t hDataType = H5Dget_type(DatasetID); //get dataset's datatype, and use it to get the class
H5T_class_t tClass = H5Tget_class(hDataType); //with this, I use tClass == H5T_COMPOUND and find that it is compound type dataset.
int nMems = H5Tget_nmembers(hDataType); //then I use this to get the number of member fields, it gets 4!!! This is different from what I saw in HDFView
//In HDFView(2.5), this dataset has 5 member fields with names : a_name, c_name, b_name, nested_name->a_name, nested_name->c_name.
//In my C code, I get 4 fields with names : a_name, c_name, b_name, nested_name.
Can anyone figure out what's wrong with my code? Any help will be appreciated!

--

------------------------------------------------------------------------
ÍøÒ×YEAH.NETÃâ·ÑÓÊÏ䣺ÄúµÄÖÕÉíÃâ·ÑÓÊÏä <http://www.yeah.net/?from=footer>
------------------------------------------------------------------------

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org