2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-12 17:31:09 +08:00

[svn-r4324] Purpose:

New Features!
Description:
    Start migrating the internal use of property lists in the library from the
    older implementation to the new generic property lists.

    Currently, only the dataset transfer property lists are migrated to the
    new architecture, all the rest of the property list types are still using
    the older architecture.

    Also, the backward compatibility features are not implemented yet, so
    applications which use dataset transfer properties may need to make the
    following changes:
        H5Pcreate(H5P_DATASET_XFER) -> H5Pcreate_list(H5P_DATASET_XFER_NEW)
            and
        H5Pclose(<a dataset transfer property list>) -> H5Pclose_list(id)

    This still may have some bugs in it, especially with Fortran, but I should
    be wrapping up those later today.

Platforms tested:
    FreeBSD 4.4 (hawkwind)
This commit is contained in:
Quincey Koziol 2001-08-10 15:47:05 -05:00
parent 4049965d13
commit 95862451f7
40 changed files with 1883 additions and 809 deletions

@ -14,7 +14,7 @@ namespace H5 {
const DSetMemXferPropList DSetMemXferPropList::DEFAULT( H5P_DEFAULT );
// Creates a dataset memory and transfer property list
DSetMemXferPropList::DSetMemXferPropList() : PropList( H5P_DATASET_XFER ) {}
DSetMemXferPropList::DSetMemXferPropList() : PropList( H5P_DATASET_XFER_NEW ) {}
// Copy constructor: makes a copy of the original DSetMemXferPropList object;
DSetMemXferPropList::DSetMemXferPropList( const DSetMemXferPropList& orig ) : PropList( orig ) {}

@ -39,7 +39,20 @@ Description:
the identifier still has reference counter; the p_close function
will take care of not to call H5Pclose on the default id.
*/
PropList::PropList( const hid_t plist_id ) : IdComponent( plist_id ) { }
PropList::PropList( const hid_t plist_id ) : IdComponent()
{
if (H5I_GENPROP_CLS == H5Iget_type(plist_id)) {
// call C routine to create the new property
id = H5Pcreate_list(plist_id);
if( id <= 0 )
{
throw PropListIException("PropList constructor", "H5Pcreate_list failed");
}
}
else {
id=plist_id;
}
}
// Makes a copy of an existing property list
void PropList::copy( const PropList& like_plist )
@ -77,10 +90,17 @@ void PropList::p_close() const
{
if( id != H5P_DEFAULT ) // not a constant, should call H5Pclose
{
herr_t ret_value = H5Pclose( id );
herr_t ret_value;
if (H5I_GENPROP_LST == H5Iget_type(id)) {
ret_value = H5Pclose_list( id );
} else {
ret_value = H5Pclose( id );
}
if( ret_value < 0 )
{
throw PropListIException(NULL, "H5Pclose failed" );
throw PropListIException(NULL, "property list close failed" );
}
}
}

1
src/.indent.pro vendored

@ -65,7 +65,6 @@
-T H5D_create_t
-T H5D_layout_t
-T H5D_t
-T H5D_xfer_t
-T H5E_error_t
-T H5E_major_mesg_t
-T H5E_major_t

@ -111,24 +111,26 @@ H5_init_library(void)
* Initialize interfaces that might not be able to initialize themselves
* soon enough. The file & dataset interfaces must be initialized because
* calling H5Pcreate() might require the file/dataset property classes to be
* initialized.
* initialized. The property interface must be initialized before the file
* & dataset interfaces though, in order to provide them with the proper
* property classes.
*/
if (H5P_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize property list interface");
}
if (H5F_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize file interface");
}
if (H5T_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize type interface");
"unable to initialize datatype interface");
}
if (H5D_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize dataset interface");
}
if (H5P_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize property list interface");
}
/* Debugging? */
H5_debug_mask("-all");

@ -338,7 +338,7 @@ H5B_load(H5F_t *f, haddr_t addr, const void *_type, void *udata)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, H5P_DEFAULT, bt->page)<0) {
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, H5P_DATASET_XFER_DEFAULT, bt->page)<0) {
HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL,
"can't read B-tree node");
}
@ -487,7 +487,7 @@ H5B_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5B_t *bt)
if (IS_H5FD_MPIO(f))
H5FD_mpio_tas_allsame(f->shared->lf, TRUE); /* only p0 will write */
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_BTREE, addr, size, H5P_DEFAULT, bt->page)<0) {
if (H5F_block_write(f, H5FD_MEM_BTREE, addr, size, H5P_DATASET_XFER_DEFAULT, bt->page)<0) {
HRETURN_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL,
"unable to save B-tree node to disk");
}

405
src/H5D.c

