summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-02-06 15:34:01 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-02-06 15:34:01 (GMT)
commitd8cfeadd906c13421c4fe9abe1a5318a956236f6 (patch)
tree1c0c4c1f988ebd2ec44de73411bd8dcc136c6464 /src/H5D.c
parentaaeecad6564fe93bb8de567220eed453f890acf4 (diff)
downloadhdf5-d8cfeadd906c13421c4fe9abe1a5318a956236f6.zip
hdf5-d8cfeadd906c13421c4fe9abe1a5318a956236f6.tar.gz
hdf5-d8cfeadd906c13421c4fe9abe1a5318a956236f6.tar.bz2
[svn-r8158] Purpose:
Code cleanup/optimization Description: Query property list values once, at the beginning of the I/O routines, instead of querying the property list values multiple (lots!) of times in lower level routines. Solution: Create "property list caches" for internal library queries of the property list values. Platforms tested: IBM p690 (copper) w/parallel & fphdf5 h5committest
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 95801fb..da14a45 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -21,7 +21,6 @@
#include "H5private.h" /* Generic Functions */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
-#include "H5FDprivate.h" /* File drivers */
#include "H5FLprivate.h" /* Free Lists */
#include "H5FOprivate.h" /* File objects */
#include "H5HLprivate.h" /* Local heaps */
@@ -3235,6 +3234,7 @@ done:
herr_t
H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
{
+ H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */
herr_t ret_value;
FUNC_ENTER_API(H5Dvlen_reclaim, FAIL)
@@ -3253,8 +3253,12 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf)
if (TRUE!=H5P_isa_class(plist_id,H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
+ /* Get the allocation info */
+ if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info)<0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info");
+
/* Call H5Diterate with args, etc. */
- ret_value=H5Diterate(buf,type_id,space_id,H5T_vlen_reclaim,&plist_id);
+ ret_value=H5Diterate(buf,type_id,space_id,H5T_vlen_reclaim,&vl_alloc_info);
done:
FUNC_LEAVE_API(ret_value)
@@ -3538,7 +3542,6 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
int rank; /* Dataspace # of dimensions */
herr_t ret_value = SUCCEED; /* Return value */
H5S_t *space = NULL;
- H5P_genplist_t *plist;
int u;
unsigned shrink = 0; /* Flag to indicate a dimension has shrank */
unsigned expand = 0; /* Flag to indicate a dimension has grown */
@@ -3599,16 +3602,23 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id)
*-------------------------------------------------------------------------
*/
if(shrink && H5D_CHUNKED == dset->layout.type) {
+ H5P_genplist_t *plist;
+ H5D_dxpl_cache_t dxpl_cache; /* Cached data transfer properties */
+
/* Get the dataset creation property list */
if(NULL == (plist = H5I_object(dset->dcpl_id)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dset creation property list")
+ /* Fill the DXPL cache values for later use */
+ if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
+
/* Remove excess chunks */
- if(H5F_istore_prune_by_extent(dset->ent.file, dxpl_id, &dset->layout, space) < 0)
+ if(H5F_istore_prune_by_extent(dset->ent.file, &dxpl_cache, dxpl_id, &dset->layout, space) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks ")
/* Reset the elements outsize the new dimensions, but in existing chunks */
- if(H5F_istore_initialize_by_extent(dset->ent.file, dxpl_id, &dset->layout, plist, space) < 0)
+ if(H5F_istore_initialize_by_extent(dset->ent.file, &dxpl_cache, dxpl_id, &dset->layout, plist, space) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to initialize chunks ")
} /* end if */
} /* end if */