summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2004-07-02 19:35:04 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2004-07-02 19:35:04 (GMT)
commitc49dd7fa363bdb49416b5587654101064fd547f8 (patch)
treee1dbeee84ca50b94dfab9b1ed630d890405c6f78 /src/H5F.c
parent072919b9d7fa341c1a886fb92841efa444f0ffae (diff)
downloadhdf5-c49dd7fa363bdb49416b5587654101064fd547f8.zip
hdf5-c49dd7fa363bdb49416b5587654101064fd547f8.tar.gz
hdf5-c49dd7fa363bdb49416b5587654101064fd547f8.tar.bz2
[svn-r8791] Purpose: Rewrote metadata cache (H5AC.c, etc.) to improve performance.
Description: Replaced the old metadata cache with a cache with a modified LRU replacement policy. This should improve the hit rate. Solution: Since we want to flush cache entries in increasing address order, I used the threaded binary B-tree code to store the cache entries. There is a fair bit of overhead here, so we may want to consider other options. While the code is designed to allow the support of other replacement algorithms, at present, only a modified version of LRU is supported. The modified LRU algorithm requires that a user selectable portion of the cache entries be clean. The clean entries are evicted first when writes are not permitted. If the pool of clean entries is used up, the cache grows beyond its user specified maximum size. The cache can also exceed its maximum size if the combined size of the protected (or locked) entries exceeds the maximum size of the cache. Platforms tested: eirene (serial, parallel, fp), h5committested Misc. update:
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 2dc7880..32b1ee9 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -1838,6 +1838,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
* We've just opened a fresh new file (or truncated one). We need
* to create & write the superblock.
*/
+
#ifdef H5_HAVE_FPHDF5
if (!H5FD_is_fphdf5_driver(lf) || H5FD_fphdf5_is_captain(lf)) {
#endif /* H5_HAVE_FPHDF5 */
@@ -1979,7 +1980,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
if(fc_degree!=H5F_CLOSE_DEFAULT && fc_degree != shared->fc_degree)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "file close degree doesn't match")
}
-
+
/* Success */
ret_value = file;
@@ -1987,6 +1988,7 @@ done:
if (!ret_value && file)
if(H5F_dest(file, dxpl_id)<0)
HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "problems closing file")
+
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -3272,9 +3274,9 @@ H5F_close(H5F_t *f)
/* Only flush at this point if the file will be closed */
assert(closing);
/* Dump debugging info */
-#ifdef H5AC_DEBUG
+#if H5C_COLLECT_CACHE_STATS
H5AC_stats(f);
-#endif /* H5AC_DEBUG */
+#endif /* H5AC_COLLECT_CACHE_STATS */
/* Only try to flush the file if it was opened with write access */
if(f->intent&H5F_ACC_RDWR) {