Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5P_GET_APPEND_FLUSH

Retrieves the values of the append property that is set up in the dataset access property list

Procedure:

H5P_GET_APPEND_FLUSH ( dapl_id, ndims, boundary, func, user_data )

Signature:

herr_t H5Pget_append_flush (
              hid_t dapl_id,  
              int ndims, 
              hsize_t boundary[], 
              H5D_append_cb_t  *func, 
              void **user_data
        )

NONE

Parameters:
id_t dapl_idIN: Dataset access property list identifier
int ndimsIN: The number of elements for boundary
hsize_t *boundary[]IN: The dimension sizes used to determine the boundary
H5D_append_cb_t *func   IN: The user-defined callback function
void **user_dataIN: The user-defined input data

Description:

H5P_GET_APPEND_FLUSH obtains the following information from the dataset access property list dapl_id:

boundary[]   

The sizes set up in the access property list that are used to determine when a dataset dimension size hits the boundary

Only at most ndims boundary sizes are retrieved, and ndims will not exceed the corresponding value that is set in the property list.

funcThe user-defined callback function to invoke when a dataset’s appended dimension size reaches a boundary
user_dataThe user-defined input data for the callback function

Returns:

Returns a non-negative value if successful; otherwise returns a negative value.

Example Usage:
The example below illustrates the usage of this public routine to obtain the append values that are set up in the dataset access property list.
hid_t file_id;
hid_t dapl_id, dataset_id, dapl;
hsize_t dims[2] = {0, 100};
hsize_t max_dims[2] = {H5S_UNLIMITED, 100};
hsize_t boundary_dims[2] = {5, 0};
int counter;
hsize_t ret_boundary[1];
H5D_append_flush_cb_t ret_cb;
void *ret_udata;

/* Open the file */
file_id = H5Fopen(FILE, H5F_ACC_RDWR|H5F_ACC_SWMR_WRITE, H5P_DEFAULT);

/* Create a copy of the dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);

/* Set up the append property values */
/* boundary_dims[0]=5: to invoke callback and flush every 5 lines */
/* boundary_dims[1]=0: no boundary is set for the non-extendible dimension */
/* append_cb: callback function to invoke when hitting boundary (see below) */
/* counter: user data to pass along to the callback function */
H5Pset_append_flush(dapl_id, 2, boundary_dims, append_cb, &counter);

/* DATASET is a 2-dimensional chunked dataset with dataspace: 
   dims[] and max_dims[] */
dataset_id = H5Dopen2(file_id, “dataset”, dapl_id);

/* Get the dataset access property list for DATASET */
dapl = H5Dget_access_plist(dataset_id);

/* Retrieve the append property values for the dataset */
/* Only 1 boundary size is retrieved: ret_boundary[0] is 5 */
/* ret_cb will point to append_cb() */
/* ret_udata will point to counter */
H5Pget_append_flush(dapl, 1, ret_boundary, &ret_cb, &ret_udata);
:
:
:

/* The callback function */
static herr_t
append_cb(hid_t dset_id, hsize_t *cur_dims, void *_udata)
{
    unsigned *count = (unsigned *)_udata;
    ++(*count++);
    return 0;
} /* append_cb() */

 

History:
Release    Change
1.10.0C function introduced with this release.

--- Last Modified: August 08, 2019 | 11:22 AM