summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-04-07 18:16:22 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-04-07 18:16:22 (GMT)
commit42e2d9dd37a4a943d22f01179abc8eac776f0a9a (patch)
tree31e2657d29dc60870ccaa065cd16cbc2bb83df20 /src/H5D.c
parente0a446b4791de11ea70129ec9679f201b97de93a (diff)
downloadhdf5-42e2d9dd37a4a943d22f01179abc8eac776f0a9a.zip
hdf5-42e2d9dd37a4a943d22f01179abc8eac776f0a9a.tar.gz
hdf5-42e2d9dd37a4a943d22f01179abc8eac776f0a9a.tar.bz2
[svn-r8316] Purpose:
Code optimization Description: Query the dataset creation and transfer properties less often. Platforms tested: Solaris 2.7 (arabica) h5committested
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/H5D.c b/src/H5D.c
index f77911a..5bd0b87 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -75,6 +75,9 @@ H5FL_BLK_DEFINE_STATIC(vlen_fl_buf);
/* Define a static "default" dataset structure to use to initialize new datasets */
static H5D_t H5D_def_dset;
+/* Define a "default" dataset transfer property list cache structure to use for default DXPLs */
+H5D_dxpl_cache_t H5D_def_dxpl_cache;
+
/*-------------------------------------------------------------------------
* Function: H5D_init
@@ -360,6 +363,13 @@ H5D_init_interface(void)
if (H5P_get(def_dcpl, H5D_CRT_FILL_VALUE_NAME, &H5D_def_dset.fill) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill value")
+ /* Reset the "default DXPL cache" information */
+ HDmemset(&H5D_def_dxpl_cache,0,sizeof(H5D_dxpl_cache_t));
+
+ /* Get the default DXPL cache information */
+ if (H5D_get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve default DXPL info")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -939,6 +949,57 @@ done:
} /* end H5D_xfer_close() */
+/*--------------------------------------------------------------------------
+ NAME
+ H5D_get_dcpl_cache
+ PURPOSE
+ Get all the values for the DCPL cache.
+ USAGE
+ herr_t H5D_get_dcpl_cache(dcpl_id, cache)
+ hid_t dcpl_id; IN: DCPL to query
+ H5D_dcpl_cache_t *cache;IN/OUT: DCPL cache to fill with values
+ RETURNS
+ Non-negative on success/Negative on failure.
+ DESCRIPTION
+ Query all the values from a DCPL that are needed by internal routines
+ within the library.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+static herr_t
+H5D_get_dcpl_cache(hid_t dcpl_id, H5D_dcpl_cache_t *cache)
+{
+ H5P_genplist_t *dc_plist; /* Data transfer property list */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_get_dcpl_cache)
+
+ /* Check args */
+ assert(cache);
+
+ /* Get the dataset transfer property list */
+ if (NULL == (dc_plist = H5I_object(dcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list")
+
+ /* Get I/O pipeline info */
+ if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &cache->pline)<0)
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve I/O pipeline info")
+
+ /* Get fill value info */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &cache->fill)<0)
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve fill value info")
+
+ /* Get fill time info */
+ if(H5P_get(dc_plist, H5D_CRT_FILL_TIME_NAME, &cache->fill_time)<0)
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve fill time")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D_get_dcpl_cache() */
+
+
/*-------------------------------------------------------------------------
* Function: H5Dcreate
*
@@ -2080,6 +2141,10 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space
if (H5D_update_entry_info(file, dxpl_id, new_dset, dc_plist) != SUCCEED)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache")
+ /* Get the dataset's DCPL cache info */
+ if (H5D_get_dcpl_cache(new_dset->dcpl_id,&new_dset->dcpl_cache)<0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache")
+
/*
* Give the dataset a name. That is, create and add a new
* "H5G_entry_t" object to the group this dataset is being initially
@@ -2444,6 +2509,10 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize file storage")
}
+ /* Get the dataset's DCPL cache info */
+ if (H5D_get_dcpl_cache(dataset->dcpl_id,&dataset->dcpl_cache)<0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache")
+
/* Success */
ret_value = dataset;