diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-05-22 15:05:53 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-05-22 15:05:53 (GMT) |
commit | d392756a1b6e28ff5a28e80c5c26513e8ef54e69 (patch) | |
tree | 00479cc9a7baba6c7e8e68d375f79221729751d4 /src/H5AC.c | |
parent | 57e57ebb14aa3f5a88245965292031f25dfc7756 (diff) | |
download | hdf5-d392756a1b6e28ff5a28e80c5c26513e8ef54e69.zip hdf5-d392756a1b6e28ff5a28e80c5c26513e8ef54e69.tar.gz hdf5-d392756a1b6e28ff5a28e80c5c26513e8ef54e69.tar.bz2 |
[svn-r400] Changes since 19980513
----------------------
./html/Datasets.html
Fixed a couple of typos.
./src/H5.c
Added the `Z' modifier to HDfprintf() for `size_t' sizes. Use
it like this:
HDfprintf(stderr,"size is %Zd\n", (size_t)x);
./src/H5AC.c
./src/H5F.c
./src/H5Fprivate.h
The maximum number of meta data objects that can be cached can
be set from the application (but the library might not honor
it every time; it's a hint).
./src/H5D.c
Changed a warning message so it's not so alarming.
./src/H5Fistore.c
Chunks can be cached.
./src/H5O.c
./src/H5Oprivate.h
Added H5O_copy() and H5O_free() to copy and free messages.
./src/H5P.c
./src/H5Ppublic.h
Added H5Pset_cache() and H5Pget_cache() and changed lots of
"template" to "property list".
./src/H5Z.c
./src/H5Zpublic.h
Miscellaneous little things to clean up. Mostly just removed
H5Z_MAXVAL and added H5Z_USERDEF_MIN and H5Z_USERDEF_MAX.
./MANIFEST
./test/Makefile.in
./test/chunk.c [NEW]
Added a performance test for chunk caching. It looks at the
amount of I/O instead of timing because timing is partly
dependent on the chunk size and I wanted a measurement that
was a function of only the cache size. Run `chunk' with no
arguments and then say `gnuplot x-gnuplot' to see the plots
(press return between plots). Postscript files are created for
each plot.
./test/big.c
./test/cmpd_dset.c
./test/extend.c
./test/external.c
./test/gheap.c
Added H5F_ACC_DEBUG so we can see cache performance
statistics.
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -50,7 +50,7 @@ static H5AC_t *current_cache_g = NULL; /*for sorting */ * pass an invalid value then H5AC_NSLOTS is used. You can * turn off caching by using 1 for the SIZE_HINT value. * - * Return: Success: SUCCEED + * Return: Success: Number of slots actually used. * * Failure: FAIL * @@ -62,7 +62,7 @@ static H5AC_t *current_cache_g = NULL; /*for sorting */ * *------------------------------------------------------------------------- */ -herr_t +intn H5AC_create(H5F_t *f, intn size_hint) { H5AC_t *cache = NULL; @@ -70,14 +70,13 @@ H5AC_create(H5F_t *f, intn size_hint) assert(f); assert(NULL == f->shared->cache); - if (size_hint < 1) - size_hint = H5AC_NSLOTS; + if (size_hint < 1) size_hint = H5AC_NSLOTS; f->shared->cache = cache = H5MM_xcalloc(1, sizeof(H5AC_t)); cache->nslots = size_hint; cache->slot = H5MM_xcalloc((intn)(cache->nslots), sizeof(H5AC_slot_t)); - FUNC_LEAVE(SUCCEED); + FUNC_LEAVE(size_hint); } /*------------------------------------------------------------------------- @@ -838,7 +837,7 @@ H5AC_debug(H5F_t *f) FUNC_ENTER(H5AC_debug, FAIL); - fprintf(stderr, "H5AC: cache statistics for file %s\n", f->name); + fprintf(stderr, "H5AC: meta data cache statistics for file %s\n", f->name); fprintf(stderr, " %-18s %8s %8s %8s %8s+%-8s\n", "Layer", "Hits", "Misses", "MissRate", "Inits", "Flushes"); fprintf(stderr, " %-18s %8s %8s %8s %8s-%-8s\n", @@ -866,10 +865,12 @@ H5AC_debug(H5F_t *f) sprintf(s, "unknown id %d", i); } - if (cache->diagnostics[i].nhits) { + if (cache->diagnostics[i].nhits>0 || + cache->diagnostics[i].nmisses>0) { miss_rate = 100.0 * cache->diagnostics[i].nmisses / - cache->diagnostics[i].nhits; - } else { + (cache->diagnostics[i].nhits+ + cache->diagnostics[i].nmisses); + } else { miss_rate = 0.0; } |