diff options
author | Robb Matzke <matzke@llnl.gov> | 1999-04-23 12:31:21 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1999-04-23 12:31:21 (GMT) |
commit | d534a4dd0d1e646c531a31a5eb04842dfde5f470 (patch) | |
tree | 47b946b229d929139cf0fcad389e790d6a382e70 /src/H5Fistore.c | |
parent | 94dd2f5b3d93c2e14ef2491e70a09a836affdf4c (diff) | |
download | hdf5-d534a4dd0d1e646c531a31a5eb04842dfde5f470.zip hdf5-d534a4dd0d1e646c531a31a5eb04842dfde5f470.tar.gz hdf5-d534a4dd0d1e646c531a31a5eb04842dfde5f470.tar.bz2 |
[svn-r1204] Changes since 19990415
----------------------
./config/depend.in
Fixed automatic dependencies. We were storing dependencies for
*.o files instead of *.lo files after shared libraries were
added.
./config/gnu-flags
./config/linux-gnulibc1
Moved `-march=pentiumpro -mcpu=pentiumpro -malign-double' from
the linux file to this file and caused it to depend on the CPU
name. This fixes one of Elena's bugs.
./src/H5B.c
./src/H5Bprivate.h
./src/H5D.c
./src/H5Dprivate.h
./src/H5Dpublic.h
./src/H5F.c
./src/H5Farray.c
./src/H5Fistore.c
./src/H5Fmpio.c
./src/H5Fprivate.h
./src/H5Fpublic.h
./src/H5Gnode.c
./src/H5P.c
./src/H5RA.c
./src/H5Sall.c
./src/H5Shyper.c
./src/H5Smpio.c
./src/H5Spoint.c
./src/H5Sprivate.h
./src/H5Tpublic.h
./test/istore.c
Added an H5Dget_storage_size() function that reports the
amount of storage allocated for raw data in a dataset.
Changed H5D_xfer_* to H5F_xfer_* because these properties are
more general than datasets. This also allows some of the
lower-level I/O functions to get this information easier.
./src/H5S.c
./src/H5Sall.c
Added two new functions H5S_all_read() and H5S_all_write()
which are optimizations that copy data directly between file
and memory without having to go through the scatter gather
step. This knocks quite a bit of time off the I/O and
reading/writing entire datasets is a fairly common operation.
./tools/h5ls.c
Reports the logical size of data, the allocated size of data,
and the percent utilization.
./MANIFEST
Removed old pablo files, added new files. Snapshots should now
start to work again.
./src/H5D.c
./src/H5Fmpio.c
Removed two warnings signed vs. unsigned comparisons and check
for overflow.
Diffstat (limited to 'src/H5Fistore.c')
-rw-r--r-- | src/H5Fistore.c | 78 |
1 files changed, 73 insertions, 5 deletions
diff --git a/src/H5Fistore.c b/src/H5Fistore.c index 89e262b..d3435a9 100644 --- a/src/H5Fistore.c +++ b/src/H5Fistore.c @@ -108,6 +108,9 @@ static H5B_ins_t H5F_istore_insert(H5F_t *f, const haddr_t *addr, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node/*out*/); +static herr_t H5F_istore_iterate (H5F_t *f, void *left_key, + const haddr_t *addr, void *right_key, + void *_udata); static herr_t H5F_istore_decode_key(H5F_t *f, H5B_t *bt, uint8_t *raw, void *_key); static herr_t H5F_istore_encode_key(H5F_t *f, H5B_t *bt, uint8_t *raw, @@ -143,6 +146,7 @@ typedef struct H5F_istore_ud1_t { H5F_istore_key_t key; /*key values */ haddr_t addr; /*file address of chunk */ H5O_layout_t mesg; /*layout message */ + hsize_t total_storage; /*output from iterator */ } H5F_istore_ud1_t; /* inherits B-tree like properties from H5B */ @@ -158,7 +162,7 @@ H5B_class_t H5B_ISTORE[1] = {{ FALSE, /*follow min branch? */ FALSE, /*follow max branch? */ NULL, /*remove */ - NULL, /*list */ + H5F_istore_iterate, /*iterator */ H5F_istore_decode_key, /*decode */ H5F_istore_encode_key, /*encode */ H5F_istore_debug_key, /*debug */ @@ -718,6 +722,36 @@ H5F_istore_insert(H5F_t *f, const haddr_t *addr, void *_lt_key, /*------------------------------------------------------------------------- + * Function: H5F_istore_iterate + * + * Purpose: Simply counts the number of chunks for a dataset. + * + * Return: Success: Non-negative + * + * Failure: Negative + * + * Programmer: Robb Matzke + * Wednesday, April 21, 1999 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5F_istore_iterate (H5F_t UNUSED *f, void *_lt_key, + const haddr_t UNUSED *addr, + void UNUSED *_rt_key, void *_udata) +{ + H5F_istore_ud1_t *bt_udata = (H5F_istore_ud1_t *)_udata; + H5F_istore_key_t *lt_key = (H5F_istore_key_t *)_lt_key; + + FUNC_ENTER(H5F_istore_iterate, FAIL); + bt_udata->total_storage += lt_key->nbytes; + FUNC_LEAVE(SUCCEED); +} + + +/*------------------------------------------------------------------------- * Function: H5F_istore_init * * Purpose: Initialize the raw data chunk cache for a file. This is @@ -1513,7 +1547,7 @@ H5F_istore_unlock (H5F_t *f, const H5O_layout_t *layout, *------------------------------------------------------------------------- */ herr_t -H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, +H5F_istore_read(H5F_t *f, const H5F_xfer_t *xfer, const H5O_layout_t *layout, const H5O_pline_t *pline, const H5O_fill_t *fill, const hssize_t offset_f[], const hsize_t size[], void *buf) { @@ -1601,7 +1635,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, if (f->shared->access_parms->driver==H5F_LOW_MPIO){ H5F_istore_ud1_t udata; H5O_layout_t l; /* temporary layout */ - H5D_xfer_t tmp_xfer = *xfer; + H5F_xfer_t tmp_xfer = *xfer; if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk"); @@ -1683,7 +1717,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, *------------------------------------------------------------------------- */ herr_t -H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, +H5F_istore_write(H5F_t *f, const H5F_xfer_t *xfer, const H5O_layout_t *layout, const H5O_pline_t *pline, const H5O_fill_t *fill, const hssize_t offset_f[], const hsize_t size[], const void *buf) @@ -1776,7 +1810,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout, if (f->shared->access_parms->driver==H5F_LOW_MPIO){ H5F_istore_ud1_t udata; H5O_layout_t l; /* temporary layout */ - H5D_xfer_t tmp_xfer = *xfer; + H5F_xfer_t tmp_xfer = *xfer; if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){ HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk"); @@ -1895,6 +1929,40 @@ H5F_istore_create(H5F_t *f, H5O_layout_t *layout /*out */ ) /*------------------------------------------------------------------------- + * Function: H5F_istore_allocated + * + * Purpose: Return the number of bytes allocated in the file for storage + * of raw data under the specified B-tree (ADDR is the address + * of the B-tree). + * + * Return: Success: Number of bytes stored in all chunks. + * + * Failure: 0 + * + * Programmer: Robb Matzke + * Wednesday, April 21, 1999 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +hsize_t +H5F_istore_allocated(H5F_t *f, int ndims, haddr_t *addr) +{ + H5F_istore_ud1_t udata; + + FUNC_ENTER(H5F_istore_nchunks, 0); + udata.mesg.ndims = ndims; + udata.total_storage = 0; + if (H5B_iterate(f, H5B_ISTORE, addr, &udata)<0) { + HRETURN_ERROR(H5E_IO, H5E_INTERNAL, 0, + "unable to iterate over chunk B-tree"); + } + FUNC_LEAVE(udata.total_storage); +} + + +/*------------------------------------------------------------------------- * Function: H5F_istore_stats * * Purpose: Print raw data cache statistics to the debug stream. If |