Retrieve property list from object


#1

Hi,

Is there a way to retrieve property list from object? For example:

I open file, then I can see that there is a dataset, I open the dataset and I need to check is it chunked or not.
I expect that I need to use int H5Pget_chunk(hid_t plist, int max_ndims, hsize_t * dims) but plist arg is dataset creation property list that were used to create that dataset. How can I get that plist from dataset?

Regards,
kerim


#2

Hi @kerim.khemraev,

If your goal is to check whether a dataset is chunked or not, you may want to give HDFql a try and do the following in C (which seems to be the programming language you are using):

// get storage type of dataset 'dset' stored in HDF5 file 'file.h5'
hdfql_execute("SHOW STORAGE TYPE file.h5 dset")

hdfql_cursor_first(NULL);

if (*hdfql_cursor_get_int(NULL) == HDFQL_CHUNKED)
{
    printf("Dataset is chunked!\n");
}
else
{
    printf("Dataset is not chunked!\n");
}

Hope it helps!


#3

Thank you but even I don’t fully understand what is HDFql I’m unable to use external libraries. Thus I’m sticked to HDF5 C library.

I need to understand how to retrieve properties from object in general, not only chunk


#4

Have a look at the H5[A,D,F,G,M,T]get_[access,create]_plist functions. For example, to obtain the chunk size for a dataset you would:

  1. Obtain a dataset creation property list handle via H5Dget_create_plist
  2. Use H5Pget_chunk to retrieve the chunk shape

OK?

G.


#5

Thank you very much!
I believe this should work but I’m able to test it only after few days.
I will report here on my success


#6

Thank you a lot! that worked

By the way to check whether the dataset is chunked is possible with H5Pget_layout