@ -16,7 +16,8 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Dprivate.h" /* Dataset functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /*Free Lists */
#include "H5FDprivate.h" /* File drivers */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Gprivate.h" /* Group headers */
#include "H5HLprivate.h" /* Name heap */
#include "H5MMprivate.h" /* Memory management */
@ -72,33 +73,6 @@ const H5D_create_t H5D_create_dflt = {
{0, 0, NULL} /* No filters in pipeline */
};
/* Default data transfer property list */
/* Not const anymore because some of the VFL drivers modify this struct - QAK */
H5D_xfer_t H5D_xfer_dflt = {
1024*1024, /*Temporary buffer size */
NULL, /*Type conversion buffer or NULL */
NULL, /*Background buffer or NULL */
H5T_BKG_NO, /*Type of background buffer needed */
{0.1, 0.5, 0.9}, /*B-tree node splitting ratios */
#ifndef H5_HAVE_PARALLEL
1, /*Cache the hyperslab blocks */
#else
0, /*Don't cache the hyperslab blocks */
#endif /* H5_HAVE_PARALLEL */
0, /*No limit on hyperslab block size to cache */
1024, /*Number of I/O vectors for hyperslabs */
NULL, /*Use malloc() for VL data allocations */
NULL, /*No information needed for malloc() calls */
NULL, /*Use free() for VL data frees */
NULL, /*No information needed for free() calls */
H5FD_VFD_DEFAULT, /*See H5Pget_driver() */
NULL, /*No file driver-specific information yet */
#ifdef COALESCE_READS
0, /*coalesce single reads into a read */
/*transaction */
#endif
};
/* Interface initialization? */
static intn interface_initialize_g = 0;
#define INTERFACE_INIT H5D_init_interface
@ -165,18 +139,110 @@ DESCRIPTION
static herr_t
H5D_init_interface(void)
{
H5P_genclass_t *pclass; /* Property list class to modify */
hsize_t def_max_temp_buf=H5D_XFER_MAX_TEMP_BUF_DEF; /* Default value for maximum temp buffer size */
void *def_tconv_buf=H5D_XFER_TCONV_BUF_DEF; /* Default value for type conversion buffer */
void *def_bkgr_buf=H5D_XFER_BKGR_BUF_DEF; /* Default value for background buffer */
H5T_bkg_t def_bkgr_buf_type=H5D_XFER_BKGR_BUF_TYPE_DEF; /* Default value for background buffer type */
double def_btree_split_ratio[3]=H5D_XFER_BTREE_SPLIT_RATIO_DEF; /* Default value for B-tree node split ratios */
uintn def_hyper_cache=H5D_XFER_HYPER_CACHE_DEF; /* Default value for hyperslab caching */
uintn def_hyper_cache_lim=H5D_XFER_HYPER_CACHE_LIM_DEF; /* Default value for hyperslab cache limit */
H5MM_allocate_t def_vlen_alloc=H5D_XFER_VLEN_ALLOC_DEF; /* Default value for vlen allocation function */
void *def_vlen_alloc_info=H5D_XFER_VLEN_ALLOC_INFO_DEF; /* Default value for vlen allocation information */
H5MM_free_t def_vlen_free=H5D_XFER_VLEN_FREE_DEF; /* Default value for vlen free function */
void *def_vlen_free_info=H5D_XFER_VLEN_FREE_INFO_DEF; /* Default value for vlen free information */
hid_t def_vfl_id=H5D_XFER_VFL_ID_DEF; /* Default value for file driver ID */
void *def_vfl_info=H5D_XFER_VFL_INFO_DEF; /* Default value for file driver info */
#ifdef COALESCE_READS
uintn def_gather_reads=H5D_XFER_GATHER_READS_DEF; /* Default value for 'gather reads' property */
#endif /* COALESCE_READS */
size_t def_hyp_vec_size=H5D_XFER_HYPER_VECTOR_SIZE_DEF; /* Default value for vector size */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5D_init_interface, FAIL);
/* Initialize the atom group for the dataset IDs */
if (H5I_init_group(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS,
(H5I_free_t)H5D_close)<0) {
HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to initialize interface");
}
/* Register the default dataset creation & data xfer properties */
FUNC_LEAVE(SUCCEED);
/* Register the default dataset creation properties */
assert(H5P_CLS_DATASET_XFER_g!=(-1));
/* Get the pointer to the dataset creation class */
if (H5I_GENPROP_CLS != H5I_get_type(H5P_CLS_DATASET_XFER_g) || NULL == (pclass = H5I_object(H5P_CLS_DATASET_XFER_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class");
/* Register the max. temp buffer size property */
if(H5P_register(pclass,H5D_XFER_MAX_TEMP_BUF_NAME,H5D_XFER_MAX_TEMP_BUF_SIZE,&def_max_temp_buf,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the type conversion buffer property */
if(H5P_register(pclass,H5D_XFER_TCONV_BUF_NAME,H5D_XFER_TCONV_BUF_SIZE,&def_tconv_buf,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the background buffer property */
if(H5P_register(pclass,H5D_XFER_BKGR_BUF_NAME,H5D_XFER_BKGR_BUF_SIZE,&def_bkgr_buf,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the background buffer type property */
if(H5P_register(pclass,H5D_XFER_BKGR_BUF_TYPE_NAME,H5D_XFER_BKGR_BUF_TYPE_SIZE,&def_bkgr_buf_type,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the B-Tree node splitting ratios property */
if(H5P_register(pclass,H5D_XFER_BTREE_SPLIT_RATIO_NAME,H5D_XFER_BTREE_SPLIT_RATIO_SIZE,&def_btree_split_ratio,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the hyperslab caching property */
if(H5P_register(pclass,H5D_XFER_HYPER_CACHE_NAME,H5D_XFER_HYPER_CACHE_SIZE,&def_hyper_cache,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the hyperslab cache limit property */
if(H5P_register(pclass,H5D_XFER_HYPER_CACHE_LIM_NAME,H5D_XFER_HYPER_CACHE_LIM_SIZE,&def_hyper_cache_lim,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the vlen allocation function property */
if(H5P_register(pclass,H5D_XFER_VLEN_ALLOC_NAME,H5D_XFER_VLEN_ALLOC_SIZE,&def_vlen_alloc,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the vlen allocation information property */
if(H5P_register(pclass,H5D_XFER_VLEN_ALLOC_INFO_NAME,H5D_XFER_VLEN_ALLOC_INFO_SIZE,&def_vlen_alloc_info,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the vlen free function property */
if(H5P_register(pclass,H5D_XFER_VLEN_FREE_NAME,H5D_XFER_VLEN_FREE_SIZE,&def_vlen_free,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the vlen free information property */
if(H5P_register(pclass,H5D_XFER_VLEN_FREE_INFO_NAME,H5D_XFER_VLEN_FREE_INFO_SIZE,&def_vlen_free_info,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the file driver ID property */
if(H5P_register(pclass,H5D_XFER_VFL_ID_NAME,H5D_XFER_VFL_ID_SIZE,&def_vfl_id,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the file driver info property */
if(H5P_register(pclass,H5D_XFER_VFL_INFO_NAME,H5D_XFER_VFL_INFO_SIZE,&def_vfl_info,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
#ifdef COALESCE_READS
/* Register the 'gather reads' property */
if(H5P_register(pclass,H5D_XFER_GATHER_READS_NAME,H5D_XFER_GATHER_READS_SIZE,&def_gather_reads,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
#endif /* COALESCE_READS */
/* Register the vector size property */
if(H5P_register(pclass,H5D_XFER_HYPER_VECTOR_SIZE_NAME,H5D_XFER_HYPER_VECTOR_SIZE_SIZE,&def_hyp_vec_size,NULL,NULL,NULL,NULL,NULL,NULL)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class");
/* Register the default data transfer property list */
if ((H5P_LST_DATASET_XFER_g = H5Pcreate_list (H5P_CLS_DATASET_XFER_g))<0)
HRETURN_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register default property list");
done:
FUNC_LEAVE(ret_value);
}
@ -214,6 +280,108 @@ H5D_term_interface(void)
return n;
}
/*-------------------------------------------------------------------------
* Function: H5D_xfer_create
*
* Purpose: Callback routine which is called whenever any dataset transfer
* property list is created. This routine performs any generic
* initialization needed on the properties the library put into
* the list.
* Right now, it's just allocating the driver-specific dataset
* transfer information.
*
* Return: Success: Non-negative
*
* Failure: Negative
*
* Programmer: Quincey Koziol
* Thursday, August 2, 2001
*
* Notes: This same routine is currently used for the 'copy' callback.
* Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t
H5D_xfer_create(hid_t dxpl_id, void UNUSED *create_data)
{
hid_t driver_id; /* VFL driver ID */
void *driver_info; /* VFL driver info */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5D_xfer_create, FAIL);
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &driver_info)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we have a valid driver ID */
if(driver_id>0) {
/* Increment the reference count on the driver and copy the driver info */
if(H5I_inc_ref(driver_id)<0)
HGOTO_ERROR (H5E_DATASET, H5E_CANTINC, FAIL, "Can't increment VFL driver ID");
if((driver_info = H5FD_dxpl_copy(driver_id, driver_info))==NULL)
HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, FAIL, "Can't copy VFL driver");
/* Set the driver information for the new property list */
if(H5P_set(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "Can't set VFL driver ID");
if(H5P_set(dxpl_id, H5D_XFER_VFL_INFO_NAME, &driver_info)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "Can't set VFL driver info");
} /* end if */
done:
FUNC_LEAVE(ret_value);
} /* end H5D_xfer_create() */
/*-------------------------------------------------------------------------
* Function: H5D_xfer_close
*
* Purpose: Callback routine which is called whenever any dataset transfer
* property list is closed. This routine performs any generic
* cleanup needed on the properties the library put into the list.
* Right now, it's just freeing the driver-specific dataset
* transfer information.
*
* Return: Success: Non-negative
*
* Failure: Negative
*
* Programmer: Quincey Koziol
* Wednesday, July 11, 2001
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
herr_t
H5D_xfer_close(hid_t dxpl_id, void UNUSED *close_data)
{
hid_t driver_id; /* VFL driver ID */
void *driver_info; /* VFL driver info */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER(H5D_xfer_close, FAIL);
if(H5Pget(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
if(H5Pget(dxpl_id, H5D_XFER_VFL_INFO_NAME, &driver_info)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
if(driver_id>0) {
if(H5FD_dxpl_free(driver_id, driver_info)<0)
HGOTO_ERROR (H5E_DATASET, H5E_CANTFREE, FAIL, "Can't free VFL driver");
if(H5I_dec_ref(driver_id)<0)
HGOTO_ERROR (H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement VFL driver ID");
} /* end if */
done:
FUNC_LEAVE(ret_value);
} /* end H5D_xfer_close() */
/*-------------------------------------------------------------------------
* Function: H5Dcreate
@ -671,17 +839,17 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
/* check arguments */
if (H5I_DATASET != H5I_get_type(dset_id) ||
NULL == (dset = H5I_object(dset_id)) ||
NULL == dset->ent.file) {
NULL == (dset = H5I_object(dset_id)) ||
NULL == dset->ent.file) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
}
if (H5I_DATATYPE != H5I_get_type(mem_type_id) ||
NULL == (mem_type = H5I_object(mem_type_id))) {
NULL == (mem_type = H5I_object(mem_type_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
}
if (H5S_ALL != mem_space_id) {
if (H5I_DATASPACE != H5I_get_type(mem_space_id) ||
NULL == (mem_space = H5I_object(mem_space_id))) {
NULL == (mem_space = H5I_object(mem_space_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
}
/* Check for valid selection */
@ -692,7 +860,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
}
if (H5S_ALL != file_space_id) {
if (H5I_DATASPACE != H5I_get_type(file_space_id) ||
NULL == (file_space = H5I_object(file_space_id))) {
NULL == (file_space = H5I_object(file_space_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
}
/* Check for valid selection */
@ -701,18 +869,21 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
"selection+offset not within extent");
}
}
if (H5P_DEFAULT != plist_id && H5P_DATASET_XFER != H5P_get_class(plist_id)) {
/* Get the default dataset transfer property list if the user didn't provide one */
if (H5P_DEFAULT == plist_id)
plist_id= H5P_DATASET_XFER_DEFAULT;
if (H5I_GENPROP_LST != H5I_get_type(plist_id) ||
TRUE!=H5Pisa_class(plist_id,H5P_DATASET_XFER_NEW))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (!buf) {
if (!buf)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer");
}
/* read raw data */
if (H5D_read(dset, mem_type, mem_space, file_space, plist_id,
buf/*out*/) < 0) {
if (H5D_read(dset, mem_type, mem_space, file_space, plist_id, buf/*out*/) < 0)
HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data");
}
FUNC_LEAVE(SUCCEED);
}
@ -766,17 +937,17 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
/* check arguments */
if (H5I_DATASET != H5I_get_type(dset_id) ||
NULL == (dset = H5I_object(dset_id)) ||
NULL == dset->ent.file) {
NULL == (dset = H5I_object(dset_id)) ||
NULL == dset->ent.file) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
}
if (H5I_DATATYPE != H5I_get_type(mem_type_id) ||
NULL == (mem_type = H5I_object(mem_type_id))) {
NULL == (mem_type = H5I_object(mem_type_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
}
if (H5S_ALL != mem_space_id) {
if (H5I_DATASPACE != H5I_get_type(mem_space_id) ||
NULL == (mem_space = H5I_object(mem_space_id))) {
NULL == (mem_space = H5I_object(mem_space_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
}
/* Check for valid selection */
@ -787,7 +958,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
}
if (H5S_ALL != file_space_id) {
if (H5I_DATASPACE != H5I_get_type(file_space_id) ||
NULL == (file_space = H5I_object(file_space_id))) {
NULL == (file_space = H5I_object(file_space_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space");
}
/* Check for valid selection */
@ -796,18 +967,21 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
"selection+offset not within extent");
}
}
if (H5P_DEFAULT != plist_id && H5P_DATASET_XFER != H5P_get_class(plist_id)) {
/* Get the default dataset transfer property list if the user didn't provide one */
if (H5P_DEFAULT == plist_id)
plist_id= H5P_DATASET_XFER_DEFAULT;
if (H5I_GENPROP_LST != H5I_get_type(plist_id) ||
TRUE!=H5Pisa_class(plist_id,H5P_DATASET_XFER_NEW))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (!buf) {
if (!buf)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no output buffer");
}
/* write raw data */
if (H5D_write(dset, mem_type, mem_space, file_space, plist_id,
buf) < 0) {
if (H5D_write(dset, mem_type, mem_space, file_space, plist_id, buf) < 0)
HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data");
}
FUNC_LEAVE(SUCCEED);
}
@ -1572,7 +1746,6 @@ herr_t
H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/)
{
const H5D_xfer_t *xfer_parms = NULL;
hssize_t nelmts; /*number of elements */
hsize_t smine_start; /*strip mine start loc */
hsize_t n, smine_nelmts; /*elements per strip */
@ -1609,20 +1782,14 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
assert(dataset && dataset->ent.file);
assert(mem_type);
assert(buf);
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
/* Initialize these before any errors can occur */
HDmemset(&mem_iter,0,sizeof(H5S_sel_iter_t));
HDmemset(&bkg_iter,0,sizeof(H5S_sel_iter_t));
HDmemset(&file_iter,0,sizeof(H5S_sel_iter_t));
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATASET_XFER != H5P_get_class(dxpl_id) ||
NULL == (xfer_parms = H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (!file_space) {
if (NULL==(free_this_space=H5S_read (&(dataset->ent)))) {
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
@ -1636,13 +1803,12 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5_HAVE_PARALLEL
/* Collect Parallel I/O information for possible later use */
if (H5FD_MPIO==xfer_parms->driver_id){
if (H5FD_MPIO==H5P_peek_hid_t(dxpl_id,H5D_XFER_VFL_ID_NAME)) {
doing_mpio++;
if (dx=xfer_parms->driver_info){
if (dx=H5P_peek_voidp(dxpl_id,H5D_XFER_VFL_INFO_NAME))
xfer_mode = dx->xfer_mode;
}else
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to retrieve data xfer info");
else
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to retrieve data xfer info");
}
/* Collective access is not permissible without the MPIO driver */
if (doing_mpio && xfer_mode==H5FD_MPIO_COLLECTIVE &&
@ -1790,7 +1956,7 @@ printf("%s: check 1.2, \n",FUNC);
src_type_size = H5T_get_size(dataset->type);
dst_type_size = H5T_get_size(mem_type);
target_size = xfer_parms->buf_size;
target_size = H5P_peek_hsize_t(dxpl_id,H5D_XFER_MAX_TEMP_BUF_NAME);
#ifdef QAK
printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUNC,(int)src_type_size,(int)dst_type_size,(int)target_size);
#endif /* QAK */
@ -1812,11 +1978,14 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
* same size over and over.
*/
if (tpath->cdata.need_bkg) {
need_bkg = MAX(tpath->cdata.need_bkg, xfer_parms->need_bkg);
/* Retrieve the bkgr buffer property */
if(H5Pget(dxpl_id, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type");
need_bkg = MAX(tpath->cdata.need_bkg, need_bkg);
} else {
need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/
}
if (NULL==(tconv_buf=xfer_parms->tconv_buf)) {
if (NULL==(tconv_buf=H5P_peek_voidp(dxpl_id,H5D_XFER_TCONV_BUF_NAME))) {
#ifdef QAK
printf("%s: check 3.1, allocating conversion buffer\n",FUNC);
#endif
@ -1825,7 +1994,7 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
if (need_bkg && NULL==(bkg_buf=xfer_parms->bkg_buf)) {
if (need_bkg && NULL==(bkg_buf=H5P_peek_voidp(dxpl_id,H5D_XFER_BKGR_BUF_NAME))) {
#ifdef QAK
printf("%s: check 3.2, allocating conversion buffer\n",FUNC);
#endif
@ -1974,13 +2143,16 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
H5S_sel_iter_release(mem_space,&mem_iter);
H5S_sel_iter_release(mem_space,&bkg_iter);
if (src_id >= 0) H5I_dec_ref(src_id);
if (dst_id >= 0) H5I_dec_ref(dst_id);
if (tconv_buf && NULL==xfer_parms->tconv_buf)
if (src_id >= 0)
H5I_dec_ref(src_id);
if (dst_id >= 0)
H5I_dec_ref(dst_id);
if (tconv_buf && NULL==H5P_peek_voidp(dxpl_id,H5D_XFER_TCONV_BUF_NAME))
H5FL_BLK_FREE(type_conv,tconv_buf);
if (bkg_buf && NULL==xfer_parms->bkg_buf)
if (bkg_buf && NULL==H5P_peek_voidp(dxpl_id,H5D_XFER_BKGR_BUF_NAME))
H5FL_BLK_FREE(bkgr_conv,bkg_buf);
if (free_this_space) H5S_close(free_this_space);
if (free_this_space)
H5S_close(free_this_space);
FUNC_LEAVE(ret_value);
}
@ -2021,7 +2193,6 @@ herr_t
H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
const H5S_t *file_space, hid_t dxpl_id, const void *buf)
{
const H5D_xfer_t *xfer_parms = NULL;
hssize_t nelmts; /*total number of elmts */
hsize_t smine_start; /*strip mine start loc */
hsize_t n, smine_nelmts; /*elements per strip */
@ -2058,6 +2229,8 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
assert(dataset && dataset->ent.file);
assert(mem_type);
assert(buf);
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
#ifdef H5_HAVE_PARALLEL
/* If MPIO is used, no VL datatype support yet. */
@ -2089,14 +2262,6 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
printf("%s: check 0.3, buf=%p\n", FUNC,buf);
#endif /* QAK */
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATASET_XFER != H5P_get_class(dxpl_id) ||
NULL == (xfer_parms = H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
if (0==(H5F_get_intent(dataset->ent.file) & H5F_ACC_RDWR)) {
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
"no write intent on file");
@ -2114,13 +2279,12 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
#ifdef H5_HAVE_PARALLEL
/* Collect Parallel I/O information for possible later use */
if (H5FD_MPIO==xfer_parms->driver_id){
if (H5FD_MPIO==H5P_peek_hid_t(dxpl_id,H5D_XFER_VFL_ID_NAME)) {
doing_mpio++;
if (dx=xfer_parms->driver_info){
if (dx=H5P_peek_voidp(dxpl_id,H5D_XFER_VFL_INFO_NAME))
xfer_mode = dx->xfer_mode;
}else
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to retrieve data xfer info");
else
HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to retrieve data xfer info");
}
/* Collective access is not permissible without the MPIO driver */
if (doing_mpio && xfer_mode==H5FD_MPIO_COLLECTIVE &&
@ -2268,7 +2432,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
src_type_size = H5T_get_size(mem_type);
dst_type_size = H5T_get_size(dataset->type);
target_size = xfer_parms->buf_size;
target_size = H5P_peek_hsize_t(dxpl_id,H5D_XFER_MAX_TEMP_BUF_NAME);
#ifdef QAK
printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUNC,(int)src_type_size,(int)dst_type_size,(int)target_size);
#endif /* QAK */
@ -2290,17 +2454,20 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
* same size over and over.
*/
if (tpath->cdata.need_bkg) {
need_bkg = MAX (tpath->cdata.need_bkg, xfer_parms->need_bkg);
/* Retrieve the bkgr buffer property */
if(H5Pget(dxpl_id, H5D_XFER_BKGR_BUF_TYPE_NAME, &need_bkg)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type");
need_bkg = MAX (tpath->cdata.need_bkg, need_bkg);
} else {
need_bkg = H5T_BKG_NO; /*never needed even if app says yes*/
}
if (NULL==(tconv_buf=xfer_parms->tconv_buf)) {
if (NULL==(tconv_buf=H5P_peek_voidp(dxpl_id,H5D_XFER_TCONV_BUF_NAME))) {
/* Allocate temporary buffer */
if((tconv_buf=H5FL_BLK_ALLOC(type_conv,target_size,0))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
if (need_bkg && NULL==(bkg_buf=xfer_parms->bkg_buf)) {
if (need_bkg && NULL==(bkg_buf=H5P_peek_voidp(dxpl_id,H5D_XFER_BKGR_BUF_NAME))) {
/* Allocate temporary buffer */
H5_CHECK_OVERFLOW((request_nelmts*dst_type_size),hsize_t,size_t);
if((bkg_buf=H5FL_BLK_ALLOC(bkgr_conv,(size_t)(request_nelmts*dst_type_size),0))==NULL)
@ -2462,13 +2629,16 @@ printf("%s: check 2.0, src_type_size=%d, dst_type_size=%d, target_size=%d\n",FUN
H5S_sel_iter_release(mem_space,&mem_iter);
H5S_sel_iter_release(file_space,&bkg_iter);
if (src_id >= 0) H5I_dec_ref(src_id);
if (dst_id >= 0) H5I_dec_ref(dst_id);
if (tconv_buf && NULL==xfer_parms->tconv_buf)
if (src_id >= 0)
H5I_dec_ref(src_id);
if (dst_id >= 0)
H5I_dec_ref(dst_id);
if (tconv_buf && NULL==H5P_peek_voidp(dxpl_id,H5D_XFER_TCONV_BUF_NAME))
H5FL_BLK_FREE(type_conv,tconv_buf);
if (bkg_buf && NULL==xfer_parms->bkg_buf)
if (bkg_buf && NULL==H5P_peek_voidp(dxpl_id,H5D_XFER_BKGR_BUF_NAME))
H5FL_BLK_FREE(bkgr_conv,bkg_buf);
if (free_this_space) H5S_close(free_this_space);
if (free_this_space)
H5S_close(free_this_space);
FUNC_LEAVE(ret_value);
}
@ -2706,7 +2876,7 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
}
} else {
if (H5F_block_write(dset->ent.file, H5FD_MEM_DRAW, addr,
size, H5P_DEFAULT, buf)<0) {
size, H5P_DATASET_XFER_DEFAULT, buf)<0) {
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
"unable to write fill value to dataset");
}
@ -2741,7 +2911,7 @@ H5D_init_storage(H5D_t *dset, const H5S_t *space)
dim[ndims] = dset->layout.dim[ndims];
ndims++;
if (H5F_istore_allocate(dset->ent.file, H5P_DEFAULT,
if (H5F_istore_allocate(dset->ent.file, H5P_DATASET_XFER_DEFAULT,
&(dset->layout), dim,
&(dset->create_parms->pline),
&(dset->create_parms->fill))<0) {
@ -2946,8 +3116,6 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op,
herr_t
H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
{
H5D_xfer_t tmp_xfer_parms; /* Temporary copy of the default xfer parms */
H5D_xfer_t *xfer_parms = NULL; /* xfer parms as iterator op_data */
herr_t ret_value=FAIL;
FUNC_ENTER(H5Dvlen_reclaim, FAIL);
@ -2955,22 +3123,21 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
/* Check args */
if (H5I_DATATYPE!=H5I_get_type(type_id) ||
H5I_DATASPACE!=H5I_get_type(space_id) ||
buf==NULL) {
H5I_DATASPACE!=H5I_get_type(space_id) ||
buf==NULL) {
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument");
}
/* Retrieve dataset transfer property list */
if (H5P_DEFAULT == plist_id) {
HDmemcpy(&tmp_xfer_parms,&H5D_xfer_dflt,sizeof(H5D_xfer_t));
xfer_parms = &tmp_xfer_parms;
} else if (H5P_DATASET_XFER != H5P_get_class(plist_id) ||
NULL == (xfer_parms = H5I_object(plist_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
/* Get the default dataset transfer property list if the user didn't provide one */
if (H5P_DEFAULT == plist_id)
plist_id= H5P_DATASET_XFER_DEFAULT;
if (H5I_GENPROP_LST != H5I_get_type(plist_id) ||
TRUE!=H5Pisa_class(plist_id,H5P_DATASET_XFER_NEW))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
/* Call H5Diterate with args, etc. */
ret_value=H5Diterate(buf,type_id,space_id,H5T_vlen_reclaim,xfer_parms);
ret_value=H5Diterate(buf,type_id,space_id,H5T_vlen_reclaim,&plist_id);
FUNC_LEAVE(ret_value);
} /* end H5Dvlen_reclaim() */
@ -3132,7 +3299,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "no temporary buffers available");
/* Change to the custom memory allocation routines for reading VL data */
if((vlen_bufsize.xfer_pid=H5Pcreate(H5P_DATASET_XFER))<0)
if((vlen_bufsize.xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW))<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "no dataset xfer plists available");
if(H5Pset_vlen_mem_manager(vlen_bufsize.xfer_pid,H5D_vlen_get_buf_size_alloc,&vlen_bufsize,NULL,NULL)<0)
@ -3159,7 +3326,7 @@ done:
if(vlen_bufsize.vl_tbuf!=NULL)
H5FL_BLK_FREE(vlen_vl_buf,vlen_bufsize.vl_tbuf);
if(vlen_bufsize.xfer_pid>0)
H5Pclose(vlen_bufsize.xfer_pid);
H5Pclose_list(vlen_bufsize.xfer_pid);
FUNC_LEAVE(ret_value);
} /* end H5Dvlen_get_buf_size() */

@ -1001,7 +1001,7 @@ H5F_istore_flush_entry(H5F_t *f, H5F_rdcc_ent_t *ent, hbool_t reset)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to allocate chunk");
}
if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DEFAULT,
if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DATASET_XFER_DEFAULT,
buf)<0) {
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");
@ -1421,7 +1421,7 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/*
* The chunk exists on disk.
*/
if (H5F_block_read(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DEFAULT,
if (H5F_block_read(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DATASET_XFER_DEFAULT,
chunk)<0) {
HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL,
"unable to read raw data chunk");
@ -1500,13 +1500,9 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
ent->wr_count = chunk_size;
ent->chunk = chunk;
{
H5D_xfer_t *dxpl;
dxpl = (H5P_DEFAULT==dxpl_id) ? &H5D_xfer_dflt : (H5D_xfer_t *)H5I_object(dxpl_id);
ent->split_ratios[0] = dxpl->split_ratios[0];
ent->split_ratios[1] = dxpl->split_ratios[1];
ent->split_ratios[2] = dxpl->split_ratios[2];
}
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
H5Pget(dxpl_id,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&(ent->split_ratios));
/* Add it to the cache */
assert(NULL==rdcc->slot[idx]);
@ -1646,13 +1642,10 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
x.alloc_size = x.chunk_size;
x.chunk = chunk;
{
H5D_xfer_t *dxpl;
dxpl = (H5P_DEFAULT==dxpl_id) ? &H5D_xfer_dflt : (H5D_xfer_t *)H5I_object(dxpl_id);
x.split_ratios[0] = dxpl->split_ratios[0];
x.split_ratios[1] = dxpl->split_ratios[1];
x.split_ratios[2] = dxpl->split_ratios[2];
}
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
H5Pget(dxpl_id,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&(x.split_ratios));
H5F_istore_flush_entry (f, &x, TRUE);
} else {
@ -1800,7 +1793,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = udata.addr;
if (H5F_arr_read(f, H5P_DEFAULT, &l, pline, fill, NULL/*no efl*/,
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0) {
HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL,
"unable to read raw data from file");
@ -1976,7 +1969,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = udata.addr;
if (H5F_arr_write(f, H5P_DEFAULT, &l, pline, fill, NULL/*no efl*/,
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0) {
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");

@ -51,32 +51,82 @@ typedef struct H5D_create_t {
H5O_pline_t pline; /*data filter pipeline */
} H5D_create_t;
/* Data transfer property list */
typedef struct H5D_xfer_t {
size_t buf_size; /*max temp buffer size */
void *tconv_buf; /*type conversion buffer or null */
void *bkg_buf; /*background buffer or null */
H5T_bkg_t need_bkg; /*type of background buffer needed */
double split_ratios[3];/*B-tree node splitting ratios */
uintn cache_hyper; /*cache hyperslab blocks during I/O? */
uintn block_limit; /*largest hyperslab block to cache */
size_t vector_size; /*Max. # of I/O vectors for hyperslabs */
H5MM_allocate_t vlen_alloc; /*VL datatype allocation function */
void *alloc_info; /*VL datatype allocation information */
H5MM_free_t vlen_free; /*VL datatype free function */
void *free_info; /*VL datatype free information */
hid_t driver_id; /*File driver ID */
void *driver_info; /*File driver specific information */
#ifdef COALESCE_READS
uintn gather_reads; /*coalesce single reads into a read transaction */
/* Data transfer properties */
/* Definitions for maximum temp buffer size property */
#define H5D_XFER_MAX_TEMP_BUF_NAME "max_temp_buf"
#define H5D_XFER_MAX_TEMP_BUF_SIZE sizeof(hsize_t)
#define H5D_XFER_MAX_TEMP_BUF_DEF (1024*1024)
/* Definitions for type conversion buffer property */
#define H5D_XFER_TCONV_BUF_NAME "tconv_buf"
#define H5D_XFER_TCONV_BUF_SIZE sizeof(void *)
#define H5D_XFER_TCONV_BUF_DEF NULL
/* Definitions for background buffer property */
#define H5D_XFER_BKGR_BUF_NAME "bkgr_buf"
#define H5D_XFER_BKGR_BUF_SIZE sizeof(void *)
#define H5D_XFER_BKGR_BUF_DEF NULL
/* Definitions for background buffer type property */
#define H5D_XFER_BKGR_BUF_TYPE_NAME "bkgr_buf_type"
#define H5D_XFER_BKGR_BUF_TYPE_SIZE sizeof(H5T_bkg_t)
#define H5D_XFER_BKGR_BUF_TYPE_DEF H5T_BKG_NO
/* Definitions for B-tree node splitting ratio property */
#define H5D_XFER_BTREE_SPLIT_RATIO_NAME "btree_split_ratio"
#define H5D_XFER_BTREE_SPLIT_RATIO_SIZE sizeof(double[3])
#define H5D_XFER_BTREE_SPLIT_RATIO_DEF {0.1, 0.5, 0.9}
/* Definitions for hyperslab caching property */
#define H5D_XFER_HYPER_CACHE_NAME "hyper_cache"
#define H5D_XFER_HYPER_CACHE_SIZE sizeof(uintn)
#ifndef H5_HAVE_PARALLEL
#define H5D_XFER_HYPER_CACHE_DEF 1
#else
#define H5D_XFER_HYPER_CACHE_DEF 0
#endif
} H5D_xfer_t;
/* Definitions for hyperslab cache limit property */
#define H5D_XFER_HYPER_CACHE_LIM_NAME "hyper_cache_limit"
#define H5D_XFER_HYPER_CACHE_LIM_SIZE sizeof(uintn)
#define H5D_XFER_HYPER_CACHE_LIM_DEF 0
/* Definitions for hyperslab cache limit property */
#define H5D_XFER_HYPER_CACHE_LIM_NAME "hyper_cache_limit"
#define H5D_XFER_HYPER_CACHE_LIM_SIZE sizeof(uintn)
#define H5D_XFER_HYPER_CACHE_LIM_DEF 0
/* Definitions for vlen allocation function property */
#define H5D_XFER_VLEN_ALLOC_NAME "vlen_alloc"
#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)
#define H5D_XFER_VLEN_ALLOC_DEF NULL
/* Definitions for vlen allocation info property */
#define H5D_XFER_VLEN_ALLOC_INFO_NAME "vlen_alloc_info"
#define H5D_XFER_VLEN_ALLOC_INFO_SIZE sizeof(void *)
#define H5D_XFER_VLEN_ALLOC_INFO_DEF NULL
/* Definitions for vlen free function property */
#define H5D_XFER_VLEN_FREE_NAME "vlen_free"
#define H5D_XFER_VLEN_FREE_SIZE sizeof(H5MM_free_t)
#define H5D_XFER_VLEN_FREE_DEF NULL
/* Definitions for vlen free info property */
#define H5D_XFER_VLEN_FREE_INFO_NAME "vlen_free_info"
#define H5D_XFER_VLEN_FREE_INFO_SIZE sizeof(void *)
#define H5D_XFER_VLEN_FREE_INFO_DEF NULL
/* Definitions for file driver ID property */
#define H5D_XFER_VFL_ID_NAME "vfl_id"
#define H5D_XFER_VFL_ID_SIZE sizeof(hid_t)
#define H5D_XFER_VFL_ID_DEF H5FD_VFD_DEFAULT
/* Definitions for file driver info property */
#define H5D_XFER_VFL_INFO_NAME "vfl_info"
#define H5D_XFER_VFL_INFO_SIZE sizeof(void *)
#define H5D_XFER_VFL_INFO_DEF NULL
#ifdef COALESCE_READS
/* Definitions for 'gather reads' property */
#define H5D_XFER_GATHER_READS_NAME "gather_reads"
#define H5D_XFER_GATHER_READS_SIZE sizeof(uintn)
#define H5D_XFER_GATHER_READS_DEF 0
#endif /* COALESCE_READS */
/* Definitions for hyperslab vector size property */
#define H5D_XFER_HYPER_VECTOR_SIZE_NAME "vec_size"
#define H5D_XFER_HYPER_VECTOR_SIZE_SIZE sizeof(size_t)
#define H5D_XFER_HYPER_VECTOR_SIZE_DEF 1024
typedef struct H5D_t H5D_t;
/* library variables */
__DLLVAR__ const H5D_create_t H5D_create_dflt;
__DLLVAR__ H5D_xfer_t H5D_xfer_dflt;
/* Functions defined in H5D.c */
__DLL__ herr_t H5D_init(void);
@ -101,5 +151,7 @@ __DLL__ H5F_t * H5D_get_file(const H5D_t *dset);
__DLL__ hsize_t H5D_get_storage_size(H5D_t *dset);
__DLL__ void *H5D_vlen_get_buf_size_alloc(size_t size, void *info);
__DLL__ herr_t H5D_vlen_get_buf_size(void *elem, hid_t type_id, hsize_t ndim, hssize_t *point, void *op_data);
__DLL__ herr_t H5D_xfer_create(hid_t dxpl_id, void *create_data);
__DLL__ herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data);
#endif

@ -172,18 +172,30 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(f);
assert(layout);
assert(real_buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
/* Get the transfer mode */
H5FD_mpio_dxpl_t *dx;
hid_t driver_id; /* VFL driver ID */
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
/* Collective MPIO access is unsupported for non-contiguous datasets */
@ -534,18 +546,30 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(f);
assert(layout);
assert(real_buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
/* Get the transfer mode */
H5FD_mpio_dxpl_t *dx;
hid_t driver_id; /* VFL driver ID */
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
/* Collective MPIO access is unsupported for non-contiguous datasets */

@ -101,7 +101,9 @@ static const H5E_minor_mesg_t H5E_minor_mesg_g[] = {
/* Object atom related errors */
{H5E_BADATOM, "Unable to find atom information (already closed?)"},
{H5E_CANTREGISTER, "Unable to register new atom"},
{H5E_CANTREGISTER, "Unable to register new atom"},
{H5E_CANTINC, "Unable to increment reference count"},
{H5E_CANTDEC, "Unable to decrement reference count"},
/* Cache related errors */
{H5E_CANTFLUSH, "Unable to flush data from cache"},
@ -135,6 +137,10 @@ static const H5E_minor_mesg_t H5E_minor_mesg_g[] = {
/* Datatype conversion errors */
{H5E_CANTCONVERT, "Can't convert datatypes"},
/* Property list errors */
{H5E_CANTGET, "Can't get value"},
{H5E_CANTSET, "Can't set value"},
/* Datatype conversion errors */
{H5E_MPI, "Some MPI function failed"}
};

@ -142,6 +142,8 @@ typedef enum H5E_minor_t {
/* Object atom related errors */
H5E_BADATOM, /*Can't find atom information */
H5E_CANTREGISTER, /*Can't register new atom */
H5E_CANTINC, /*Can't increment reference count */
H5E_CANTDEC, /*Can't decrement reference count */
/* Cache related errors */
H5E_CANTFLUSH, /*Can't flush object from cache */
@ -175,6 +177,10 @@ typedef enum H5E_minor_t {
/* Datatype conversion errors */
H5E_CANTCONVERT, /*Can't convert datatypes */
/* Property list errors */
H5E_CANTGET, /*Can't get value */
H5E_CANTSET, /*Can't set value */
/* Parallel errors */
H5E_MPI /*some MPI function failed */
} H5E_minor_t;

@ -596,7 +596,7 @@ H5F_locate_signature(H5FD_t *file)
HRETURN_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF,
"unable to set EOA value for file signature");
}
if (H5FD_read(file, H5FD_MEM_SUPER, H5P_DEFAULT, addr, H5F_SIGNATURE_LEN, buf)<0) {
if (H5FD_read(file, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, addr, H5F_SIGNATURE_LEN, buf)<0) {
HRETURN_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF,
"unable to read file signature");
}
@ -1110,7 +1110,7 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id)
"unable to find file signature");
}
if (H5FD_set_eoa(lf, shared->boot_addr+fixed_size)<0 ||
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DEFAULT, shared->boot_addr, fixed_size, buf)<0) {
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, shared->boot_addr, fixed_size, buf)<0) {
HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL,
"unable to read superblock");
}
@ -1198,7 +1198,7 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id)
H5G_SIZEOF_ENTRY(file); /*root group ptr*/
assert(variable_size<=sizeof(buf));
if (H5FD_set_eoa(lf, shared->boot_addr+fixed_size+variable_size)<0 ||
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DEFAULT, shared->boot_addr+fixed_size,
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, shared->boot_addr+fixed_size,
variable_size, buf)<0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL,
"unable to read superblock");
@ -1217,7 +1217,7 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id)
if (H5F_addr_defined(shared->driver_addr)) {
haddr_t drv_addr = shared->base_addr + shared->driver_addr;
if (H5FD_set_eoa(lf, drv_addr+16)<0 ||
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DEFAULT, drv_addr, 16, buf)<0) {
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, drv_addr, 16, buf)<0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL,
"unable to read driver information block");
}
@ -1241,7 +1241,7 @@ H5F_open(const char *name, uintn flags, hid_t fcpl_id, hid_t fapl_id)
/* Read driver information and decode */
if (H5FD_set_eoa(lf, drv_addr+16+driver_size)<0 ||
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DEFAULT, drv_addr+16, driver_size, buf)<0) {
H5FD_read(lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, drv_addr+16, driver_size, buf)<0) {
HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL,
"unable to read file driver information");
}
@ -1660,7 +1660,7 @@ H5F_flush(H5F_t *f, H5F_scope_t scope, hbool_t invalidate,
/* flush the data sieve buffer, if we have a dirty one */
if(!alloc_only && f->shared->sieve_buf && f->shared->sieve_dirty) {
/* Write dirty data sieve buffer to file */
if (H5F_block_write(f, H5FD_MEM_DRAW, f->shared->sieve_loc, f->shared->sieve_size, H5P_DEFAULT, f->shared->sieve_buf)<0) {
if (H5F_block_write(f, H5FD_MEM_DRAW, f->shared->sieve_loc, f->shared->sieve_size, H5P_DATASET_XFER_DEFAULT, f->shared->sieve_buf)<0) {
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"block write failed");
}
@ -1769,7 +1769,7 @@ H5F_flush(H5F_t *f, H5F_scope_t scope, hbool_t invalidate,
if (IS_H5FD_MPIO(f))
H5FD_mpio_tas_allsame(f->shared->lf, TRUE); /*only p0 will write*/
#endif
if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, H5P_DEFAULT, f->shared->boot_addr,
if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT, f->shared->boot_addr,
superblock_size, sbuf)<0) {
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write superblock");
@ -1781,7 +1781,7 @@ H5F_flush(H5F_t *f, H5F_scope_t scope, hbool_t invalidate,
if (IS_H5FD_MPIO(f))
H5FD_mpio_tas_allsame(f->shared->lf, TRUE); /*only p0 will write*/
#endif
if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, H5P_DEFAULT,
if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, H5P_DATASET_XFER_DEFAULT,
f->shared->base_addr+superblock_size, driver_size,
dbuf)<0) {
HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,

@ -284,7 +284,6 @@ H5FD_get_class(hid_t id)
{
H5FD_class_t *ret_value=NULL;
H5F_access_t *fapl=NULL;
H5D_xfer_t *dxpl=NULL;
FUNC_ENTER(H5FD_get_class, NULL);
@ -292,28 +291,23 @@ H5FD_get_class(hid_t id)
ret_value = H5FD_get_class(H5F_access_dflt.driver_id);
} else if (H5I_VFL==H5I_get_type(id)) {
ret_value = H5I_object(id);
} else if (H5I_GENPROP_LST == H5I_get_type(id) &&
TRUE==H5Pisa_class(id,H5P_DATASET_XFER_NEW)) {
ret_value = H5FD_get_class(H5P_peek_hid_t(id,H5D_XFER_VFL_ID_NAME));
} else {
switch (H5P_get_class(id)) {
case H5P_FILE_ACCESS:
if (NULL==(fapl=H5I_object(id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a file access property list");
}
ret_value = H5FD_get_class(fapl->driver_id);
break;
case H5P_FILE_ACCESS:
if (NULL==(fapl=H5I_object(id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a file access property list");
}
ret_value = H5FD_get_class(fapl->driver_id);
break;
case H5P_DATASET_XFER:
if (NULL==(dxpl=H5I_object(id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a data transfer property list");
}
ret_value = H5FD_get_class(dxpl->driver_id);
break;
default:
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a driver id, file access property list or "
"data transfer property list");
default:
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL,
"not a driver id, file access property list or "
"data transfer property list");
}
}
FUNC_LEAVE(ret_value);
@ -1968,23 +1962,20 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size
H5TRACE6("e","xMtiazx",file,type,dxpl_id,addr,size,buf);
/* Check args */
if (!file || !file->cls) {
if (!file || !file->cls)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer");
}
if (H5P_DEFAULT!=dxpl_id &&
(H5P_DATASET_XFER!=H5P_get_class(dxpl_id) ||
NULL==H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a data transfer property list");
}
if (!buf) {
/* Get the default dataset transfer property list if the user didn't provide one */
if (H5P_DEFAULT == dxpl_id)
dxpl_id= H5P_DATASET_XFER_DEFAULT;
if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) ||
TRUE!=H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list");
if (!buf)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer");
}
/* Do the real work */
if (H5FD_read(file, type, dxpl_id, addr, size, buf)<0) {
if (H5FD_read(file, type, dxpl_id, addr, size, buf)<0)
HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file read request failed");
}
FUNC_LEAVE(SUCCEED);
}
@ -2016,8 +2007,8 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz
{
FUNC_ENTER(H5FD_read, FAIL);
assert(file && file->cls);
assert(H5P_DEFAULT==dxpl_id ||
(H5P_DATASET_XFER==H5P_get_class(dxpl_id) || H5I_object(dxpl_id)));
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
assert(buf);
#ifndef H5_HAVE_PARALLEL
@ -2124,24 +2115,20 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz
H5TRACE6("e","xMtiazx",file,type,dxpl_id,addr,size,buf);
/* Check args */
if (!file || !file->cls) {
if (!file || !file->cls)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer");
}
if (H5P_DEFAULT!=dxpl_id &&
(H5P_DATASET_XFER!=H5P_get_class(dxpl_id) ||
NULL==H5I_object(dxpl_id))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a data transfer property list");
}
if (!buf) {
/* Get the default dataset transfer property list if the user didn't provide one */
if (H5P_DEFAULT == dxpl_id)
dxpl_id= H5P_DATASET_XFER_DEFAULT;
if (H5I_GENPROP_LST != H5I_get_type(dxpl_id) ||
TRUE!=H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list");
if (!buf)
HRETURN_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer");
}
/* The real work */
if (H5FD_write(file, type, dxpl_id, addr, size, buf)<0) {
HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL,
"file write request failed");
}
if (H5FD_write(file, type, dxpl_id, addr, size, buf)<0)
HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file write request failed");
FUNC_LEAVE(SUCCEED);
}
@ -2176,8 +2163,8 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si
FUNC_ENTER(H5FD_write, FAIL);
assert(file && file->cls);
assert(H5P_DEFAULT==dxpl_id ||
(H5P_DATASET_XFER==H5P_get_class(dxpl_id) && H5I_object(dxpl_id)));
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
assert(buf);
#ifndef H5_HAVE_PARALLEL
@ -2427,7 +2414,7 @@ H5FD_flush(H5FD_t *file)
if((file->feature_flags&H5FD_FEAT_ACCUMULATE_METADATA) && file->accum_dirty && file->accum_size>0) {
/* Flush the metadata contents */
/* Not certain if the type and dxpl should be the way they are... -QAK */
if ((file->cls->write)(file, H5FD_MEM_DEFAULT, H5P_DEFAULT, file->accum_loc, file->accum_size, file->meta_accum)<0)
if ((file->cls->write)(file, H5FD_MEM_DEFAULT, H5P_DATASET_XFER_DEFAULT, file->accum_loc, file->accum_size, file->meta_accum)<0)
HRETURN_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver write request failed");
/* Reset the dirty flag */

@ -152,7 +152,7 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
H5FD_mpio_xfer_t xfer_mode=H5FD_MPIO_INDEPENDENT;
#endif
#ifdef COALESCE_READS
H5D_xfer_t *xfer_parms; /*transfer property list*/
uintn gather_reads; /* # of MPIO reads to gather */
#endif
FUNC_ENTER(H5F_arr_read, FAIL);
@ -165,6 +165,9 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(mem_offset);
assert(mem_size);
assert(buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
/* Make a local copy of size so we can modify it */
H5V_vector_cpy(layout->ndims, hslab_size, _hslab_size);
@ -172,17 +175,25 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
hid_t driver_id; /* VFL driver ID */
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
#endif
#ifdef H5_HAVE_PARALLEL
/* Collective MPIO access is unsupported for non-contiguous datasets */
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode) {
HRETURN_ERROR (H5E_DATASET, H5E_READERROR, FAIL,
@ -282,30 +293,25 @@ H5F_arr_read(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
printf("nelmts=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
if (max != min)
HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
HRETURN_ERROR(H5E_DATASET, H5E_READERROR, FAIL,
"collective access with unequal number of "
"blocks not supported yet");
}
#endif
#ifdef COALESCE_READS
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATASET_XFER != H5P_get_class (dxpl_id) ||
NULL == (xfer_parms = H5I_object (dxpl_id))) {
HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
for (z=0, xfer_parms->gather_reads = nelmts - 1;
z<nelmts;
z++, xfer_parms->gather_reads--) {
#else
#ifdef QAK
printf("%s: nelmts=%d, addr=%lu, elmt_size=%lu\n",FUNC,(int)nelmts,(unsigned long)addr,(unsigned long)elmt_size);
printf("%s: sieve_buf=%p, sieve_loc=%lu, sieve_size=%lu, sieve_buf_size=%lu, sieve_dirty=%u\n",FUNC,f->shared->sieve_buf,(unsigned long)f->shared->sieve_loc,(unsigned long)f->shared->sieve_size,(unsigned long)f->shared->sieve_buf_size,(unsigned)f->shared->sieve_dirty);
printf("%s: feature_flags=%lx\n",FUNC,(unsigned long)f->shared->lf->feature_flags);
#endif /* QAK */
#ifdef COALESCE_READS
for (z=0, gather_reads = nelmts - 1; z<nelmts; z++, gather_reads--) {
/* Track the number of reads to gather */
if(H5P_set(dxpl_id, H5D_XFER_GATHER_READS_NAME, &gather_reads)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve gather reads");
#else
for (z=0; z<nelmts; z++) {
#endif
@ -446,6 +452,9 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(mem_offset);
assert(mem_size);
assert(buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
/* Make a local copy of _size so we can modify it */
H5V_vector_cpy(layout->ndims, hslab_size, _hslab_size);
@ -453,17 +462,25 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
hid_t driver_id; /* VFL driver ID */
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
#endif
#ifdef H5_HAVE_PARALLEL
if (H5D_CONTIGUOUS!=layout->type && H5FD_MPIO_COLLECTIVE==xfer_mode) {
HRETURN_ERROR (H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access on non-contiguous datasets not "
@ -566,7 +583,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
printf("nelmts=%lu, min=%lu, max=%lu\n", temp, min, max);
#endif
if (max != min) {
HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
HRETURN_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL,
"collective access with unequal number of "
"blocks not supported yet");
}
@ -614,8 +631,7 @@ H5F_arr_write(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
*/
if (efl && efl->nused>0) {
HRETURN_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL,
"chunking and external files are mutually "
"exclusive");
"chunking and external files are mutually exclusive");
}
for (u=0; u<layout->ndims; u++) {
if (0!=mem_offset[u] || hslab_size[u]!=mem_size[u]) {

@ -1001,7 +1001,7 @@ H5F_istore_flush_entry(H5F_t *f, H5F_rdcc_ent_t *ent, hbool_t reset)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to allocate chunk");
}
if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DEFAULT,
if (H5F_block_write(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DATASET_XFER_DEFAULT,
buf)<0) {
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");
@ -1421,7 +1421,7 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
/*
* The chunk exists on disk.
*/
if (H5F_block_read(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DEFAULT,
if (H5F_block_read(f, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5P_DATASET_XFER_DEFAULT,
chunk)<0) {
HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL,
"unable to read raw data chunk");
@ -1500,13 +1500,9 @@ H5F_istore_lock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
ent->wr_count = chunk_size;
ent->chunk = chunk;
{
H5D_xfer_t *dxpl;
dxpl = (H5P_DEFAULT==dxpl_id) ? &H5D_xfer_dflt : (H5D_xfer_t *)H5I_object(dxpl_id);
ent->split_ratios[0] = dxpl->split_ratios[0];
ent->split_ratios[1] = dxpl->split_ratios[1];
ent->split_ratios[2] = dxpl->split_ratios[2];
}
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
H5Pget(dxpl_id,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&(ent->split_ratios));
/* Add it to the cache */
assert(NULL==rdcc->slot[idx]);
@ -1646,13 +1642,10 @@ H5F_istore_unlock(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
}
x.alloc_size = x.chunk_size;
x.chunk = chunk;
{
H5D_xfer_t *dxpl;
dxpl = (H5P_DEFAULT==dxpl_id) ? &H5D_xfer_dflt : (H5D_xfer_t *)H5I_object(dxpl_id);
x.split_ratios[0] = dxpl->split_ratios[0];
x.split_ratios[1] = dxpl->split_ratios[1];
x.split_ratios[2] = dxpl->split_ratios[2];
}
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
H5Pget(dxpl_id,H5D_XFER_BTREE_SPLIT_RATIO_NAME,&(x.split_ratios));
H5F_istore_flush_entry (f, &x, TRUE);
} else {
@ -1800,7 +1793,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = udata.addr;
if (H5F_arr_read(f, H5P_DEFAULT, &l, pline, fill, NULL/*no efl*/,
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0) {
HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL,
"unable to read raw data from file");
@ -1976,7 +1969,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
for (u=l.ndims; u-- > 0; /*void*/)
l.dim[u] = layout->dim[u];
l.addr = udata.addr;
if (H5F_arr_write(f, H5P_DEFAULT, &l, pline, fill, NULL/*no efl*/,
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk, buf)<0) {
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");

@ -172,18 +172,30 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(f);
assert(layout);
assert(real_buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
/* Get the transfer mode */
H5FD_mpio_dxpl_t *dx;
hid_t driver_id; /* VFL driver ID */
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
/* Collective MPIO access is unsupported for non-contiguous datasets */
@ -534,18 +546,30 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
assert(f);
assert(layout);
assert(real_buf);
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
#ifdef H5_HAVE_PARALLEL
{
/* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
/* Get the transfer mode */
H5FD_mpio_dxpl_t *dx;
hid_t driver_id; /* VFL driver ID */
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_INDEPENDENT!=dx->xfer_mode) {
xfer_mode = dx->xfer_mode;
}
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO==driver_id) {
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are not using independent I/O */
if(H5FD_MPIO_INDEPENDENT!=dx->xfer_mode)
xfer_mode = dx->xfer_mode;
} /* end if */
}
/* Collective MPIO access is unsupported for non-contiguous datasets */

@ -373,7 +373,7 @@ H5G_node_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5G_node_t *sym)
if (IS_H5FD_MPIO(f))
H5FD_mpio_tas_allsame(f->shared->lf, TRUE); /*only p0 will write*/
#endif /* H5_HAVE_PARALLEL */
status = H5F_block_write(f, H5FD_MEM_BTREE, addr, size, H5P_DEFAULT, buf);
status = H5F_block_write(f, H5FD_MEM_BTREE, addr, size, H5P_DATASET_XFER_DEFAULT, buf);
if (status < 0)
HRETURN_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL,
"unable to write symbol table node to the file");
@ -443,7 +443,7 @@ H5G_node_load(H5F_t *f, haddr_t addr, const void UNUSED *_udata1,
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, H5P_DEFAULT, buf) < 0) {
if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, H5P_DATASET_XFER_DEFAULT, buf) < 0) {
HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL,
"unabel to read symbol table node");
}

@ -257,7 +257,7 @@ H5HG_load (H5F_t *f, haddr_t addr, const void UNUSED *udata1,
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
if (H5F_block_read(f, H5FD_MEM_GHEAP, addr, H5HG_MINSIZE, H5P_DEFAULT,
if (H5F_block_read(f, H5FD_MEM_GHEAP, addr, H5HG_MINSIZE, H5P_DATASET_XFER_DEFAULT,
heap->chunk)<0) {
HGOTO_ERROR (H5E_HEAP, H5E_READERROR, NULL,
"unable to read global heap collection");
@ -294,7 +294,7 @@ H5HG_load (H5F_t *f, haddr_t addr, const void UNUSED *udata1,
"memory allocation failed");
}
if (H5F_block_read (f, H5FD_MEM_GHEAP, next_addr, (heap->size-H5HG_MINSIZE),
H5P_DEFAULT, heap->chunk+H5HG_MINSIZE)<0) {
H5P_DATASET_XFER_DEFAULT, heap->chunk+H5HG_MINSIZE)<0) {
HGOTO_ERROR (H5E_HEAP, H5E_READERROR, NULL,
"unable to read global heap collection");
}
@ -420,7 +420,7 @@ H5HG_flush (H5F_t *f, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap)
if (heap->dirty) {
if (H5F_block_write (f, H5FD_MEM_GHEAP, addr, heap->size,
H5P_DEFAULT, heap->chunk)<0) {
H5P_DATASET_XFER_DEFAULT, heap->chunk)<0) {
HRETURN_ERROR (H5E_HEAP, H5E_WRITEERROR, FAIL,
"unable to write global heap collection to file");
}

@ -219,7 +219,7 @@ H5HL_load(H5F_t *f, haddr_t addr, const void UNUSED *udata1,
assert(!udata1);
assert(!udata2);
if (H5F_block_read(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f), H5P_DEFAULT,
if (H5F_block_read(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f), H5P_DATASET_XFER_DEFAULT,
hdr) < 0) {
HRETURN_ERROR(H5E_HEAP, H5E_READERROR, NULL,
"unable to read heap header");
@ -260,7 +260,7 @@ H5HL_load(H5F_t *f, haddr_t addr, const void UNUSED *udata1,
}
if (heap->disk_alloc &&
H5F_block_read(f, H5FD_MEM_LHEAP, heap->addr, heap->disk_alloc,
H5P_DEFAULT, heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) {
H5P_DATASET_XFER_DEFAULT, heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) {
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, NULL,
"unable to read heap data");
}
@ -400,7 +400,7 @@ H5HL_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5HL_t *heap)
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_LHEAP, addr,
(H5HL_SIZEOF_HDR(f)+heap->disk_alloc),
H5P_DEFAULT, heap->chunk) < 0) {
H5P_DATASET_XFER_DEFAULT, heap->chunk) < 0) {
HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL,
"unable to write heap header and data to file");
}
@ -410,7 +410,7 @@ H5HL_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5HL_t *heap)
H5FD_mpio_tas_allsame( f->shared->lf, TRUE ); /* only p0 writes */
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_LHEAP, addr, H5HL_SIZEOF_HDR(f),
H5P_DEFAULT, heap->chunk)<0) {
H5P_DATASET_XFER_DEFAULT, heap->chunk)<0) {
HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL,
"unable to write heap header to file");
}
@ -419,7 +419,7 @@ H5HL_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5HL_t *heap)
H5FD_mpio_tas_allsame( f->shared->lf, TRUE ); /* only p0 writes */
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_LHEAP, heap->addr, heap->disk_alloc,
H5P_DEFAULT,
H5P_DATASET_XFER_DEFAULT,
heap->chunk + H5HL_SIZEOF_HDR(f)) < 0) {
HRETURN_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL,
"unable to write heap data to file");

@ -30,7 +30,7 @@ typedef enum {
H5I_BADID = (-1), /*invalid Group */
H5I_FILE = 1, /*group ID for File objects */
H5I_FILE_CLOSING, /*files pending close due to open objhdrs */
H5I_TEMPLATE_0, /*group ID for Template objects */
H5I_TEMPLATE_0, /*group ID for Template objects */
H5I_TEMPLATE_1, /*group ID for Template objects */
H5I_TEMPLATE_2, /*group ID for Template objects */
H5I_TEMPLATE_3, /*group ID for Template objects */
@ -38,17 +38,17 @@ typedef enum {
H5I_TEMPLATE_5, /*group ID for Template objects */
H5I_TEMPLATE_6, /*group ID for Template objects */
H5I_TEMPLATE_7, /*group ID for Template objects */
H5I_TEMPLATE_MAX, /*not really a group ID */
H5I_TEMPLATE_MAX, /*not really a group ID */
H5I_GROUP, /*group ID for Group objects */
H5I_DATATYPE, /*group ID for Datatype objects */
H5I_DATASPACE, /*group ID for Dataspace objects */
H5I_DATASET, /*group ID for Dataset objects */
H5I_ATTR, /*group ID for Attribute objects */
H5I_TEMPBUF, /*group ID for Temporary buffer objects */
H5I_TEMPBUF, /*group ID for Temporary buffer objects */
H5I_REFERENCE, /*group ID for Reference objects */
H5I_VFL, /*group ID for virtual file layer */
H5I_GENPROP_CLS, /*group ID for generic property list classes */
H5I_GENPROP_LST, /*group ID for generic property lists */
H5I_VFL, /*group ID for virtual file layer */
H5I_GENPROP_CLS, /*group ID for generic property list classes */
H5I_GENPROP_LST, /*group ID for generic property lists */
H5I_NGROUPS /*number of valid groups, MUST BE LAST! */
} H5I_type_t;

@ -379,7 +379,7 @@ H5O_load(H5F_t *f, haddr_t addr, const void UNUSED *_udata1,
/* read fixed-lenth part of object header */
hdr_size = H5O_SIZEOF_HDR(f);
if (H5F_block_read(f, H5FD_MEM_OHDR, addr, hdr_size, H5P_DEFAULT, buf) < 0) {
if (H5F_block_read(f, H5FD_MEM_OHDR, addr, hdr_size, H5P_DATASET_XFER_DEFAULT, buf) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header");
}
@ -437,7 +437,7 @@ H5O_load(H5F_t *f, haddr_t addr, const void UNUSED *_udata1,
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL,
"memory allocation failed");
}
if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, H5P_DEFAULT,
if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, H5P_DATASET_XFER_DEFAULT,
oh->chunk[chunkno].image) < 0) {
HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL,
"unable to read object header data");
@ -593,7 +593,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
H5FD_mpio_tas_allsame(f->shared->lf, TRUE); /*only p0 will write*/
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_OHDR, addr, H5O_SIZEOF_HDR(f),
H5P_DEFAULT, buf) < 0) {
H5P_DATASET_XFER_DEFAULT, buf) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header hdr to disk");
}
@ -680,7 +680,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_OHDR, addr,
(H5O_SIZEOF_HDR(f)+oh->chunk[u].size),
H5P_DEFAULT, p) < 0) {
H5P_DATASET_XFER_DEFAULT, p) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header data to disk");
} /* end if */
@ -695,7 +695,7 @@ H5O_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5O_t *oh)
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(f, H5FD_MEM_OHDR, oh->chunk[u].addr,
(oh->chunk[u].size),
H5P_DEFAULT, oh->chunk[u].image) < 0) {
H5P_DATASET_XFER_DEFAULT, oh->chunk[u].image) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
"unable to write object header data to disk");
} /* end if */

1172
src/H5P.c

File diff suppressed because it is too large Load Diff

@ -50,6 +50,7 @@ typedef struct H5P_genprop_tag {
H5P_prp_set_func_t set; /* Function to call when a property value is set */
H5P_prp_get_func_t get; /* Function to call when a property value is retrieved */
H5P_prp_delete_func_t del; /* Function to call when a property is deleted */
H5P_prp_copy_func_t copy; /* Function to call when a property is copied */
H5P_prp_close_func_t close; /* Function to call when a property is closed */
struct H5P_genprop_tag *next; /* Pointer to the next property in this list */
@ -70,8 +71,10 @@ typedef struct H5P_genclass_tag {
/* Callback function pointers & info */
H5P_cls_create_func_t create_func; /* Function to call when a property list is created */
void *create_data; /* Pointer to user data to pass along to create callback */
H5P_cls_copy_func_t copy_func; /* Function to call when a property list is copied */
void *copy_data; /* Pointer to user data to pass along to copy callback */
H5P_cls_close_func_t close_func; /* Function to call when a property list is closed */
void *close_data; /* Pointer to user data to pass along to close callback */
void *close_data; /* Pointer to user data to pass along to close callback */
H5P_genprop_t *props[1]; /* Hash table of pointers to properties in the class */
} H5P_genclass_t;
@ -93,7 +96,6 @@ typedef struct {
H5F_create_t fcreate; /* File creation properties */
H5F_access_t faccess; /* File access properties */
H5D_create_t dcreate; /* Dataset creation properties */
H5D_xfer_t dxfer; /* Data transfer properties */
H5F_mprop_t mount; /* Mounting properties */
} u;
H5P_class_t cls; /* Property list class */
@ -104,7 +106,19 @@ __DLL__ herr_t H5P_init(void);
__DLL__ hid_t H5P_create(H5P_class_t type, H5P_t *plist);
__DLL__ void *H5P_copy(H5P_class_t type, const void *src);
__DLL__ herr_t H5P_close(void *plist);
__DLL__ herr_t H5P_register(H5P_genclass_t *pclass, const char *name, size_t size,
void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set,
H5P_prp_get_func_t prp_get, H5P_prp_delete_func_t prp_delete,
H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close);
__DLL__ herr_t H5P_get(hid_t plist_id, const char *name, void *value);
__DLL__ herr_t H5P_set(hid_t plist_id, const char *name, void *value);
__DLL__ H5P_class_t H5P_get_class(hid_t tid);
__DLL__ hid_t H5P_get_driver(hid_t plist_id);
/* Private functions to "peek" at properties of a certain type */
__DLL__ uintn H5P_peek_uintn(hid_t plist_id, const char *name);
__DLL__ hid_t H5P_peek_hid_t(hid_t plist_id, const char *name);
__DLL__ void *H5P_peek_voidp(hid_t plist_id, const char *name);
__DLL__ hsize_t H5P_peek_hsize_t(hid_t plist_id, const char *name);
#endif

@ -57,14 +57,16 @@ typedef enum H5P_class_t {
/* Define property list class callback function pointer types */
typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data);
typedef herr_t (*H5P_cls_copy_func_t)(hid_t prop_id, void *copy_data);
typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data);
/* Define property list callback function pointer types */
typedef herr_t (*H5P_prp_create_func_t)(const char *name, void *def_value);
typedef herr_t (*H5P_prp_set_func_t)(hid_t prop_id, const char *name, void *value);
typedef herr_t (*H5P_prp_get_func_t)(hid_t prop_id, const char *name, void *value);
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name, void *value);
typedef herr_t (*H5P_prp_close_func_t)(const char *name, void *value);
typedef herr_t (*H5P_prp_create_func_t)(const char *name, size_t size, void *def_value);
typedef herr_t (*H5P_prp_set_func_t)(hid_t prop_id, const char *name, size_t size, void *value);
typedef herr_t (*H5P_prp_get_func_t)(hid_t prop_id, const char *name, size_t size, void *value);
typedef herr_t (*H5P_prp_delete_func_t)(hid_t prop_id, const char *name, size_t size, void *value);
typedef herr_t (*H5P_prp_copy_func_t)(const char *name, size_t size, void *value);
typedef herr_t (*H5P_prp_close_func_t)(const char *name, size_t size, void *value);
/* Define property list iteration function type */
typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data);
@ -76,38 +78,58 @@ extern "C" {
/*
* The library created property list classes
*/
#define H5P_NO_CLASS_NEW (H5open(), H5P_NO_CLASS_g)
#define H5P_NO_CLASS_NEW (H5open(), H5P_CLS_NO_CLASS_g)
#define H5P_NO_CLASS_HASH_SIZE 1 /* 1, not 0, otherwise allocations get weird */
#define H5P_FILE_CREATE_NEW (H5open(), H5P_FILE_CREATE_g)
#define H5P_FILE_CREATE_NEW (H5open(), H5P_CLS_FILE_CREATE_g)
#define H5P_FILE_CREATE_HASH_SIZE 17
#define H5P_FILE_ACCESS_NEW (H5open(), H5P_FILE_ACCESS_g)
#define H5P_FILE_ACCESS_NEW (H5open(), H5P_CLS_FILE_ACCESS_g)
#define H5P_FILE_ACCESS_HASH_SIZE 17
#define H5P_DATASET_CREATE_NEW (H5open(), H5P_DATASET_CREATE_g)
#define H5P_DATASET_CREATE_NEW (H5open(), H5P_CLS_DATASET_CREATE_g)
#define H5P_DATASET_CREATE_HASH_SIZE 17
#define H5P_DATASET_XFER_NEW (H5open(), H5P_DATASET_XFER_g)
#define H5P_DATASET_XFER_NEW (H5open(), H5P_CLS_DATASET_XFER_g)
#define H5P_DATASET_XFER_HASH_SIZE 17
#define H5P_MOUNT_NEW (H5open(), H5P_MOUNT_g)
#define H5P_MOUNT_NEW (H5open(), H5P_CLS_MOUNT_g)
#define H5P_MOUNT_HASH_SIZE 17
__DLLVAR__ hid_t H5P_NO_CLASS_g;
__DLLVAR__ hid_t H5P_FILE_CREATE_g;
__DLLVAR__ hid_t H5P_FILE_ACCESS_g;
__DLLVAR__ hid_t H5P_DATASET_CREATE_g;
__DLLVAR__ hid_t H5P_DATASET_XFER_g;
__DLLVAR__ hid_t H5P_MOUNT_g;
__DLLVAR__ hid_t H5P_CLS_NO_CLASS_g;
__DLLVAR__ hid_t H5P_CLS_FILE_CREATE_g;
__DLLVAR__ hid_t H5P_CLS_FILE_ACCESS_g;
__DLLVAR__ hid_t H5P_CLS_DATASET_CREATE_g;
__DLLVAR__ hid_t H5P_CLS_DATASET_XFER_g;
__DLLVAR__ hid_t H5P_CLS_MOUNT_g;
/*
* The library created default property lists
*/
#define H5P_NO_CLASS_DEFAULT (H5open(), H5P_LST_NO_CLASS_g)
#define H5P_FILE_CREATE_DEFAULT (H5open(), H5P_LST_FILE_CREATE_g)
#define H5P_FILE_ACCESS_DEFAULT (H5open(), H5P_LST_FILE_ACCESS_g)
#define H5P_DATASET_CREATE_DEFAULT (H5open(), H5P_LST_DATASET_CREATE_g)
#define H5P_DATASET_XFER_DEFAULT (H5open(), H5P_LST_DATASET_XFER_g)
#define H5P_MOUNT_DEFAULT (H5open(), H5P_LST_MOUNT_g)
__DLLVAR__ hid_t H5P_LST_NO_CLASS_g;
__DLLVAR__ hid_t H5P_LST_FILE_CREATE_g;
__DLLVAR__ hid_t H5P_LST_FILE_ACCESS_g;
__DLLVAR__ hid_t H5P_LST_DATASET_CREATE_g;
__DLLVAR__ hid_t H5P_LST_DATASET_XFER_g;
__DLLVAR__ hid_t H5P_LST_MOUNT_g;
/* Public functions */
__DLL__ hid_t H5Pcreate_class(hid_t parent, const char *name, unsigned hashsize,
H5P_cls_create_func_t cls_create, void *create_data,
H5P_cls_copy_func_t cls_copy, void *copy_data,
H5P_cls_close_func_t cls_close, void *close_data);
__DLL__ char *H5Pget_class_name(hid_t pclass_id);
__DLL__ hid_t H5Pcreate_list(hid_t cls_id);
__DLL__ herr_t H5Pregister(hid_t cls_id, const char *name, size_t size,
void *def_value, H5P_prp_create_func_t prp_create,
H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get,
H5P_prp_delete_func_t prp_del, H5P_prp_close_func_t prp_close);
H5P_prp_delete_func_t prp_del,
H5P_prp_copy_func_t prp_copy,
H5P_prp_close_func_t prp_close);
__DLL__ herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size,
void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get,
H5P_prp_delete_func_t prp_delete, H5P_prp_close_func_t prp_close);
H5P_prp_delete_func_t prp_delete,
H5P_prp_copy_func_t prp_copy,
H5P_prp_close_func_t prp_close);
__DLL__ herr_t H5Pset(hid_t plist_id, const char *name, void *value);
__DLL__ htri_t H5Pexist(hid_t plist_id, const char *name);
__DLL__ herr_t H5Pget_size(hid_t id, const char *name, size_t *size);
@ -116,7 +138,7 @@ __DLL__ hid_t H5Pget_class_new(hid_t plist_id);
__DLL__ hid_t H5Pget_class_parent(hid_t pclass_id);
__DLL__ herr_t H5Pget(hid_t plist_id, const char *name, void * value);
__DLL__ htri_t H5Pequal(hid_t id1, hid_t id2);
__DLL__ hid_t H5Pisa_class(hid_t plist_id, hid_t pclass_id);
__DLL__ htri_t H5Pisa_class(hid_t plist_id, hid_t pclass_id);
__DLL__ int H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func,
void *iter_data);
__DLL__ herr_t H5Premove(hid_t plist_id, const char *name);

@ -609,17 +609,18 @@ H5S_hyper_fread (intn dim, H5S_hyper_io_info_t *io_info)
uintn u;
#endif /* QAK */
hsize_t num_read=0; /* Number of elements read */
const H5D_xfer_t *xfer_parms;/* Data transfer property list */
uintn cache_hyper; /* Hyperslab caching turned on? */
uintn block_limit; /* Hyperslab cache limit */
FUNC_ENTER (H5S_hyper_fread, 0);
assert(io_info);
if (H5P_DEFAULT==io_info->dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else {
xfer_parms = H5I_object(io_info->dxpl_id);
assert(xfer_parms);
}
/* Get the hyperslab cache setting and limit */
if (H5P_get(io_info->dxpl_id,H5D_XFER_HYPER_CACHE_NAME,&cache_hyper)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
if (H5P_get(io_info->dxpl_id,H5D_XFER_HYPER_CACHE_LIM_NAME,&block_limit)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
#ifdef QAK
printf("%s: check 1.0, dim=%d\n",FUNC,dim);
@ -672,9 +673,8 @@ H5S_hyper_fread (intn dim, H5S_hyper_io_info_t *io_info)
#endif /* QAK */
/* Check if this hyperslab block is cached or could be cached */
if(!regions[i].node->cinfo.cached &&
(xfer_parms->cache_hyper &&
(xfer_parms->block_limit==0 ||
xfer_parms->block_limit>=(regions[i].node->cinfo.size*io_info->elmt_size)))) {
(cache_hyper &&
(block_limit==0 || block_limit>=(regions[i].node->cinfo.size*io_info->elmt_size)))) {
/* if we aren't cached, attempt to cache the block */
#ifdef QAK
printf("%s: check 2.1.3, caching block\n",FUNC);
@ -992,7 +992,7 @@ H5S_hyper_fread_opt (H5F_t *f, const struct H5O_layout_t *layout,
#ifndef NO_DUFFS_DEVICE
size_t duffs_index; /* Counting index for Duff's device */
#endif /* NO_DUFFS_DEVICE */
const H5D_xfer_t *xfer_parms;/* Data transfer property list */
size_t vector_size; /* Value for vector size */
hsize_t ret_value=0; /* Return value */
FUNC_ENTER (H5S_hyper_fread_opt, 0);
@ -1011,18 +1011,14 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
printf("%s: file_file->hyp.pos[%d]=%d\n",FUNC,(int)i,(int)file_iter->hyp.pos[i]);
#endif /* QAK */
/* Get the data transfer properties */
if (H5P_DEFAULT==dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else {
xfer_parms = H5I_object(dxpl_id);
assert(xfer_parms);
} /* end else */
/* Get the hyperslab vector size */
if (H5P_get(dxpl_id,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
/* Allocate the vector I/O arrays */
if((seq_len_arr = H5FL_ARR_ALLOC(size_t,xfer_parms->vector_size,0))==NULL)
if((seq_len_arr = H5FL_ARR_ALLOC(size_t,vector_size,0))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate vector I/O array");
if((buf_off_arr = H5FL_ARR_ALLOC(hsize_t,xfer_parms->vector_size,0))==NULL)
if((buf_off_arr = H5FL_ARR_ALLOC(hsize_t,vector_size,0))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate vector I/O array");
/* Set the rank of the fastest changing dimension */
@ -1186,7 +1182,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
skip[i]=(tdiminfo[i].stride-tdiminfo[i].block)*slab[i];
/* Fill the sequence length array (since they will all be the same for optimized hyperslabs) */
for(u=0; u<xfer_parms->vector_size; u++)
for(u=0; u<vector_size; u++)
seq_len_arr[u]=actual_bytes;
/* Read in data until an entire sequence can't be read in any longer */
@ -1205,7 +1201,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Gather the sequence */
/* Compute the number of sequences to fill */
tot_seq=MIN(xfer_parms->vector_size-nseq,fast_dim_count);
tot_seq=MIN(vector_size-nseq,fast_dim_count);
/* Get a copy of the number of sequences to fill */
seq_count=tot_seq;
@ -1308,7 +1304,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
fast_dim_count -= tot_seq;
/* If the sequence & offset arrays are full, read them in */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Read in the sequences */
if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
@ -1350,7 +1346,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Gather the sequence */
/* Compute the number of sequences to fill */
tot_seq=MIN(xfer_parms->vector_size-nseq,fast_dim_count);
tot_seq=MIN(vector_size-nseq,fast_dim_count);
/* Get a copy of the number of sequences to fill */
seq_count=tot_seq;
@ -1380,7 +1376,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
fast_dim_count -= tot_seq;
/* If the sequence & offset arrays are full, read them in */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Read in the sequences */
if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
@ -1424,7 +1420,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
nseq++;
/* If the sequence & offset arrays are full, read them in */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Read in the sequences */
if (H5F_seq_readv(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf/*out*/)<0) {
@ -1638,17 +1634,19 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_io_info_t *io_info)
size_t i; /* Counters */
intn j;
hsize_t num_written=0; /* Number of elements read */
const H5D_xfer_t *xfer_parms; /* Data transfer properties */
uintn cache_hyper; /* Hyperslab caching turned on? */
uintn block_limit; /* Hyperslab cache limit */
FUNC_ENTER (H5S_hyper_fwrite, 0);
assert(io_info);
if (H5P_DEFAULT==io_info->dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else {
xfer_parms = H5I_object(io_info->dxpl_id);
assert(xfer_parms);
}
/* Get the hyperslab cache setting and limit */
if (H5P_get(io_info->dxpl_id,H5D_XFER_HYPER_CACHE_NAME,&cache_hyper)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
if (H5P_get(io_info->dxpl_id,H5D_XFER_HYPER_CACHE_LIM_NAME,&block_limit)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
#ifdef QAK
printf("%s: check 1.0\n", FUNC);
@ -1682,7 +1680,7 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_io_info_t *io_info)
region_size=MIN((hssize_t)io_info->nelmts, (regions[i].end-regions[i].start)+1);
/* Check if this hyperslab block is cached or could be cached */
if(!regions[i].node->cinfo.cached && (xfer_parms->cache_hyper && (xfer_parms->block_limit==0 || xfer_parms->block_limit>=(regions[i].node->cinfo.size*io_info->elmt_size)))) {
if(!regions[i].node->cinfo.cached && (cache_hyper && (block_limit==0 || block_limit>=(regions[i].node->cinfo.size*io_info->elmt_size)))) {
/* if we aren't cached, attempt to cache the block */
H5S_hyper_block_cache(regions[i].node,io_info,0);
} /* end if */
@ -1837,7 +1835,7 @@ H5S_hyper_fwrite_opt (H5F_t *f, const struct H5O_layout_t *layout,
#ifndef NO_DUFFS_DEVICE
size_t duffs_index; /* Counting index for Duff's device */
#endif /* NO_DUFFS_DEVICE */
const H5D_xfer_t *xfer_parms;/* Data transfer property list */
size_t vector_size; /* Value for vector size */
hsize_t ret_value=0; /* Return value */
FUNC_ENTER (H5S_hyper_fwrite_opt, 0);
@ -1856,18 +1854,14 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
printf("%s: file_file->hyp.pos[%d]=%d\n",FUNC,(int)i,(int)file_iter->hyp.pos[i]);
#endif /* QAK */
/* Get the data transfer properties */
if (H5P_DEFAULT==dxpl_id) {
xfer_parms = &H5D_xfer_dflt;
} else {
xfer_parms = H5I_object(dxpl_id);
assert(xfer_parms);
} /* end else */
/* Get the hyperslab vector size */
if (H5P_get(dxpl_id,H5D_XFER_HYPER_VECTOR_SIZE_NAME,&vector_size)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, 0, "unable to get value");
/* Allocate the vector I/O arrays */
if((seq_len_arr = H5FL_ARR_ALLOC(size_t,xfer_parms->vector_size,0))==NULL)
if((seq_len_arr = H5FL_ARR_ALLOC(size_t,vector_size,0))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate vector I/O array");
if((buf_off_arr = H5FL_ARR_ALLOC(hsize_t,xfer_parms->vector_size,0))==NULL)
if((buf_off_arr = H5FL_ARR_ALLOC(hsize_t,vector_size,0))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "can't allocate vector I/O array");
/* Set the rank of the fastest changing dimension */
@ -2031,7 +2025,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
skip[i]=(tdiminfo[i].stride-tdiminfo[i].block)*slab[i];
/* Fill the sequence length array (since they will all be the same for optimized hyperslabs) */
for(u=0; u<xfer_parms->vector_size; u++)
for(u=0; u<vector_size; u++)
seq_len_arr[u]=actual_bytes;
/* Write out data until an entire sequence can't be written any longer */
@ -2050,7 +2044,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Gather the sequence */
/* Compute the number of sequences to fill */
tot_seq=MIN(xfer_parms->vector_size-nseq,fast_dim_count);
tot_seq=MIN(vector_size-nseq,fast_dim_count);
/* Get a copy of the number of sequences to fill */
seq_count=tot_seq;
@ -2153,7 +2147,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
fast_dim_count -= tot_seq;
/* If the sequence & offset arrays are full, write them out */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Write out the sequences */
if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
@ -2195,7 +2189,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
/* Gather the sequence */
/* Compute the number of sequences to fill */
tot_seq=MIN(xfer_parms->vector_size-nseq,fast_dim_count);
tot_seq=MIN(vector_size-nseq,fast_dim_count);
/* Get a copy of the number of sequences to fill */
seq_count=tot_seq;
@ -2225,7 +2219,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
fast_dim_count -= tot_seq;
/* If the sequence & offset arrays are full, write them out */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Write out the sequences */
if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {
@ -2269,7 +2263,7 @@ for(i=0; i<file_space->extent.u.simple.rank; i++)
nseq++;
/* If the sequence & offset arrays are full, write them out */
if(nseq>=xfer_parms->vector_size) {
if(nseq>=vector_size) {
/* Write out the sequences */
if (H5F_seq_writev(f, dxpl_id, layout, pline, fill, efl, file_space,
elmt_size, nseq, seq_len_arr, buf_off_arr, buf)<0) {

@ -575,6 +575,9 @@ H5S_mpio_spaces_xfer(H5F_t *f, const struct H5O_layout_t *layout,
assert (mem_space);
assert (buf);
assert (IS_H5FD_MPIO(f));
/* Make certain we have the correct type of property list */
assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id));
assert(TRUE==H5Pisa_class(dxpl_id,H5P_DATASET_XFER_NEW));
/* INCOMPLETE!!! rky 980816 */
/* Currently can only handle H5D_CONTIGUOUS layout */
@ -601,18 +604,24 @@ H5S_mpio_spaces_xfer(H5F_t *f, const struct H5O_layout_t *layout,
* the following block of code, though with the right idea, is not
* correct yet.
*/
{ /* Get the transfer mode */
H5D_xfer_t *dxpl;
H5FD_mpio_dxpl_t *dx;
{
/* Get the transfer mode */
H5FD_mpio_dxpl_t *dx;
hid_t driver_id; /* VFL driver ID */
if (H5P_DEFAULT!=dxpl_id && (dxpl=H5I_object(dxpl_id)) &&
H5FD_MPIO==dxpl->driver_id && (dx=dxpl->driver_info) &&
H5FD_MPIO_COLLECTIVE==dx->xfer_mode) {
/* let it fall through */
}else{
/* Get the driver ID */
if(H5P_get(dxpl_id, H5D_XFER_VFL_ID_NAME, &driver_id)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver ID");
/* Get the driver information */
if(H5P_get(dxpl_id, H5D_XFER_VFL_INFO_NAME, &dx)<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve VFL driver info");
/* Check if we are using the MPIO driver */
if(H5FD_MPIO!=driver_id || H5FD_MPIO_COLLECTIVE!=dx->xfer_mode) {
*must_convert = 1; /* can't do optimized xfer; do the old way */
HGOTO_DONE(SUCCEED);
}
} /* end if */
}
#endif

@ -1809,7 +1809,6 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
size_t buf_stride, size_t bkg_stride, void *_buf,
void *_bkg, hid_t dset_xfer_plist)
{
const H5D_xfer_t *xfer_parms = NULL;
H5T_path_t *tpath; /* Type conversion path */
hid_t tsrc_id = -1, tdst_id = -1;/*temporary type atoms */
H5T_t *src = NULL; /*source data type */
@ -1867,14 +1866,6 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
}
/* Get the dataset transfer property list */
if (H5P_DEFAULT == dset_xfer_plist) {
xfer_parms = &H5D_xfer_dflt;
} else if (H5P_DATASET_XFER != H5P_get_class(dset_xfer_plist) ||
NULL == (xfer_parms = H5I_object(dset_xfer_plist))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms");
}
/*
* Do we process the values from beginning to end or vice
* versa? Also, how many of the elements have the source and
@ -1972,7 +1963,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hsize_t nelmts,
"datatype conversion failed");
/* Write sequence to destination location */
if((*(dst->u.vlen.write))(xfer_parms,dst->u.vlen.f,d,conv_buf,
if((*(dst->u.vlen.write))(dset_xfer_plist,dst->u.vlen.f,d,conv_buf,
(hsize_t)seq_len,(hsize_t)dst_base_size)<0)
HRETURN_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL,
"can't write VL data");

@ -92,7 +92,7 @@ typedef struct H5T_enum_t {
/* VL function pointers */
typedef hssize_t (*H5T_vlen_getlenfunc_t)(H5F_t *f, void *vl_addr);
typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, void *vl_addr, void *buf, size_t len);
typedef herr_t (*H5T_vlen_writefunc_t)(const H5D_xfer_t *xfer_parms, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size);
typedef herr_t (*H5T_vlen_writefunc_t)(hid_t dxpl_id, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size);
/* A VL datatype */
typedef struct H5T_vlen_t {
@ -751,13 +751,13 @@ __DLL__ htri_t H5T_bit_inc(uint8_t *buf, size_t start, size_t size);
/* VL functions */
__DLL__ hssize_t H5T_vlen_seq_mem_getlen(H5F_t *f, void *vl_addr);
__DLL__ herr_t H5T_vlen_seq_mem_read(H5F_t *f, void *vl_addr, void *_buf, size_t len);
__DLL__ herr_t H5T_vlen_seq_mem_write(const H5D_xfer_t *xfer_parms, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
__DLL__ herr_t H5T_vlen_seq_mem_write(hid_t dxpl_id, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
__DLL__ hssize_t H5T_vlen_str_mem_getlen(H5F_t *f, void *vl_addr);
__DLL__ herr_t H5T_vlen_str_mem_read(H5F_t *f, void *vl_addr, void *_buf, size_t len);
__DLL__ herr_t H5T_vlen_str_mem_write(const H5D_xfer_t *xfer_parms, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
__DLL__ herr_t H5T_vlen_str_mem_write(hid_t dxpl_id, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
__DLL__ hssize_t H5T_vlen_disk_getlen(H5F_t *f, void *vl_addr);
__DLL__ herr_t H5T_vlen_disk_read(H5F_t *f, void *vl_addr, void *_buf, size_t len);
__DLL__ herr_t H5T_vlen_disk_write(const H5D_xfer_t *xfer_parms, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
__DLL__ herr_t H5T_vlen_disk_write(hid_t dxpl_id, H5F_t *f, void *vl_addr, void *_buf, hsize_t seq_len, hsize_t base_size);
/* Array functions */
__DLL__ H5T_t * H5T_array_create(H5T_t *base, int ndims,

@ -18,6 +18,7 @@
#include "H5Eprivate.h" /* Errors */
#include "H5HGprivate.h" /* Global Heaps */
#include "H5Iprivate.h" /* IDs */
#include "H5Pprivate.h" /* Property Lists */
#include "H5MMprivate.h" /* Memory Allocation */
#include "H5Tpkg.h" /* Datatypes */
@ -202,8 +203,10 @@ herr_t H5T_vlen_seq_mem_read(H5F_t UNUSED *f, void *vl_addr, void *buf, size_t l
*
*-------------------------------------------------------------------------
*/
herr_t H5T_vlen_seq_mem_write(const H5D_xfer_t *xfer_parms, H5F_t UNUSED *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
herr_t H5T_vlen_seq_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
{
H5MM_allocate_t alloc_func; /* Vlen allocation function */
void *alloc_info; /* Vlen allocation information */
hvl_t *vl=(hvl_t *)vl_addr; /* Pointer to the user's hvl_t information */
size_t len=seq_len*base_size;
@ -216,8 +219,15 @@ herr_t H5T_vlen_seq_mem_write(const H5D_xfer_t *xfer_parms, H5F_t UNUSED *f, voi
if(seq_len!=0) {
/* Use the user's memory allocation routine is one is defined */
assert((seq_len*base_size)==(hsize_t)((size_t)(seq_len*base_size))); /*check for overflow*/
if(xfer_parms->vlen_alloc!=NULL) {
if(NULL==(vl->p=(xfer_parms->vlen_alloc)((size_t)(seq_len*base_size),xfer_parms->alloc_info)))
/* Get the allocation function & info */
if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
if(alloc_func!=NULL) {
if(NULL==(vl->p=(alloc_func)((size_t)(seq_len*base_size),alloc_info)))
HRETURN_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for VL data");
} /* end if */
else { /* Default to system malloc */
@ -313,8 +323,10 @@ herr_t H5T_vlen_str_mem_read(H5F_t UNUSED *f, void *vl_addr, void *buf, size_t l
*
*-------------------------------------------------------------------------
*/
herr_t H5T_vlen_str_mem_write(const H5D_xfer_t *xfer_parms, H5F_t UNUSED *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
herr_t H5T_vlen_str_mem_write(hid_t plist_id, H5F_t UNUSED *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
{
H5MM_allocate_t alloc_func; /* Vlen allocation function */
void *alloc_info; /* Vlen allocation information */
char **s=(char **)vl_addr; /* Pointer to the user's hvl_t information */
size_t len=seq_len*base_size;
@ -325,8 +337,15 @@ herr_t H5T_vlen_str_mem_write(const H5D_xfer_t *xfer_parms, H5F_t UNUSED *f, voi
/* Use the user's memory allocation routine is one is defined */
assert(((seq_len+1)*base_size)==(hsize_t)((size_t)((seq_len+1)*base_size))); /*check for overflow*/
if(xfer_parms->vlen_alloc!=NULL) {
if(NULL==(*s=(xfer_parms->vlen_alloc)((size_t)((seq_len+1)*base_size),xfer_parms->alloc_info)))
/* Get the allocation function & info */
if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_NAME,&alloc_func)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
if (H5P_get(plist_id,H5D_XFER_VLEN_ALLOC_INFO_NAME,&alloc_info)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
if(alloc_func!=NULL) {
if(NULL==(*s=(alloc_func)((size_t)((seq_len+1)*base_size),alloc_info)))
HRETURN_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for VL data");
} /* end if */
else { /* Default to system malloc */
@ -430,7 +449,7 @@ herr_t H5T_vlen_disk_read(H5F_t *f, void *vl_addr, void *buf, size_t UNUSED len)
*
*-------------------------------------------------------------------------
*/
herr_t H5T_vlen_disk_write(const H5D_xfer_t UNUSED *xfer_parms, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
herr_t H5T_vlen_disk_write(hid_t plist_id, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size)
{
uint8_t *vl=(uint8_t *)vl_addr; /* Pointer to the user's hvl_t information */
H5HG_t hobjid;
@ -600,7 +619,9 @@ done:
herr_t
H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *op_data)
{
H5D_xfer_t *xfer_parms = (H5D_xfer_t *)op_data; /* Dataset transfer plist from iterator */
hid_t plist_id = *(hid_t *)op_data; /* Dataset transfer plist from iterator */
H5MM_free_t free_func; /* Vlen free function */
void *free_info=NULL; /* Vlen free information */
H5T_t *dt = NULL;
herr_t ret_value = FAIL;
@ -613,8 +634,14 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED
if (H5I_DATATYPE!=H5I_get_type(type_id) || NULL==(dt=H5I_object(type_id)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
/* Get the free func & information */
if (H5P_get(plist_id,H5D_XFER_VLEN_FREE_NAME,&free_func)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
if (H5P_get(plist_id,H5D_XFER_VLEN_FREE_INFO_NAME,&free_info)<0)
HRETURN_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value");
/* Pull the free function and free info pointer out of the op_data and call the recurse datatype free function */
ret_value=H5T_vlen_reclaim_recurse(elem,dt,xfer_parms->vlen_free,xfer_parms->free_info);
ret_value=H5T_vlen_reclaim_recurse(elem,dt,free_func,free_info);
#ifdef LATER
done:

@ -157,7 +157,7 @@ main (int argc, char *argv[])
if ((space = H5Screate_simple (2, dim, NULL))<0) goto error;
/* Create xfer properties to preserve initialized data */
if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
if ((PRESERVE = H5Pcreate_list (H5P_DATASET_XFER_NEW))<0) goto error;
if (H5Pset_preserve (PRESERVE, 1)<0) goto error;
/*
@ -703,7 +703,7 @@ main (int argc, char *argv[])
/*
* Release resources.
*/
H5Pclose (PRESERVE);
H5Pclose_list (PRESERVE);
H5Dclose (dataset);
H5Fclose (file);

@ -198,7 +198,7 @@ test_simple_io(hid_t file)
/* Create a small conversion buffer to test strip mining */
tconv_buf = malloc (1000);
xfer = H5Pcreate (H5P_DATASET_XFER);
xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW);
assert (xfer>=0);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;
@ -226,7 +226,7 @@ test_simple_io(hid_t file)
}
}
H5Pclose (xfer);
i=H5Pclose_list (xfer);
H5Dclose(dataset);
free (tconv_buf);
PASSED();
@ -383,7 +383,7 @@ test_compression(hid_t file)
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
if ((xfer = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
if ((xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW))<0) goto error;
tconv_buf = malloc (1000);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;
@ -637,7 +637,7 @@ test_compression(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
if (H5Pclose (xfer)<0) goto error;
if (H5Pclose_list (xfer)<0) goto error;
if (H5Pclose (dc)<0) goto error;
if (H5Dclose(dataset)<0) goto error;
free (tconv_buf);

@ -299,7 +299,7 @@ test_extend(H5F_t *f, const char *prefix,
memset(buf, (signed)(128+ctr), (size_t)nelmts);
/* Write to disk */
if (H5F_arr_write(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, buf)<0) {
H5_FAILED();
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
@ -308,7 +308,7 @@ test_extend(H5F_t *f, const char *prefix,
/* Read from disk */
memset(check, 0xff, (size_t)nelmts);
if (H5F_arr_read(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, check)<0) {
H5_FAILED();
printf(" Read failed: ctr=%lu\n", (unsigned long)ctr);
@ -339,7 +339,7 @@ test_extend(H5F_t *f, const char *prefix,
/* Now read the entire array back out and check it */
memset(buf, 0xff, nx * ny * nz);
if (H5F_arr_read(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, whole_size,
if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, whole_size,
whole_size, zero, zero, buf)<0) {
H5_FAILED();
puts(" Read failed for whole array.");
@ -452,7 +452,7 @@ test_sparse(H5F_t *f, const char *prefix, size_t nblocks,
memset(buf, (signed)(128+ctr), nx * ny * nz);
/* write to disk */
if (H5F_arr_write(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, buf)<0) {
H5_FAILED();
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);

@ -1141,7 +1141,7 @@ test_array_vlen_atomic(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);
@ -1195,6 +1195,10 @@ test_array_vlen_atomic(void)
ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close dataset transfer property list */
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close Datatype */
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
@ -1391,7 +1395,7 @@ test_array_vlen_array(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);
@ -1447,6 +1451,10 @@ test_array_vlen_array(void)
ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close dataset transfer property list */
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close Datatype */
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");

@ -72,7 +72,7 @@ test_genprop_basic_class(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
@ -105,7 +105,7 @@ test_genprop_basic_class(void)
CHECK_I(ret, "H5Pclose_class");
/* Create another new generic class, derived from file creation class */
cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS2_NAME,CLASS2_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS2_NAME,CLASS2_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
@ -164,7 +164,7 @@ test_genprop_basic_class_prop(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check the number of properties in class */
@ -177,11 +177,11 @@ test_genprop_basic_class_prop(void)
VERIFY(ret, 0, "H5Pexist");
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Try to insert the first property again (should fail) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
VERIFY(ret, FAIL, "H5Pregister");
/* Check the existance of the first property */
@ -199,11 +199,11 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 1, "H5Pget_nprops");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Try to insert the second property again (should fail) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
VERIFY(ret, FAIL, "H5Pregister");
/* Check the existance of the second property */
@ -221,7 +221,7 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 2, "H5Pget_nprops");
/* Insert third property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the existance of the third property */
@ -320,23 +320,23 @@ test_genprop_class_iter(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@ -403,23 +403,23 @@ test_genprop_class_callback(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,test_genprop_cls_cb1,&crt_cb_struct,test_genprop_cls_cb1,&cls_cb_struct);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,test_genprop_cls_cb1,&crt_cb_struct,NULL,NULL,test_genprop_cls_cb1,&cls_cb_struct);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert fourth property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@ -502,17 +502,17 @@ test_genprop_basic_list(void)
MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (w/default values) */
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@ -604,17 +604,17 @@ test_genprop_basic_list_prop(void)
MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Create a property list from the class */
@ -629,11 +629,11 @@ test_genprop_basic_list_prop(void)
/* Add temporary properties */
/* Insert first temporary property into class (with no callbacks) */
ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Insert second temporary property into class (with no callbacks) */
ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Check the number of properties in list */
@ -761,17 +761,17 @@ test_genprop_list_iter(void)
MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Create a property list from the class */
@ -786,11 +786,11 @@ test_genprop_list_iter(void)
/* Add temporary properties */
/* Insert first temporary property into class (with no callbacks) */
ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Insert second temporary property into class (with no callbacks) */
ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Check the number of properties in list */
@ -844,6 +844,11 @@ typedef struct {
char *del_name;
void *del_value;
/* Copy information */
int cop_count;
char *cop_name;
void *cop_value;
/* Close information */
int cls_count;
char *cls_name;
@ -860,13 +865,13 @@ prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */
**
****************************************************************/
static herr_t
test_genprop_prop_crt_cb1(const char *name, void *def_value)
test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value)
{
/* Set the information from the creation call */
prop1_cb_info.crt_count++;
prop1_cb_info.crt_name=HDstrdup(name);
prop1_cb_info.crt_value=HDmalloc(PROP1_SIZE);
HDmemcpy(prop1_cb_info.crt_value,def_value,PROP1_SIZE);
prop1_cb_info.crt_value=HDmalloc(size);
HDmemcpy(prop1_cb_info.crt_value,def_value,size);
return(SUCCEED);
}
@ -877,7 +882,7 @@ test_genprop_prop_crt_cb1(const char *name, void *def_value)
**
****************************************************************/
static herr_t
test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the set call */
prop1_cb_info.set_count++;
@ -885,8 +890,8 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
if(prop1_cb_info.set_name==NULL)
prop1_cb_info.set_name=HDstrdup(name);
if(prop1_cb_info.set_value==NULL)
prop1_cb_info.set_value=HDmalloc(PROP1_SIZE);
HDmemcpy(prop1_cb_info.set_value,value,PROP1_SIZE);
prop1_cb_info.set_value=HDmalloc(size);
HDmemcpy(prop1_cb_info.set_value,value,size);
return(SUCCEED);
}
@ -897,7 +902,7 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
**
****************************************************************/
static herr_t
test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the get call */
prop1_cb_info.get_count++;
@ -905,8 +910,27 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
if(prop1_cb_info.get_name==NULL)
prop1_cb_info.get_name=HDstrdup(name);
if(prop1_cb_info.get_value==NULL)
prop1_cb_info.get_value=HDmalloc(PROP1_SIZE);
HDmemcpy(prop1_cb_info.get_value,value,PROP1_SIZE);
prop1_cb_info.get_value=HDmalloc(size);
HDmemcpy(prop1_cb_info.get_value,value,size);
return(SUCCEED);
}
/****************************************************************
**
** test_genprop_prop_cop_cb1(): Property copy callback for test_genprop_list_callback
**
****************************************************************/
static herr_t
test_genprop_prop_cop_cb1(const char *name, size_t size, void *value)
{
/* Set the information from the get call */
prop1_cb_info.cop_count++;
if(prop1_cb_info.cop_name==NULL)
prop1_cb_info.cop_name=HDstrdup(name);
if(prop1_cb_info.cop_value==NULL)
prop1_cb_info.cop_value=HDmalloc(size);
HDmemcpy(prop1_cb_info.cop_value,value,size);
return(SUCCEED);
}
@ -917,13 +941,13 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
**
****************************************************************/
static herr_t
test_genprop_prop_cls_cb1(const char *name, void *value)
test_genprop_prop_cls_cb1(const char *name, size_t size, void *value)
{
/* Set the information from the close call */
prop1_cb_info.cls_count++;
prop1_cb_info.cls_name=HDstrdup(name);
prop1_cb_info.cls_value=HDmalloc(PROP1_SIZE);
HDmemcpy(prop1_cb_info.cls_value,value,PROP1_SIZE);
prop1_cb_info.cls_value=HDmalloc(size);
HDmemcpy(prop1_cb_info.cls_value,value,size);
return(SUCCEED);
}
@ -934,14 +958,14 @@ test_genprop_prop_cls_cb1(const char *name, void *value)
**
****************************************************************/
static herr_t
test_genprop_prop_del_cb2(hid_t plist_id, const char *name, void *value)
test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the delete call */
prop2_cb_info.del_count++;
prop2_cb_info.del_plist_id=plist_id;
prop2_cb_info.del_name=HDstrdup(name);
prop2_cb_info.del_value=HDmalloc(PROP2_SIZE);
HDmemcpy(prop2_cb_info.del_value,value,PROP2_SIZE);
prop2_cb_info.del_value=HDmalloc(size);
HDmemcpy(prop2_cb_info.del_value,value,size);
return(SUCCEED);
}
@ -957,35 +981,40 @@ test_genprop_list_callback(void)
{
hid_t cid1; /* Generic Property class ID */
hid_t lid1; /* Generic Property list ID */
hid_t lid2; /* 2nd Generic Property list ID */
size_t nprops; /* Number of properties in class */
int prop1_value; /* Value for property #1 */
int prop1_new_value=20; /* Property #1 new value */
float prop2_value; /* Value for property #2 */
char prop3_value[10];/* Property #3 value */
double prop4_value; /* Property #4 value */
struct { /* Struct for callbacks */
int count;
hid_t id;
} cop_cb_struct;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,test_genprop_cls_cb1,&cop_cb_struct,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with callbacks) */
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cls_cb1);
ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cop_cb1,test_genprop_prop_cls_cb1);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with only delete callback) */
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,test_genprop_prop_del_cb2,NULL);
ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,test_genprop_prop_del_cb2,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert fourth property into class (with no callbacks) */
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@ -993,8 +1022,13 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
/* Initialize class callback structs */
cop_cb_struct.count=0;
cop_cb_struct.id=(-1);
/* Initialize callback information for properties tracked */
HDmemset(&prop1_cb_info,0,sizeof(prop_cb_info));
HDmemset(&prop2_cb_info,0,sizeof(prop_cb_info));
/* Create a property list from the class */
lid1 = H5Pcreate_list(cid1);
@ -1091,6 +1125,25 @@ test_genprop_list_callback(void)
printf("Property #2 value doesn't match!, line=%d\n",__LINE__);
} /* end if */
/* Copy first list */
lid2 = H5Pcopy(lid1);
CHECK_I(lid2, "H5Pcopy");
/* Verify copy callback information for properties tracked */
VERIFY(prop1_cb_info.cop_count, 1, "H5Pcopy");
if(HDstrcmp(prop1_cb_info.cop_name,PROP1_NAME)!=0) {
num_errs++;
printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
} /* end if */
if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value,PROP1_SIZE)!=0) {
num_errs++;
printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
} /* end if */
/* Verify that the class creation callback occurred */
VERIFY(cop_cb_struct.count, 1, "H5Pcopy");
VERIFY(cop_cb_struct.id, lid2, "H5Pcopy");
/* Close first list */
ret = H5Pclose_list(lid1);
CHECK_I(ret, "H5Pclose_list");
@ -1113,6 +1166,8 @@ test_genprop_list_callback(void)
HDfree(prop1_cb_info.get_value);
HDfree(prop1_cb_info.set_name);
HDfree(prop1_cb_info.set_value);
HDfree(prop1_cb_info.cop_name);
HDfree(prop1_cb_info.cop_value);
HDfree(prop1_cb_info.cls_name);
HDfree(prop1_cb_info.cls_value);
HDfree(prop2_cb_info.del_name);

@ -2227,8 +2227,8 @@ test_select_hyper_union(void)
dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate");
xfer = H5Pcreate (H5P_DATASET_XFER);
CHECK(xfer, FAIL, "H5Pcreate");
xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW);
CHECK(xfer, FAIL, "H5Pcreate_list");
ret = H5Pset_hyper_cache(xfer,0,1);
CHECK(ret, FAIL, "H5Pset_hyper_cache");
@ -2258,7 +2258,7 @@ test_select_hyper_union(void)
CHECK(ret, FAIL, "H5Dread");
/* Close transfer property list */
ret = H5Pclose(xfer);
ret = H5Pclose_list(xfer);
CHECK(ret, FAIL, "H5Pclose");
/* Compare data read with data written out */
@ -3170,7 +3170,7 @@ test_select(void)
MESSAGE(5, ("Testing Selections\n"));
/* Create a dataset transfer property list */
plist_id=H5Pcreate(H5P_DATASET_XFER);
plist_id=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(plist_id, FAIL, "H5Pcreate");
/* test I/O with a very small buffer for reads */
@ -3231,7 +3231,7 @@ test_select(void)
CHECK(ret, FAIL, "H5Pclose");
/* Close dataset transfer property list */
ret=H5Pclose(plist_id);
ret=H5Pclose_list(plist_id);
CHECK(ret, FAIL, "H5Pclose");
} /* test_select() */

@ -154,7 +154,7 @@ test_vlstrings_basic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL string */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used);
@ -212,7 +212,7 @@ test_vlstrings_basic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */

@ -149,7 +149,7 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -210,7 +210,7 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@ -289,7 +289,7 @@ test_vltypes_vlen_compound(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -359,7 +359,7 @@ test_vltypes_vlen_compound(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@ -441,7 +441,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -516,7 +516,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@ -658,7 +658,7 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(dataset, FAIL, "H5Dopen");
/* Change to the custom memory allocation routines for reading VL data */
xfer_pid=H5Pcreate(H5P_DATASET_XFER);
xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@ -732,7 +732,7 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */

@ -322,7 +322,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
By default, we will compress HDF5 dataset by using gzip compression if HDF5 file is compressed. */
write_plist = H5Pcreate(H5P_DATASET_XFER);
write_plist = H5Pcreate_list(H5P_DATASET_XFER_NEW);
bufsize = h4memsize *h5dims[1]*ncomp;
if(H5Pset_buffer(write_plist,bufsize,NULL,NULL)<0) {
@ -330,7 +330,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -343,7 +343,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -354,7 +354,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -364,7 +364,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -378,7 +378,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -388,7 +388,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -404,7 +404,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -414,7 +414,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -424,7 +424,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -434,7 +434,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -444,7 +444,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -454,7 +454,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
}
@ -465,7 +465,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -476,7 +476,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -486,7 +486,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
return FAIL;
}
ret = H5Tclose(h5_ctype);
@ -512,7 +512,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(image_data);
free(h5cimage_name);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
return FAIL;
@ -523,7 +523,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(h5cimage_name);
free(image_data);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
return FAIL;
@ -534,7 +534,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
free(h5cimage_name);
free(image_data);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
return FAIL;
@ -549,7 +549,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
printf(" cannot obtain attributes. \n");
free(image_data);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
return FAIL;
@ -573,7 +573,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(h4_transpredattrs(h5dset,HDF4_OBJECT_TYPE,grlabel)==FAIL){
printf("error in getting hdf4 image type attribute \n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -585,7 +585,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(h4_transpredattrs(h5dset,HDF4_OBJECT_NAME,image_name)==FAIL){
printf("error in getting hdf4 image name attribute. \n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -596,7 +596,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(h4_transpredattrs(h5dset,HDF4_IMAGE_CLASS,image_class)==FAIL){
printf("error in getting hdf4 image class attribute. \n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -611,7 +611,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(gr_ref == 0) {
printf("error in obtaining reference number of GR.\n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -622,7 +622,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(h4_transnumattr(h5dset,HDF4_REF_NUM,gr_ref)==FAIL) {
printf("error in getting hdf4 image number attribute.\n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -635,7 +635,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
if(gr_palette(file_id,ri_id,h5dset,h5_palgroup,h4_attr)== FAIL) {
printf("error in translating palette into h5 dataset.\n");
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
H5Sclose(h5d_sid);
H5Dclose(h5dset);
free(h5cimage_name);
@ -644,7 +644,7 @@ int Image_h4_to_h5(int32 file_id,int32 ri_id,hid_t h5_group,hid_t h5_palgroup,in
}
ret = H5Pclose(create_plist);
ret = H5Pclose(write_plist);
ret = H5Pclose_list(write_plist);
ret = H5Sclose(h5d_sid);
ret = H5Dclose(h5dset);
istat = GRendaccess(ri_id);

@ -420,7 +420,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
return FAIL;
}
write_plist = H5Pcreate(H5P_DATASET_XFER);
write_plist = H5Pcreate_list(H5P_DATASET_XFER_NEW);
bufsize = h4memsize;
for(i=1;i<sds_rank;i++)
bufsize *= h5dims[i];
@ -433,6 +433,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
free(chunk_dims);
H5Sclose(h5d_sid);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -443,6 +444,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
free(sds_start);
free(sds_edge);
free(sds_stride);
@ -470,6 +472,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -483,6 +486,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -496,6 +500,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -510,6 +515,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
check_gloattr = 0;
@ -522,6 +528,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
printf(" Error in obtaining sds attributes. \n");
return FAIL;
}
@ -542,6 +549,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
printf("unable to transfer sds label to HDF4 OBJECT TYPE.\n");
return FAIL;
}
@ -556,6 +564,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
printf("unable to transfer sds name to HDF5 dataset attribute.\n");
return FAIL;
}
@ -570,12 +579,14 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup,int
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
printf("unable to transfer sds ref. to HDF5 dataset attribute.\n");
return FAIL;
}
}
istat = SDendaccess(sds_id);
ret = H5Pclose(create_plist);
ret = H5Pclose_list(write_plist);
ret = H5Sclose(h5d_sid);
ret = H5Dclose(h5dset);
free(sds_data);
@ -1471,7 +1482,7 @@ int convert_sdsfillvalue(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimg
}
/* Before HDF5 library make the optimzation of dealing with fill value
data, leave this alone. */
/* write_plist = H5Pcreate(H5P_DATASET_XFER);
/* write_plist = H5Pcreate_list(H5P_DATASET_XFER_NEW);
bufsize = h4memsize;
for(i=1;i<sds_rank;i++)
bufsize *= h5dims[i];
@ -1484,6 +1495,7 @@ int convert_sdsfillvalue(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimg
H5Sclose(h5d_sid);
H5Pclose(create_plist);
H5Pclose_list(write_plist);
return FAIL;
}
@ -1494,7 +1506,7 @@ int convert_sdsfillvalue(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimg
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
H5Pclose(write_plist);
H5Pclose_list(write_plist);
free(sds_start);
free(sds_edge);
free(sds_stride);
@ -1618,6 +1630,7 @@ int convert_sdsfillvalue(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimg
H5Sclose(h5d_sid);
H5Dclose(h5dset);
H5Pclose(create_plist);
/* H5Pclose_list(write_plist); */
return SUCCEED;
}

@ -91,7 +91,7 @@ int main(void)
H5Tinsert(cmp3, "Not Ok", 0, array_dt);
H5Tclose(array_dt);
plist = H5Pcreate(H5P_DATASET_XFER);
plist = H5Pcreate_list(H5P_DATASET_XFER_NEW);
H5Pset_preserve(plist, 1);
/*
@ -166,7 +166,7 @@ int main(void)
H5Tclose(cmp1);
H5Tclose(cmp2);
H5Tclose(cmp3);
H5Pclose(plist);
H5Pclose_list(plist);
H5Fclose(fil);
unlink(fname);
fflush(stdout);