[svn-r4680] Purpose:

Code cleanup
Description:
    Property that H5P(g|s)et_hyper_cache uses is no longer in use inside the
    library.
Solution:
    Removed H5P(g|s)et_hyper_cache API functions, except when backward
    compatibility is turned on.  When backward compatibility is turned on,
    the property is defined by the library, but unused internally.
Platforms tested:
    FreeBSD 4.4 (sleipnir)
This commit is contained in:
Quincey Koziol 2001-12-06 14:05:12 -05:00
parent 1b67380c0a
commit 7a30de3a2b
8 changed files with 20 additions and 6 deletions

View File

@ -93,6 +93,7 @@ bool DSetMemXferPropList::getPreserve() const
}
}
#ifdef H5_WANT_H5_V1_4_COMPAT
// Indicates whether to cache hyperslab blocks during I/O
void DSetMemXferPropList::setHyperCache( bool cache, unsigned limit ) const
{
@ -119,6 +120,7 @@ void DSetMemXferPropList::getHyperCache( bool& cache, unsigned& limit ) const
else
cache = false;
}
#endif /* H5_WANT_H5_V1_4_COMPAT */
// Sets B-tree split ratios for a dataset transfer property list
void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const

View File

@ -36,11 +36,13 @@ class DSetMemXferPropList : public PropList {
// Checks status of the dataset transfer property list
bool getPreserve() const;
#ifdef H5_WANT_H5_V1_4_COMPAT
// Indicates whether to cache hyperslab blocks during I/O
void setHyperCache( bool cache, unsigned limit = 0 ) const;
// Returns information regarding the caching of hyperslab blocks during I/O
void getHyperCache( bool& cache, unsigned& limit ) const;
#endif /* H5_WANT_H5_V1_4_COMPAT */
// Sets B-tree split ratios for a dataset transfer property list
void setBtreeRatios( double left, double middle, double right ) const;

View File

@ -185,6 +185,8 @@ New Features
writing.
* Improved performance of non-contiguous hyperslabs (built up with
several hyperslab selection calls).
* Removed H5P(get|set)_hyper_cache API function, since the property is no
longer used.
Platforms Tested
================

View File

@ -143,8 +143,10 @@ H5D_init_interface(void)
void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF;
H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF;
double def_btree_split_ratio[3] = H5D_XFER_BTREE_SPLIT_RATIO_DEF;
#ifdef H5_WANT_H5_V1_4_COMPAT
unsigned def_hyper_cache = H5D_XFER_HYPER_CACHE_DEF;
unsigned def_hyper_cache_lim = H5D_XFER_HYPER_CACHE_LIM_DEF;
#endif /* H5_WANT_H5_V1_4_COMPAT */
H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF;
void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF;
H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF;
@ -216,6 +218,7 @@ H5D_init_interface(void)
if(H5P_register(xfer_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");
#ifdef H5_WANT_H5_V1_4_COMPAT
/* Register the hyperslab caching property */
if(H5P_register(xfer_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");
@ -223,6 +226,7 @@ H5D_init_interface(void)
/* Register the hyperslab cache limit property */
if(H5P_register(xfer_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");
#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Register the vlen allocation function property */
if(H5P_register(xfer_pclass,H5D_XFER_VLEN_ALLOC_NAME,H5D_XFER_VLEN_ALLOC_SIZE,&def_vlen_alloc,NULL,NULL,NULL,NULL,NULL,NULL)<0)

View File

@ -89,6 +89,7 @@
#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}
#ifdef H5_WANT_H5_V1_4_COMPAT
/* Definitions for hyperslab caching property */
#define H5D_XFER_HYPER_CACHE_NAME "hyper_cache"
#define H5D_XFER_HYPER_CACHE_SIZE sizeof(unsigned)
@ -101,10 +102,7 @@
#define H5D_XFER_HYPER_CACHE_LIM_NAME "hyper_cache_limit"
#define H5D_XFER_HYPER_CACHE_LIM_SIZE sizeof(unsigned)
#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(unsigned)
#define H5D_XFER_HYPER_CACHE_LIM_DEF 0
#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Definitions for vlen allocation function property */
#define H5D_XFER_VLEN_ALLOC_NAME "vlen_alloc"
#define H5D_XFER_VLEN_ALLOC_SIZE sizeof(H5MM_allocate_t)

View File

@ -6,7 +6,7 @@
* 605 E. Springfield, Champaign IL 61820 *
* *
* For conditions of distribution and use, see the accompanying *
* hdf/COPYING file. *
* COPYING file. *
* *
****************************************************************************/
@ -2596,6 +2596,7 @@ done:
#endif /* H5_WANT_H5_V1_4_COMPAT */
#ifdef H5_WANT_H5_V1_4_COMPAT
/*-------------------------------------------------------------------------
* Function: H5Pset_hyper_cache
@ -2692,6 +2693,7 @@ H5Pget_hyper_cache(hid_t plist_id, unsigned *cache/*out*/,
done:
FUNC_LEAVE(ret_value);
}
#endif /* H5_WANT_H5_V1_4_COMPAT */
/*-------------------------------------------------------------------------

View File

@ -6,7 +6,7 @@
* 605 E. Springfield, Champaign IL 61820 *
* *
* For conditions of distribution and use, see the accompanying *
* hdf/COPYING file. *
* COPYING file. *
* *
****************************************************************************/
@ -215,10 +215,12 @@ __DLL__ herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts/*out*/,
size_t *rdcc_nelmts/*out*/,
size_t *rdcc_nbytes/*out*/, double *rdcc_w0);
#endif /* H5_WANT_H5_V1_4_COMPAT */
#ifdef H5_WANT_H5_V1_4_COMPAT
__DLL__ herr_t H5Pset_hyper_cache(hid_t plist_id, unsigned cache,
unsigned limit);
__DLL__ herr_t H5Pget_hyper_cache(hid_t plist_id, unsigned *cache,
unsigned *limit);
#endif /* H5_WANT_H5_V1_4_COMPAT */
__DLL__ herr_t H5Pset_btree_ratios(hid_t plist_id, double left, double middle,
double right);
__DLL__ herr_t H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/,

View File

@ -2232,8 +2232,10 @@ test_select_hyper_union(void)
xfer = H5Pcreate (H5P_DATASET_XFER);
CHECK(xfer, FAIL, "H5Pcreate");
#ifdef H5_WANT_H5_V1_4_COMPAT
ret = H5Pset_hyper_cache(xfer,0,1);
CHECK(ret, FAIL, "H5Pset_hyper_cache");
#endif /* H5_WANT_H5_V1_4_COMPAT */
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer,wbuf);