summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/.distdep112
-rw-r--r--src/H5D.c61
-rw-r--r--src/H5Distore.c60
-rw-r--r--src/H5Dpublic.h1
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5Fistore.c60
-rw-r--r--src/H5Fprivate.h23
-rw-r--r--src/H5S.c36
-rw-r--r--src/H5Sprivate.h6
-rw-r--r--src/H5Tconv.c25
10 files changed, 303 insertions, 83 deletions
diff --git a/src/.distdep b/src/.distdep
index e02947b..02eaf65 100644
--- a/src/.distdep
+++ b/src/.distdep
@@ -1,4 +1,4 @@
-H5.o: \
+H5.lo: \
H5.c \
H5private.h \
H5public.h \
@@ -27,7 +27,7 @@ H5.o: \
H5Gpublic.h \
H5Oprivate.h \
H5Opublic.h
-H5A.o: \
+H5A.lo: \
H5A.c \
H5private.h \
H5public.h \
@@ -61,7 +61,7 @@ H5A.o: \
H5Ppublic.h \
H5Apkg.h \
H5Aprivate.h
-H5AC.o: \
+H5AC.lo: \
H5AC.c \
H5private.h \
H5public.h \
@@ -75,7 +75,7 @@ H5AC.o: \
H5Dpublic.h \
H5Eprivate.h \
H5Epublic.h
-H5B.o: \
+H5B.lo: \
H5B.c \
H5private.h \
H5public.h \
@@ -94,7 +94,7 @@ H5B.o: \
H5MFprivate.h \
H5MFpublic.h \
H5MMprivate.h
-H5D.o: \
+H5D.lo: \
H5D.c \
H5private.h \
H5public.h \
@@ -133,7 +133,7 @@ H5D.o: \
H5Pprivate.h \
H5Ppublic.h \
H5TBprivate.h
-H5E.o: \
+H5E.lo: \
H5E.c \
H5private.h \
H5public.h \
@@ -142,7 +142,7 @@ H5E.o: \
H5Iprivate.h \
H5Ipublic.h \
H5Eprivate.h
-H5F.o: \
+H5F.lo: \
H5F.c \
H5private.h \
H5public.h \
@@ -176,7 +176,7 @@ H5F.o: \
H5Epublic.h \
H5MMprivate.h \
H5MMpublic.h
-H5Farray.o: \
+H5Farray.lo: \
H5Farray.c \
H5private.h \
H5public.h \
@@ -205,7 +205,7 @@ H5Farray.o: \
H5Epublic.h \
H5MFprivate.h \
H5MFpublic.h
-H5Fcore.o: \
+H5Fcore.lo: \
H5Fcore.c \
H5private.h \
H5public.h \
@@ -214,7 +214,7 @@ H5Fcore.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5Ffamily.o: \
+H5Ffamily.lo: \
H5Ffamily.c \
H5private.h \
H5public.h \
@@ -223,7 +223,7 @@ H5Ffamily.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5Fistore.o: \
+H5Fistore.lo: \
H5Fistore.c \
H5private.h \
H5public.h \
@@ -252,7 +252,7 @@ H5Fistore.o: \
H5Epublic.h \
H5MFprivate.h \
H5MFpublic.h
-H5Flow.o: \
+H5Flow.lo: \
H5Flow.c \
H5private.h \
H5public.h \
@@ -261,7 +261,7 @@ H5Flow.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5Fmpio.o: \
+H5Fmpio.lo: \
H5Fmpio.c \
H5private.h \
H5public.h \
@@ -285,7 +285,7 @@ H5Fmpio.o: \
H5Tprivate.h \
H5Tpublic.h \
H5Sprivate.h
-H5Fsec2.o: \
+H5Fsec2.lo: \
H5Fsec2.c \
H5private.h \
H5public.h \
@@ -294,7 +294,7 @@ H5Fsec2.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5Fsplit.o: \
+H5Fsplit.lo: \
H5Fsplit.c \
H5private.h \
H5public.h \
@@ -308,7 +308,7 @@ H5Fsplit.o: \
H5Dpublic.h \
H5MFprivate.h \
H5MFpublic.h
-H5Fstdio.o: \
+H5Fstdio.lo: \
H5Fstdio.c \
H5private.h \
H5public.h \
@@ -317,7 +317,7 @@ H5Fstdio.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5G.o: \
+H5G.lo: \
H5G.c \
H5private.h \
H5public.h \
@@ -351,7 +351,7 @@ H5G.o: \
H5ACpublic.h \
H5HLprivate.h \
H5HLpublic.h
-H5Gent.o: \
+H5Gent.lo: \
H5Gent.c \
H5private.h \
H5public.h \
@@ -370,7 +370,7 @@ H5Gent.o: \
H5Gpublic.h \
H5Bprivate.h \
H5Bpublic.h
-H5Gnode.o: \
+H5Gnode.lo: \
H5Gnode.c \
H5private.h \
H5public.h \
@@ -404,7 +404,7 @@ H5Gnode.o: \
H5Sprivate.h \
H5Spublic.h \
H5Zprivate.h
-H5Gstab.o: \
+H5Gstab.lo: \
H5Gstab.c \
H5private.h \
H5public.h \
@@ -434,7 +434,7 @@ H5Gstab.o: \
H5Tprivate.h \
H5Tpublic.h \
H5Sprivate.h
-H5HG.o: \
+H5HG.lo: \
H5HG.c \
H5private.h \
H5public.h \
@@ -453,7 +453,7 @@ H5HG.o: \
H5MFprivate.h \
H5MFpublic.h \
H5MMprivate.h
-H5HL.o: \
+H5HL.lo: \
H5HL.c \
H5private.h \
H5public.h \
@@ -472,7 +472,7 @@ H5HL.o: \
H5MFprivate.h \
H5MFpublic.h \
H5MMprivate.h
-H5I.o: \
+H5I.lo: \
H5I.c \
H5private.h \
H5public.h \
@@ -481,7 +481,7 @@ H5I.o: \
H5Iprivate.h \
H5Ipublic.h \
H5Eprivate.h
-H5MF.o: \
+H5MF.lo: \
H5MF.c \
H5private.h \
H5public.h \
@@ -490,7 +490,7 @@ H5MF.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5MM.o: \
+H5MM.lo: \
H5MM.c \
H5private.h \
H5public.h \
@@ -499,7 +499,7 @@ H5MM.o: \
H5Eprivate.h \
H5Epublic.h \
H5Ipublic.h
-H5O.o: \
+H5O.lo: \
H5O.c \
H5private.h \
H5public.h \
@@ -528,7 +528,7 @@ H5O.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Oattr.o: \
+H5Oattr.lo: \
H5Oattr.c \
H5private.h \
H5public.h \
@@ -557,7 +557,7 @@ H5Oattr.o: \
H5Zprivate.h \
H5Zpublic.h \
H5Apkg.h
-H5Ocomp.o: \
+H5Ocomp.lo: \
H5Ocomp.c \
H5private.h \
H5public.h \
@@ -581,7 +581,7 @@ H5Ocomp.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Ocont.o: \
+H5Ocont.lo: \
H5Ocont.c \
H5private.h \
H5public.h \
@@ -605,7 +605,7 @@ H5Ocont.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Odtype.o: \
+H5Odtype.lo: \
H5Odtype.c \
H5private.h \
H5public.h \
@@ -634,7 +634,7 @@ H5Odtype.o: \
H5Zprivate.h \
H5Zpublic.h \
H5Tpkg.h
-H5Oefl.o: \
+H5Oefl.lo: \
H5Oefl.c \
H5private.h \
H5public.h \
@@ -663,7 +663,7 @@ H5Oefl.o: \
H5Sprivate.h \
H5Spublic.h \
H5Zprivate.h
-H5Ofill.o: \
+H5Ofill.lo: \
H5Ofill.c \
H5private.h \
H5public.h \
@@ -687,7 +687,7 @@ H5Ofill.o: \
H5HGprivate.h \
H5HGpublic.h \
H5Tprivate.h
-H5Olayout.o: \
+H5Olayout.lo: \
H5Olayout.c \
H5private.h \
H5public.h \
@@ -711,7 +711,7 @@ H5Olayout.o: \
H5Sprivate.h \
H5Spublic.h \
H5Zprivate.h
-H5Omtime.o: \
+H5Omtime.lo: \
H5Omtime.c \
H5private.h \
H5public.h \
@@ -735,7 +735,7 @@ H5Omtime.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Oname.o: \
+H5Oname.lo: \
H5Oname.c \
H5private.h \
H5public.h \
@@ -759,7 +759,7 @@ H5Oname.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Onull.o: \
+H5Onull.lo: \
H5Onull.c \
H5private.h \
H5public.h \
@@ -778,7 +778,7 @@ H5Onull.o: \
H5HGprivate.h \
H5HGpublic.h \
H5Tprivate.h
-H5Osdspace.o: \
+H5Osdspace.lo: \
H5Osdspace.c \
H5private.h \
H5public.h \
@@ -802,7 +802,7 @@ H5Osdspace.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Oshared.o: \
+H5Oshared.lo: \
H5Oshared.c \
H5private.h \
H5public.h \
@@ -826,7 +826,7 @@ H5Oshared.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Ostab.o: \
+H5Ostab.lo: \
H5Ostab.c \
H5private.h \
H5public.h \
@@ -850,7 +850,7 @@ H5Ostab.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5P.o: \
+H5P.lo: \
H5P.c \
H5private.h \
H5public.h \
@@ -879,7 +879,7 @@ H5P.o: \
H5Eprivate.h \
H5Epublic.h \
H5MMprivate.h
-H5R.o: \
+H5R.lo: \
H5R.c \
H5private.h \
H5public.h \
@@ -908,7 +908,7 @@ H5R.o: \
H5Eprivate.h \
H5Epublic.h \
H5MMprivate.h
-H5RA.o: \
+H5RA.lo: \
H5RA.c \
H5RAprivate.h \
H5RApublic.h \
@@ -937,7 +937,7 @@ H5RA.o: \
H5Zpublic.h \
H5Eprivate.h \
H5Epublic.h
-H5S.o: \
+H5S.lo: \
H5S.c \
H5private.h \
H5public.h \
@@ -961,7 +961,7 @@ H5S.o: \
H5HGprivate.h \
H5HGpublic.h \
H5Tprivate.h
-H5Sall.o: \
+H5Sall.lo: \
H5Sall.c \
H5private.h \
H5public.h \
@@ -985,7 +985,7 @@ H5Sall.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Shyper.o: \
+H5Shyper.lo: \
H5Shyper.c \
H5private.h \
H5public.h \
@@ -1014,7 +1014,7 @@ H5Shyper.o: \
H5Vprivate.h \
H5MMprivate.h \
H5MMpublic.h
-H5Smpio.o: \
+H5Smpio.lo: \
H5Smpio.c \
H5private.h \
H5public.h \
@@ -1038,7 +1038,7 @@ H5Smpio.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Snone.o: \
+H5Snone.lo: \
H5Snone.c \
H5private.h \
H5public.h \
@@ -1062,7 +1062,7 @@ H5Snone.o: \
H5HGpublic.h \
H5Tprivate.h \
H5Tpublic.h
-H5Spoint.o: \
+H5Spoint.lo: \
H5Spoint.c \
H5private.h \
H5public.h \
@@ -1091,7 +1091,7 @@ H5Spoint.o: \
H5Zprivate.h \
H5Zpublic.h \
H5Vprivate.h
-H5Sselect.o: \
+H5Sselect.lo: \
H5Sselect.c \
H5private.h \
H5public.h \
@@ -1120,7 +1120,7 @@ H5Sselect.o: \
H5Tpublic.h \
H5Zprivate.h \
H5Zpublic.h
-H5T.o: \
+H5T.lo: \
H5T.c \
H5private.h \
H5public.h \
@@ -1149,7 +1149,7 @@ H5T.o: \
H5Eprivate.h \
H5Epublic.h \
H5MMprivate.h
-H5Tbit.o: \
+H5Tbit.lo: \
H5Tbit.c \
H5private.h \
H5public.h \
@@ -1168,7 +1168,7 @@ H5Tbit.o: \
H5Rprivate.h \
H5Rpublic.h \
H5Tprivate.h
-H5Tconv.o: \
+H5Tconv.lo: \
H5Tconv.c \
H5Iprivate.h \
H5Ipublic.h \
@@ -1189,7 +1189,7 @@ H5Tconv.o: \
H5Rprivate.h \
H5Rpublic.h \
H5Tprivate.h
-H5Tinit.o: \
+H5Tinit.lo: \
H5Tinit.c \
H5private.h \
H5public.h \
@@ -1213,7 +1213,7 @@ H5Tinit.o: \
H5Tpublic.h \
H5Gprivate.h \
H5Gpublic.h
-H5TB.o: \
+H5TB.lo: \
H5TB.c \
H5private.h \
H5public.h \
@@ -1222,7 +1222,7 @@ H5TB.o: \
H5Iprivate.h \
H5Ipublic.h \
H5Eprivate.h
-H5V.o: \
+H5V.lo: \
H5V.c \
H5private.h \
H5public.h \
@@ -1246,7 +1246,7 @@ H5V.o: \
H5Tpublic.h \
H5Sprivate.h \
H5Spublic.h
-H5Z.o: \
+H5Z.lo: \
H5Z.c \
H5private.h \
H5public.h \
diff --git a/src/H5D.c b/src/H5D.c
index 7a4a148..43c1fdb 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1545,6 +1545,9 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* application's buffer. This saves at least one mem-to-mem copy.
*/
if (H5T_IS_NOOP(tpath) && sconv->read) {
+#ifdef H5S_DEBUG
+ H5_timer_begin(&timer);
+#endif
status = (sconv->read)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
&(dataset->create_parms->efl),
@@ -1561,6 +1564,12 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* fall through and xfer the data in the more roundabout way */
} else {
/* direct xfer accomplished successfully */
+#ifdef H5S_DEBUG
+ H5_timer_end(&(sconv->stats[1].read_timer), &timer);
+ sconv->stats[1].read_nbytes += nelmts *
+ H5T_get_size(dataset->type);
+ sconv->stats[1].read_ncalls++;
+#endif
goto succeed;
}
#ifdef H5D_DEBUG
@@ -1920,6 +1929,9 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* application buffer to file.
*/
if (H5T_IS_NOOP(tpath) && sconv->write) {
+#ifdef H5S_DEBUG
+ H5_timer_begin(&timer);
+#endif
status = (sconv->write)(dataset->ent.file, &(dataset->layout),
&(dataset->create_parms->pline),
&(dataset->create_parms->efl),
@@ -1936,6 +1948,11 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* fall through and xfer the data in the more roundabout way */
} else {
/* direct xfer accomplished successfully */
+#ifdef H5S_DEBUG
+ H5_timer_end(&(sconv->stats[0].write_timer), &timer);
+ sconv->stats[0].write_nbytes += nelmts * H5T_get_size(mem_type);
+ sconv->stats[0].write_ncalls++;
+#endif
goto succeed;
}
#ifdef H5D_DEBUG
@@ -2515,3 +2532,47 @@ H5D_get_storage_size(H5D_t *dset)
FUNC_LEAVE(size);
}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5Ddebug
+ *
+ * Purpose: Prints various information about a dataset. This function is
+ * not to be documented in the API at this time.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Wednesday, April 28, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Ddebug(hid_t dset_id, unsigned UNUSED flags)
+{
+ H5D_t *dset=NULL;
+
+ FUNC_ENTER(H5Ddebug, FAIL);
+ H5TRACE2("e","iIu",dset_id,flags);
+
+ /* Check args */
+ if (H5I_DATASET!=H5I_get_type(dset_id) ||
+ NULL==(dset=H5I_object(dset_id))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset");
+ }
+
+ /* Print B-tree information */
+ if (H5D_CHUNKED==dset->layout.type) {
+ H5F_istore_dump_btree(dset->ent.file, stdout, dset->layout.ndims,
+ &(dset->layout.addr));
+ } else if (H5D_CONTIGUOUS==dset->layout.type) {
+ HDfprintf(stdout, " %-10s %a\n", "Address:",
+ &(dset->layout.addr));
+ }
+
+ FUNC_LEAVE(SUCCEED);
+}
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 904caf8..3fdfd0b 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.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
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 6130715..89caad6 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -56,6 +56,7 @@ __DLL__ herr_t H5Dread (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
__DLL__ herr_t H5Dwrite (hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t plist_id, const void *buf);
__DLL__ herr_t H5Dextend (hid_t dset_id, const hsize_t *size);
+__DLL__ herr_t H5Ddebug(hid_t dset_id, unsigned int flags);
#ifdef __cplusplus
}
diff --git a/src/H5F.c b/src/H5F.c
index 17cf4cb..7c19921 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -509,11 +509,9 @@ H5F_compare_files(void * _obj, const void * _key)
FUNC_ENTER(H5F_compare_files, FALSE);
#if WIN32
-
ret_value = (obj->shared->key.dev == key->dev &&
obj->shared->key.fileindexhi == key->fileindexhi &&
obj->shared->key.fileindexlo == key->fileindexlo);
-
#else
ret_value = (obj->shared->key.dev == key->dev &&
obj->shared->key.ino == key->ino);
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
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 93f3f64..ad9d86f 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -303,16 +303,17 @@ typedef struct H5F_search_t {
dev_t dev; /* Device number containing file */
ino_t ino; /* Unique file number on device */
#if WIN32
-/*
- Specifies the low-order word of a unique identifier associated with the file.
- This identifier and the volume serial number uniquely identify a file. This number
- may change when the system is restarted or when the file is opened. After a process
- opens a file, the identifier is constant until the file is closed. An application can
- use this identifier and the volume serial number to determine whether two handles refer
- to the same file.
-*/
- int fileindexlo;
- int fileindexhi;
+ /*
+ * Specifies the low-order word of a unique identifier associated with the
+ * file. This identifier and the volume serial number uniquely identify a
+ * file. This number may change when the system is restarted or when the
+ * file is opened. After a process opens a file, the identifier is
+ * constant until the file is closed. An application can use this
+ * identifier and the volume serial number to determine whether two
+ * handles refer to the same file.
+ */
+ int fileindexlo;
+ int fileindexhi;
#endif
} H5F_search_t;
@@ -658,6 +659,8 @@ __DLL__ herr_t H5F_istore_allocate (H5F_t *f,
const double split_ratios[],
const struct H5O_pline_t *pline,
const struct H5O_fill_t *fill);
+__DLL__ herr_t H5F_istore_dump_btree(H5F_t *f, FILE *stream, int ndims,
+ haddr_t *addr);
/* Functions that operate on contiguous storage wrt boot block */
__DLL__ herr_t H5F_block_read(H5F_t *f, const haddr_t *addr, hsize_t size,
diff --git a/src/H5S.c b/src/H5S.c
index b2874ce06..bf4e9cd 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -134,7 +134,9 @@ H5S_term_interface(void)
for (j=0; j<2; j++) {
if (0==path->stats[j].gath_ncalls &&
0==path->stats[j].scat_ncalls &&
- 0==path->stats[j].bkg_ncalls) {
+ 0==path->stats[j].bkg_ncalls &&
+ 0==path->stats[j].read_ncalls &&
+ 0==path->stats[j].write_ncalls) {
continue;
}
if (0==nprints++) {
@@ -202,6 +204,38 @@ H5S_term_interface(void)
path->stats[j].bkg_timer.etime,
buf);
}
+
+ /* Read */
+ if (path->stats[j].read_ncalls) {
+ H5_bandwidth(buf,
+ (double)(path->stats[j].read_nbytes),
+ path->stats[j].read_timer.etime);
+ HDfprintf(H5DEBUG(S),
+ " %16s %10Hu %10Hu %8.2f %8.2f %8.2f "
+ "%10s\n", "read",
+ path->stats[j].read_nbytes,
+ path->stats[j].read_ncalls,
+ path->stats[j].read_timer.utime,
+ path->stats[j].read_timer.stime,
+ path->stats[j].read_timer.etime,
+ buf);
+ }
+
+ /* Write */
+ if (path->stats[j].write_ncalls) {
+ H5_bandwidth(buf,
+ (double)(path->stats[j].write_nbytes),
+ path->stats[j].write_timer.etime);
+ HDfprintf(H5DEBUG(S),
+ " %16s %10Hu %10Hu %8.2f %8.2f %8.2f "
+ "%10s\n", "write",
+ path->stats[j].write_nbytes,
+ path->stats[j].write_ncalls,
+ path->stats[j].write_timer.utime,
+ path->stats[j].write_timer.stime,
+ path->stats[j].write_timer.etime,
+ buf);
+ }
}
}
}
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index b01d9dc..0a652e2 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -278,6 +278,12 @@ typedef struct H5S_conv_t {
H5_timer_t bkg_timer; /*time for background */
hsize_t bkg_nbytes; /*background throughput */
hsize_t bkg_ncalls; /*number of calls */
+ H5_timer_t read_timer; /*time for read calls */
+ hsize_t read_nbytes; /*total bytes read */
+ hsize_t read_ncalls; /*number of calls */
+ H5_timer_t write_timer; /*time for write calls */
+ hsize_t write_nbytes; /*total bytes written */
+ hsize_t write_ncalls; /*number of calls */
} stats[2]; /* 0=output, 1=input */
#endif
} H5S_conv_t;
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index d1f8c6a..7aad1e1 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1259,16 +1259,19 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
direction = 1;
olap = nelmts;
} else if (src->size>=dst->size) {
+ double olap_d = HDceil((double)(dst->size)/
+ (double)(src->size-dst->size));
+
+ olap = (size_t)olap_d;
sp = dp = (uint8_t*)buf;
direction = 1;
- olap = (size_t)(HDceil((double)(src->size)/
- (double)(src->size-dst->size))-1);
} else {
+ double olap_d = HDceil((double)(src->size)/
+ (double)(dst->size-src->size));
+ olap = (size_t)olap_d;
sp = (uint8_t*)buf + (nelmts-1) * src->size;
dp = (uint8_t*)buf + (nelmts-1) * dst->size;
direction = -1;
- olap = (size_t)(HDceil((double)(dst->size)/
- (double)(dst->size-src->size))-1);
}
/* The conversion loop */
@@ -1283,7 +1286,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
d = elmtno<olap ? dbuf : dp;
} else {
s = sp;
- d = elmtno >= nelmts-olap ? dbuf : dp;
+ d = elmtno+olap >= nelmts ? dbuf : dp;
}
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */
@@ -1636,16 +1639,18 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
direction = 1;
olap = nelmts;
} else if (src_p->size>=dst_p->size) {
+ double olap_d = HDceil((double)(dst_p->size)/
+ (double)(src_p->size-dst_p->size));
+ olap = (size_t)olap_d;
sp = dp = (uint8_t*)buf;
direction = 1;
- olap = (size_t)(HDceil((double)(src_p->size)/
- (double)(src_p->size-dst_p->size))-1);
} else {
+ double olap_d = HDceil((double)(src_p->size)/
+ (double)(dst_p->size-src_p->size));
+ olap = (size_t)olap_d;
sp = (uint8_t*)buf + (nelmts-1) * src_p->size;
dp = (uint8_t*)buf + (nelmts-1) * dst_p->size;
direction = -1;
- olap = (size_t)(HDceil((double)(dst_p->size)/
- (double)(dst_p->size-src_p->size))-1);
}
/* The conversion loop */
@@ -1659,7 +1664,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
d = elmtno<olap ? dbuf : dp;
} else {
s = sp;
- d = elmtno >= nelmts-olap ? dbuf : dp;
+ d = elmtno+olap >= nelmts ? dbuf : dp;
}
#ifndef NDEBUG
/* I don't quite trust the overlap calculations yet --rpm */