[svn-r16480] Purpose: Improve chunk cache

Description:
The meaning of the "nbytes" field in H5D_rdcc_t was not clear, and some places
assumed it was the maximum size of the chunk cache, while some assumed it was
the current size of the chunk cache.  The end result was that only 1 chunk could
be held in cache at a time.  This field has been replaced by "nbytes_max" and
"nbytes_used".  Performance of cached I/O should improve greatly.

Tested: jam, smirom (h5committest)
This commit is contained in:
Neil Fortner
2009-02-12 15:46:32 -05:00
parent 0eb811d831
commit 0bdedf0a39
6 changed files with 250 additions and 16 deletions

View File

@@ -135,3 +135,49 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_layout_contig_size_test() */
/*--------------------------------------------------------------------------
NAME
H5D_current_cache_size_test
PURPOSE
Determine current the size of the dataset's chunk cache
USAGE
herr_t H5D_layout_contig_size_test(did, size)
hid_t did; IN: Dataset to query
hsize_t *size; OUT: Pointer to location to place size info
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
Checks the size of a contiguous dataset's storage.
GLOBAL VARIABLES
COMMENTS, BUGS, ASSUMPTIONS
DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused)
{
H5D_t *dset; /* Pointer to dataset to query */
herr_t ret_value = SUCCEED; /* return value */
FUNC_ENTER_NOAPI(H5D_current_cache_size_test, FAIL)
/* Check args */
if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
if(nbytes_used) {
HDassert(dset->shared->layout.type == H5D_CHUNKED);
*nbytes_used = dset->shared->cache.chunk.nbytes_used;
} /* end if */
if(nused) {
HDassert(dset->shared->layout.type == H5D_CHUNKED);
*nused = dset->shared->cache.chunk.nused;
} /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_current_cache_size_test() */