summaryrefslogtreecommitdiffstats
path: root/src/H5Fistore.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-04-30 15:54:52 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-04-30 15:54:52 (GMT)
commitcc2184b6efd25633b8a27cb23d57380e2f28a5b4 (patch)
tree6b276ffc0f426d101a06c84d271e64e882fa66a9 /src/H5Fistore.c
parent2be6b9f63c53e20add431b497a13929d2df049a8 (diff)
downloadhdf5-cc2184b6efd25633b8a27cb23d57380e2f28a5b4.zip
hdf5-cc2184b6efd25633b8a27cb23d57380e2f28a5b4.tar.gz
hdf5-cc2184b6efd25633b8a27cb23d57380e2f28a5b4.tar.bz2
[svn-r1240] Changes since 19990427
---------------------- ./tools/h5ls.c Added a `--address' (`-a') switch which causes h5ls to display file addresses for raw data. For contiguous datasets it's just a nice simple number, but for chunked datasets it's a list of logical dataset coordinates, file addresses, filter masks, and storage sizes. Changed `--dump' switch to `--data'. ./src/H5D.c ./src/H5F.c ./src/H5Fprivate.h Enhanced the indexed-storage B-tree iterator so it can dump raw data addresses (and other info) to the standard error stream. Added H5Ddebug() so h5ls has a way to dump addresses for datasets. I'm not sure what else this API function should do, so I think we should discuss it before we document it. So far, h5ls is the only thing that uses it, and we can easily change that. ./src/H5Tconv.c ./test/dtypes.c Finally had a chance to verify Paul's H5T_conv_s_s (general string to string conversions) bug fixes and incorporate them into H5T_conv_f_f (general floating-point to floating-point conversions) and H5T_conv_i_i (general integer to integer conversons). Thanks Paul. ./src/H5D.c ./src/H5S.c ./src/H5Sprivate.h Added performance timers around data space read and write callbacks. They were already there for the gather/scatter callbacks. The timings for read/write callbacks are displayed along with gather/scatter when data space debugging is turned on. ./bin/iostats Updated to print totals. Added a `--fast' option that doesn't do any output except the totals and is much faster. ./bin/trace Changed __unused__ to UNUSED to match source code. ./config/gnu-flags Updated error message for pgcc. I've sent bug reports to the pgcc people but the new version still has the same bug. ./configure.in ./config/conclude.in ./config/depend.in Fixed dependencies for non-GNU makes when run in a directory other than the hdf5 source tree. Updated GNU `make dep' rules to copy the distributed dependencies for non-GNU makes into the source tree when run in some other directory.
Diffstat (limited to 'src/H5Fistore.c')
-rw-r--r--src/H5Fistore.c60
1 files changed, 58 insertions, 2 deletions
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 904caf8..3fdfd0b 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -147,6 +147,7 @@ typedef struct H5F_istore_ud1_t {
haddr_t addr; /*file address of chunk */
H5O_layout_t mesg; /*layout message */
hsize_t total_storage; /*output from iterator */
+ FILE *stream; /*debug output stream */
} H5F_istore_ud1_t;
/* inherits B-tree like properties from H5B */
@@ -724,7 +725,9 @@ 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.
+ * Purpose: Simply counts the number of chunks for a dataset. If the
+ * UDATA.STREAM member is non-null then debugging information is
+ * written to that stream.
*
* Return: Success: Non-negative
*
@@ -744,8 +747,27 @@ H5F_istore_iterate (H5F_t UNUSED *f, void *_lt_key,
{
H5F_istore_ud1_t *bt_udata = (H5F_istore_ud1_t *)_udata;
H5F_istore_key_t *lt_key = (H5F_istore_key_t *)_lt_key;
+ int i;
FUNC_ENTER(H5F_istore_iterate, FAIL);
+
+ if (bt_udata->stream) {
+ if (0==bt_udata->total_storage) {
+ fprintf(bt_udata->stream, " Address:\n");
+ fprintf(bt_udata->stream,
+ " Flags Bytes Address Logical Offset\n");
+ fprintf(bt_udata->stream,
+ " ========== ======== ========== "
+ "==============================\n");
+ }
+ HDfprintf(bt_udata->stream, " 0x%08x %8Zu %10a [",
+ lt_key->filter_mask, lt_key->nbytes, addr);
+ for (i=0; i<bt_udata->mesg.ndims; i++) {
+ HDfprintf(bt_udata->stream, "%s%Hd", i?", ":"", lt_key->offset[i]);
+ }
+ fputs("]\n", bt_udata->stream);
+ }
+
bt_udata->total_storage += lt_key->nbytes;
FUNC_LEAVE(SUCCEED);
}
@@ -1952,8 +1974,8 @@ H5F_istore_allocated(H5F_t *f, int ndims, haddr_t *addr)
H5F_istore_ud1_t udata;
FUNC_ENTER(H5F_istore_nchunks, 0);
+ HDmemset(&udata, 0, sizeof udata);
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");
@@ -1963,6 +1985,40 @@ H5F_istore_allocated(H5F_t *f, int ndims, haddr_t *addr)
/*-------------------------------------------------------------------------
+ * Function: H5F_istore_dump_btree
+ *
+ * Purpose: Prints information about the storage B-tree to the specified
+ * stream.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, April 28, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_istore_dump_btree(H5F_t *f, FILE *stream, int ndims, haddr_t *addr)
+{
+ H5F_istore_ud1_t udata;
+
+ FUNC_ENTER(H5F_istore_dump_btree, FAIL);
+ HDmemset(&udata, 0, sizeof udata);
+ udata.mesg.ndims = ndims;
+ udata.stream = stream;
+ 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(SUCCEED);
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5F_istore_stats
*
* Purpose: Print raw data cache statistics to the debug stream. If