Last modified: 25 October 2011
Name: H5Dget_storage_size
Signature:
hsize_t H5Dget_storage_size( hid_t dataset_id )

Purpose:
Returns the amount of storage allocated for a dataset.

Description:
H5Dget_storage_size returns the amount of storage, in bytes, that is allocated in the file for the raw data of the dataset specified by dataset_id.

Note that the amount of storage in this case is the storage allocated in the written file, which will typically differ from the space required to hold a dataset in working memory.

H5Dget_storage_size reports only the space required to store the data; the report does not include any metadata.

The return value may be zero if no data has been stored.

Caution:
Note that H5Dget_storage_size is not generally an appropriate function to use when determining the amount of memory required to work with a dataset. In such circumstances, you must determine the number of data points in a dataset and the size of an individual data element. H5Sget_simple_extent_npoints and H5Tget_size can be used to get that information.

Parameters:
hid_t dataset_id     IN: Identifier of the dataset to query.

Returns:
Returns the amount of storage space, in bytes, allocated for the dataset, not counting metadata; otherwise returns 0 (zero).

Note that H5Dget_storage_size does not differentiate between 0 (zero), the value returned for the storage size of a dataset with no stored values, and 0 (zero), the value returned to indicate an error.

Fortran90 Interface: h5dget_storage_size_f
SUBROUTINE h5dget_storage_size_f(dset_id, size, hdferr)
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: dset_id  ! Dataset identifier  
  INTEGER(HSIZE_T), INTENT(OUT)  :: size ! Amount of storage required 
                                         ! for dataset
  INTEGER, INTENT(OUT) :: hdferr         ! Error code  
                                         ! 0 on success and -1 on failure
END SUBROUTINE h5dget_storage_size_f
    

History:
Release     Fortran90
1.4.5 Function introduced in this release.