diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-08 06:11:44 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-10-08 06:11:44 (GMT) |
commit | 39fc26566e18ac81c43986ed2013676e2918ded2 (patch) | |
tree | d6241c1c75a5769ad876258b182e84ff02d33e41 /hl/tools/h5watch | |
parent | 43fc25841e2b4b0ad163fe967e6e0750ad3c6bba (diff) | |
download | hdf5-39fc26566e18ac81c43986ed2013676e2918ded2.zip hdf5-39fc26566e18ac81c43986ed2013676e2918ded2.tar.gz hdf5-39fc26566e18ac81c43986ed2013676e2918ded2.tar.bz2 |
[svn-r24263] Changes to do re-reads for metadata with checksums when a file is opened with SWMR access.
There are debugging printfs which will be removed when coding is finalized.
Also some bug fixes:
1) accum.c--clean up some warning messages and use new_argv/new_envp for the call to execve.
2) hl/tools/h5watch--clean up some warning messages and a bug fix for h5watch.c.
This checkin is awaiting code review feedback.
Diffstat (limited to 'hl/tools/h5watch')
-rw-r--r-- | hl/tools/h5watch/extend_dset.c | 14 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watch.c | 18 | ||||
-rw-r--r-- | hl/tools/h5watch/h5watchgentest.c | 1 |
3 files changed, 17 insertions, 16 deletions
diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 61cc09f..b58dce8 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -139,8 +139,8 @@ extend_dset_two(const char *file, char *dname) goto done; /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + two_tests[i][0]; - ext_dims[1] = cur_dims[1] + two_tests[i][1]; + ext_dims[0] = cur_dims[0] + (hsize_t)two_tests[i][0]; + ext_dims[1] = cur_dims[1] + (hsize_t)two_tests[i][1]; /* Extend the dataset */ if(H5Dset_extent(did, ext_dims) < 0) @@ -148,7 +148,7 @@ extend_dset_two(const char *file, char *dname) num_elmts = 1; for(j = 0; j < (unsigned)ndims; j++) - num_elmts *= ext_dims[j]; + num_elmts *= (unsigned)ext_dims[j]; /* Compound type */ if(!HDstrcmp(dname, DSET_CMPD_TWO)) { @@ -172,7 +172,7 @@ extend_dset_two(const char *file, char *dname) } else { /* Integer type */ HDmemset(ibuf, 0, sizeof(ibuf)); for(j = 0; j < num_elmts; j++) - ibuf[j] = i + 1; + ibuf[j] = (int)(i + 1); /* Write to the dataset */ if(H5Dwrite(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf) < 0) @@ -261,7 +261,7 @@ extend_dset_one(const char *file, char *dname) goto done; /* Set up the new extended dimension sizes */ - ext_dims[0] = cur_dims[0] + one_tests[i]; + ext_dims[0] = cur_dims[0] + (hsize_t)one_tests[i]; /* Extend the dataset */ if(H5Dset_extent(did, ext_dims) < 0) @@ -272,7 +272,7 @@ extend_dset_one(const char *file, char *dname) /* Select the extended region */ offset[0] = cur_dims[0]; - count[0] = one_tests[i]; + count[0] = (hsize_t)one_tests[i]; if((sid = H5Dget_space(did)) < 0) goto done; if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0) @@ -305,7 +305,7 @@ extend_dset_one(const char *file, char *dname) goto done; } else { /* Integer type */ for(j = 0; j < (unsigned)one_tests[i]; j++) - ibuf[j] = j; + ibuf[j] = (int)j; /* Write to the extended region of the dataset */ if(H5Dwrite(did, dtid, mid, sid, H5P_DEFAULT, ibuf) < 0) diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 7cf8ff6..8b33fa3 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -20,6 +20,7 @@ #include <float.h> #include "h5tools.h" +#include "h5tools_dump.h" #include "h5tools_utils.h" #include "h5tools_ref.h" #include "h5trav.h" @@ -189,7 +190,7 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank) info.line_per_line = 1; } else - info.line_ncols = g_display_width; + info.line_ncols = (unsigned)g_display_width; info.line_multi_new = 1; @@ -313,7 +314,6 @@ done: static herr_t monitor_dataset(hid_t fid, char *dsetname) { - char drivername[50];/* Driver's name for opening the file */ hid_t did; /* dataset id */ hid_t sid; /* dataspace id */ int ndims; /* # of dimensions in the dataspace */ @@ -404,7 +404,7 @@ monitor_dataset(hid_t fid, char *dsetname) } /* Save the current dimension sizes */ - HDmemcpy(prev_dims, cur_dims, ndims * sizeof(hsize_t)); + HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t)); /* Sleep before next monitor */ HDsleep(g_polling_interval); @@ -516,9 +516,9 @@ done: static herr_t check_dataset(hid_t fid, char *dsetname) { - hid_t did; /* Dataset id */ - hid_t dcp; /* Dataset creation property */ - hid_t sid; /* Dataset's dataspace id */ + hid_t did=-1; /* Dataset id */ + hid_t dcp=-1; /* Dataset creation property */ + hid_t sid=-1; /* Dataset's dataspace id */ int ndims; /* # of dimensions in the dataspace */ unsigned u; /* Local index variable */ hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */ @@ -583,6 +583,8 @@ check_dataset(hid_t fid, char *dsetname) } done: + H5Eset_auto2(H5E_DEFAULT, func, edata); + /* Closing */ H5E_BEGIN_TRY H5Sclose(sid); @@ -590,8 +592,6 @@ done: H5Dclose(did); H5E_END_TRY - H5Eset_auto2(H5E_DEFAULT, func, edata); - return(ret_value); } /* check_dataset() */ @@ -712,7 +712,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'w': /* --width=N */ - g_display_width = HDstrtol(opt_arg, NULL, 0); + g_display_width = (int)HDstrtol(opt_arg, NULL, 0); if(g_display_width < 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); diff --git a/hl/tools/h5watch/h5watchgentest.c b/hl/tools/h5watch/h5watchgentest.c index 36c90e6..e30dc03 100644 --- a/hl/tools/h5watch/h5watchgentest.c +++ b/hl/tools/h5watch/h5watchgentest.c @@ -4,6 +4,7 @@ #include <sys/time.h> #include <sys/resource.h> #include <stdlib.h> +#include <string.h> /* * WATCH.h5: file with various types of datasets for testing-- |