summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff.c31
-rw-r--r--tools/lib/h5diff.h3
-rw-r--r--tools/lib/h5diff_array.c143
-rw-r--r--tools/lib/h5diff_attr.c2
-rw-r--r--tools/lib/h5diff_util.c6
-rw-r--r--tools/lib/h5tools.c250
-rw-r--r--tools/lib/h5tools.h22
-rw-r--r--tools/lib/h5tools_dump.c69
-rw-r--r--tools/lib/h5tools_ref.c6
-rw-r--r--tools/lib/h5tools_str.c43
-rw-r--r--tools/lib/h5tools_str.h2
-rw-r--r--tools/lib/h5tools_utils.c6
-rw-r--r--tools/lib/h5tools_utils.h8
-rw-r--r--tools/lib/h5trav.c13
-rw-r--r--tools/lib/h5trav.h2
-rw-r--r--tools/lib/io_timer.c2
-rw-r--r--tools/libtest/h5tools_test_utils.c23
-rw-r--r--tools/src/h5copy/h5copy.c21
-rw-r--r--tools/src/h5diff/h5diff_common.c123
-rw-r--r--tools/src/h5diff/h5diff_common.h2
-rw-r--r--tools/src/h5diff/h5diff_main.c11
-rw-r--r--tools/src/h5diff/ph5diff_main.c7
-rw-r--r--tools/src/h5dump/h5dump.c111
-rw-r--r--tools/src/h5dump/h5dump_ddl.c16
-rw-r--r--tools/src/h5dump/h5dump_xml.c58
-rw-r--r--tools/src/h5format_convert/h5format_convert.c8
-rw-r--r--tools/src/h5import/h5import.c54
-rw-r--r--tools/src/h5jam/h5jam.c18
-rw-r--r--tools/src/h5jam/h5unjam.c6
-rw-r--r--tools/src/h5ls/h5ls.c142
-rw-r--r--tools/src/h5perf/perf.c4
-rw-r--r--tools/src/h5perf/pio_engine.c22
-rw-r--r--tools/src/h5perf/pio_perf.c79
-rw-r--r--tools/src/h5perf/sio_engine.c8
-rw-r--r--tools/src/h5perf/sio_perf.c59
-rw-r--r--tools/src/h5repack/h5repack.c92
-rw-r--r--tools/src/h5repack/h5repack.h8
-rw-r--r--tools/src/h5repack/h5repack_copy.c149
-rw-r--r--tools/src/h5repack/h5repack_filters.c4
-rw-r--r--tools/src/h5repack/h5repack_main.c133
-rw-r--r--tools/src/h5repack/h5repack_refs.c11
-rw-r--r--tools/src/h5repack/h5repack_verify.c10
-rw-r--r--tools/src/h5stat/h5stat.c47
-rw-r--r--tools/src/misc/h5clear.c6
-rw-r--r--tools/src/misc/h5debug.c8
-rw-r--r--tools/src/misc/h5delete.c2
-rw-r--r--tools/src/misc/h5mkgrp.c52
-rw-r--r--tools/test/h5copy/CMakeTests.cmake2
-rw-r--r--tools/test/h5copy/h5copygentest.c4
-rw-r--r--tools/test/h5copy/testh5copy.sh.in2
-rw-r--r--tools/test/h5diff/CMakeTests.cmake4
-rw-r--r--tools/test/h5diff/h5diff_plugin.sh.in6
-rw-r--r--tools/test/h5diff/h5diffgentest.c14
-rw-r--r--tools/test/h5diff/testfiles/h5diff_10.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_600.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_603.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_606.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_612.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_615.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_621.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_622.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_623.txt19
-rw-r--r--tools/test/h5diff/testfiles/h5diff_624.txt19
-rw-r--r--tools/test/h5diff/testh5diff.sh.in8
-rw-r--r--tools/test/h5dump/CMakeTests.cmake4
-rw-r--r--tools/test/h5dump/CMakeTestsPBITS.cmake2
-rw-r--r--tools/test/h5dump/CMakeVFDTests.cmake20
-rw-r--r--tools/test/h5dump/binread.c2
-rw-r--r--tools/test/h5dump/h5dumpgentest.c767
-rw-r--r--tools/test/h5dump/testh5dump.sh.in2
-rw-r--r--tools/test/h5dump/testh5dumppbits.sh.in2
-rw-r--r--tools/test/h5format_convert/h5fc_gentest.c2
-rw-r--r--tools/test/h5format_convert/testh5fc.sh.in2
-rw-r--r--tools/test/h5import/h5importtest.c28
-rw-r--r--tools/test/h5jam/getub.c8
-rw-r--r--tools/test/h5jam/tellub.c6
-rw-r--r--tools/test/h5jam/testh5jam.sh.in2
-rw-r--r--tools/test/h5ls/h5ls_plugin.sh.in2
-rw-r--r--tools/test/h5ls/testh5ls.sh.in4
-rw-r--r--tools/test/h5ls/testh5lsvds.sh.in4
-rw-r--r--tools/test/h5repack/CMakeTests.cmake8
-rw-r--r--tools/test/h5repack/CMakeVFDTests.cmake16
-rw-r--r--tools/test/h5repack/dynlib_rpk.c2
-rw-r--r--tools/test/h5repack/dynlib_vrpk.c2
-rw-r--r--tools/test/h5repack/h5repack.sh.in23
-rw-r--r--tools/test/h5repack/h5repackgentest.c6
-rw-r--r--tools/test/h5repack/h5repacktst.c945
-rw-r--r--tools/test/h5repack/testfiles/README2
-rw-r--r--tools/test/h5repack/testfiles/h5repack-help.txt20
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl14
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help1.ddl4
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help2.ddl4
-rw-r--r--tools/test/h5stat/testfiles/h5stat_nofile.ddl4
-rw-r--r--tools/test/h5stat/testh5stat.sh.in2
-rw-r--r--tools/test/misc/h5clear_gentest.c32
-rw-r--r--tools/test/misc/h5perf_gentest.c6
-rw-r--r--tools/test/misc/testfiles/h5mkgrp_help.txt6
-rw-r--r--tools/test/perform/chunk_cache.c20
-rw-r--r--tools/test/perform/direct_write_perf.c4
-rw-r--r--tools/test/perform/overhead.c2
-rw-r--r--tools/test/perform/perf_meta.c14
-rw-r--r--tools/test/perform/pio_standalone.c2
-rw-r--r--tools/test/perform/pio_standalone.h3
-rw-r--r--tools/test/perform/sio_standalone.c2
-rw-r--r--tools/test/perform/sio_standalone.h3
-rw-r--r--tools/test/perform/zip_perf.c16
-rw-r--r--tools/testfiles/h5dump-help.txt12
-rw-r--r--tools/testfiles/help-1.ls6
-rw-r--r--tools/testfiles/help-2.ls6
-rw-r--r--tools/testfiles/help-3.ls6
-rw-r--r--tools/testfiles/pbits/tnofilename-with-packed-bits.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsIncomplete.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsLengthExceeded.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsLengthPositive.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsMaxExceeded.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetExceeded.ddl12
-rw-r--r--tools/testfiles/pbits/tpbitsOffsetNegative.ddl12
-rw-r--r--tools/testfiles/textlinksrc-nodangle-1.ls6
-rw-r--r--tools/testfiles/tgroup-1.ls6
119 files changed, 2453 insertions, 1824 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index b1e7acd..debd54a 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -648,42 +648,33 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
*-------------------------------------------------------------------------
*/
/* open file 1 */
- if (opts->vfd_info[0].name) {
- if ((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &(opts->vfd_info[0]))) < 0) {
+ if (opts->custom_vol[0] || opts->custom_vfd[0]) {
+ if ((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, opts->custom_vol[0] ? &(opts->vol_info[0]) : NULL,
+ opts->custom_vfd[0] ? &(opts->vfd_info[0]) : NULL)) < 0) {
parallel_print("h5diff: unable to create fapl for input file\n");
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n");
}
}
- if (opts->custom_vol[0]) {
- if ((fapl1_id = h5tools_get_fapl(fapl1_id, &(opts->vol_info[0]), NULL)) < 0) {
- parallel_print("h5diff: unable to create fapl for input file\n");
- H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n");
- }
- }
-
- if ((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, fapl1_id, FALSE, NULL, (size_t)0)) < 0) {
+ if ((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, fapl1_id, (fapl1_id != H5P_DEFAULT), NULL,
+ (size_t)0)) < 0) {
parallel_print("h5diff: <%s>: unable to open file\n", fname1);
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname1);
}
H5TOOLS_DEBUG("file1_id = %s", fname1);
/* open file 2 */
- if (opts->vfd_info[1].name) {
- if ((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &(opts->vfd_info[1]))) < 0) {
- parallel_print("h5diff: unable to create fapl for output file\n");
- H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n");
- }
- }
- if (opts->custom_vol[1]) {
- if ((fapl2_id = h5tools_get_fapl(fapl2_id, &(opts->vol_info[1]), NULL)) < 0) {
+ if (opts->custom_vol[1] || opts->custom_vfd[1]) {
+ if ((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, opts->custom_vol[1] ? &(opts->vol_info[1]) : NULL,
+ opts->custom_vfd[1] ? &(opts->vfd_info[1]) : NULL)) < 0) {
parallel_print("h5diff: unable to create fapl for output file\n");
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n");
}
}
- if ((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, fapl2_id, FALSE, NULL, (size_t)0)) < 0) {
+ if ((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, fapl2_id, (fapl2_id != H5P_DEFAULT), NULL,
+ (size_t)0)) < 0) {
parallel_print("h5diff: <%s>: unable to open file\n", fname2);
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname2);
}
@@ -1241,7 +1232,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id,
H5TOOLS_DEBUG("Beginning of big else block");
/* We're in parallel mode */
/* Since the data type of diff value is hsize_t which can
- * be arbitary large such that there is no MPI type that
+ * be arbitrary large such that there is no MPI type that
* matches it, the value is passed between processes as
* an array of bytes in order to be portable. But this
* may not work in non-homogeneous MPI environments.
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 08a404c..4afb3f6 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -74,7 +74,7 @@ typedef struct {
struct exclude_path_list *exclude_attr; /* keep exclude attribute list */
int count_bool; /* count, compare up to count */
hsize_t count; /* count value */
- diff_err_t err_stat; /* an error ocurred (2, error, 1, differences, 0, no error) */
+ diff_err_t err_stat; /* an error occurred (2, error, 1, differences, 0, no error) */
hsize_t nelmts; /* total number of elements */
hsize_t hs_nelmts; /* number of elements to read at a time*/
int rank; /* dimensionality */
@@ -91,6 +91,7 @@ typedef struct {
h5tools_vol_info_t vol_info[2]; /* VOL information for input file, output file */
h5tools_vfd_info_t vfd_info[2]; /* VFD information for input file, output file */
hbool_t custom_vol[2]; /* Using a custom input, output VOL? */
+ hbool_t custom_vfd[2]; /* Using a custom input, output VFD? */
} diff_opt_t;
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index e16a045..a7156b5 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -24,12 +24,8 @@
*-------------------------------------------------------------------------
*/
-#define F_FORMAT "%-15g %-15g %-15g\n"
-
-#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT "%-15Lg %-15Lg %-15Lg\n"
-#endif
-
+#define F_FORMAT "%-15g %-15g %-15g\n"
+#define LD_FORMAT "%-15Lg %-15Lg %-15Lg\n"
#define I_FORMAT "%-15d %-15d %-15d\n"
#define S_FORMAT "%-16s %-17s\n"
#define UI_FORMAT "%-15u %-15u %-15u\n"
@@ -39,12 +35,8 @@
#define ULLI_FORMAT "%-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "u %-15" H5_PRINTF_LL_WIDTH "u\n"
/* with -p option */
-#define F_FORMAT_P "%-15.10g %-15.10g %-15.10g %-14.10g\n"
-
-#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT_P "%-15.10Lg %-15.10Lg %-15.10Lg %-14.10Lg\n"
-#endif
-
+#define F_FORMAT_P "%-15.10g %-15.10g %-15.10g %-14.10g\n"
+#define LD_FORMAT_P "%-15.10Lg %-15.10Lg %-15.10Lg %-14.10Lg\n"
#define I_FORMAT_P "%-15d %-15d %-15d %-14f\n"
#define UI_FORMAT_P "%-15u %-15u %-15u %-14f\n"
#define LI_FORMAT_P "%-15ld %-15ld %-15ld %-14f\n"
@@ -56,12 +48,8 @@
#define SPACES " "
/* not comparable */
-#define F_FORMAT_P_NOTCOMP "%-15.10g %-15.10g %-15.10g not comparable\n"
-
-#if H5_SIZEOF_LONG_DOUBLE != 0
-#define LD_FORMAT_P_NOTCOMP "%-15.10Lg %-15.10Lg %-15.10Lg not comparable\n"
-#endif
-
+#define F_FORMAT_P_NOTCOMP "%-15.10g %-15.10g %-15.10g not comparable\n"
+#define LD_FORMAT_P_NOTCOMP "%-15.10Lg %-15.10Lg %-15.10Lg not comparable\n"
#define I_FORMAT_P_NOTCOMP "%-15d %-15d %-15d not comparable\n"
#define UI_FORMAT_P_NOTCOMP "%-15u %-15u %-15u not comparable\n"
#define LI_FORMAT_P_NOTCOMP "%-15ld %-15ld %-15ld not comparable\n"
@@ -145,9 +133,7 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2, h
diff_opt_t *opts);
static hbool_t equal_float(float value, float expected, diff_opt_t *opts);
static hbool_t equal_double(double value, double expected, diff_opt_t *opts);
-#if H5_SIZEOF_LONG_DOUBLE != 0
static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts);
-#endif
static int print_data(diff_opt_t *opts);
static void print_pos(diff_opt_t *opts, hsize_t elemtno, size_t u);
@@ -162,10 +148,8 @@ static hsize_t diff_float_element(unsigned char *mem1, unsigned char *mem2, hsiz
diff_opt_t *opts);
static hsize_t diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
diff_opt_t *opts);
-#if H5_SIZEOF_LONG_DOUBLE != 0
static hsize_t diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
diff_opt_t *opts);
-#endif
static hsize_t diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
diff_opt_t *opts);
static hsize_t diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
@@ -191,12 +175,7 @@ static hsize_t diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsi
*-------------------------------------------------------------------------
*/
-#if H5_SIZEOF_LONG_DOUBLE != 0
typedef enum dtype_t { FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE } dtype_t;
-#else
-
-typedef enum dtype_t { FLT_FLOAT, FLT_DOUBLE } dtype_t;
-#endif
/*-------------------------------------------------------------------------
* XCAO, 11/10/2010
@@ -225,7 +204,8 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
mcomp_t members;
H5T_class_t type_class;
- H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%lld errstat:%d", opts->rank, opts->hs_nelmts, opts->err_stat);
+ H5TOOLS_START_DEBUG(" - rank:%d hs_nelmts:%" PRIuHSIZE " errstat:%d", opts->rank, opts->hs_nelmts,
+ opts->err_stat);
opts->print_header = 1; /* enable print header */
/* get the size. */
@@ -278,7 +258,6 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
return nfound;
} /* nelmts */
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
else if (H5Tequal(opts->m_tid, H5T_NATIVE_LDOUBLE)) {
for (i = 0; i < opts->hs_nelmts; i++) {
nfound += diff_ldouble_element(mem1, mem2, i, opts);
@@ -289,7 +268,6 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
return nfound;
} /* nelmts */
}
-#endif
break;
case H5T_INTEGER:
@@ -411,7 +389,8 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
HDmemset(&members, 0, sizeof(mcomp_t));
get_member_types(opts->m_tid, &members);
for (i = 0; i < opts->hs_nelmts; i++) {
- H5TOOLS_DEBUG("opts->pos[%lld]:%lld - nelmts:%lld", i, opts->pos[i], opts->hs_nelmts);
+ H5TOOLS_DEBUG("opts->pos[%" PRIuHSIZE "]:%" PRIuHSIZE " - nelmts:%" PRIuHSIZE, i,
+ opts->pos[i], opts->hs_nelmts);
nfound += diff_datum(mem1 + i * size, mem2 + i * size, i, opts, container1_id, container2_id,
&members);
if (opts->count_bool && nfound >= opts->count)
@@ -419,7 +398,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
} /* i */
close_member_types(&members);
} /* switch */
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -475,7 +454,8 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
hsize_t nfound = 0; /* differences found */
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_START_DEBUG("ph:%d elemtno:%lld - errstat:%d", opts->print_header, elemtno, opts->err_stat);
+ H5TOOLS_START_DEBUG("ph:%d elemtno:%" PRIuHSIZE " - errstat:%d", opts->print_header, elemtno,
+ opts->err_stat);
type_size = H5Tget_size(opts->m_tid);
type_class = H5Tget_class(opts->m_tid);
@@ -725,8 +705,8 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
H5TOOLS_DEBUG("H5T_ARRAY ph=%d", opts->print_header);
arr_opts = *opts;
- H5TOOLS_DEBUG("Check opts: hs_nelmts:%lld to %lld rank:%d to %d", opts->hs_nelmts,
- arr_opts.hs_nelmts, opts->rank, arr_opts.rank);
+ H5TOOLS_DEBUG("Check opts: hs_nelmts:%" PRIuHSIZE " to %" PRIuHSIZE " rank:%d to %d",
+ opts->hs_nelmts, arr_opts.hs_nelmts, opts->rank, arr_opts.rank);
/* get the array's base datatype for each element */
arr_opts.m_tid = H5Tget_super(opts->m_tid);
size = H5Tget_size(arr_opts.m_tid);
@@ -1074,8 +1054,8 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed");
if (H5Rdestroy(ref1_buf) < 0)
H5TOOLS_INFO("H5Rdestroy H5R_OBJECT1 failed");
- H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF complete nfound:%lld - errstat:%d", nfound,
- ref_opts.err_stat);
+ H5TOOLS_DEBUG("H5T_REFERENCE - H5T_STD_REF complete nfound:%" PRIuHSIZE " - errstat:%d",
+ nfound, ref_opts.err_stat);
}
/*-------------------------------------------------------------------------
* H5T_STD_REF_DSETREG
@@ -1286,7 +1266,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
done:
opts->err_stat = opts->err_stat | ret_value;
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -1397,8 +1377,8 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
npoints2 = H5Sget_select_elem_npoints(region2_id);
}
H5E_END_TRY;
- H5TOOLS_DEBUG("blocks: 1=%lld-2=%lld", nblocks1, nblocks2);
- H5TOOLS_DEBUG("points: 1=%lld-2=%lld", npoints1, npoints2);
+ H5TOOLS_DEBUG("blocks: 1=%" PRIdHSIZE "-2=%" PRIdHSIZE, nblocks1, nblocks2);
+ H5TOOLS_DEBUG("points: 1=%" PRIdHSIZE "-2=%" PRIdHSIZE, npoints1, npoints2);
if (nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) {
opts->not_cmp = 1;
@@ -1541,10 +1521,10 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
#if defined(H5DIFF_DEBUG)
for (i = 0; i < npoints1; i++) {
- parallel_print("%sPt%lu: ", i ? "," : "", (unsigned long)i);
+ parallel_print("%sPt%d: ", i ? "," : "", i);
for (j = 0; j < ndims1; j++)
- parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j]));
+ parallel_print("%s%" PRIuHSIZE, j ? "," : "(", ptdata1[i * ndims1 + j]);
parallel_print(")");
}
@@ -1561,7 +1541,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
ret_value = nfound_p + nfound_b;
done:
- H5TOOLS_ENDDEBUG(" with diffs:%lld", ret_value);
+ H5TOOLS_ENDDEBUG(" with diffs:%" PRIuHSIZE, ret_value);
return ret_value;
}
@@ -1598,7 +1578,7 @@ character_compare(char *mem1, char *mem2, hsize_t elemtno, size_t u, diff_opt_t
}
nfound++;
}
- H5TOOLS_ENDDEBUG(": %lld", nfound);
+ H5TOOLS_ENDDEBUG(": %" PRIuHSIZE, nfound);
return nfound;
}
@@ -1620,6 +1600,9 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno,
hbool_t both_zero = FALSE;
double per;
+ /* both_zero is set in the PER_UNSIGN macro but not used in this function */
+ (void)both_zero;
+
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
H5TOOLS_START_DEBUG(" %d=%d", temp1_uchar, temp2_uchar);
@@ -1669,7 +1652,7 @@ character_compare_opt(unsigned char *mem1, unsigned char *mem2, hsize_t elemtno,
nfound++;
}
- H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %" PRIuHSIZE " zero:%d", nfound, both_zero);
return nfound;
}
@@ -1850,7 +1833,7 @@ diff_float_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
}
}
- H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %" PRIuHSIZE " zero:%d", nfound, both_zero);
return nfound;
}
@@ -2021,7 +2004,7 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2034,7 +2017,6 @@ diff_double_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
* Return: number of differences found
*-------------------------------------------------------------------------
*/
-#if H5_SIZEOF_LONG_DOUBLE != 0
static hsize_t
diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, diff_opt_t *opts)
@@ -2084,7 +2066,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
@@ -2131,7 +2113,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
@@ -2178,7 +2160,7 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
opts->print_percentage = 0;
print_pos(opts, elem_idx, 0);
if (print_data(opts)) {
- parallel_print(F_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
+ parallel_print(LD_FORMAT, temp1_double, temp2_double, ABS(temp1_double - temp2_double));
}
nfound++;
}
@@ -2196,11 +2178,10 @@ diff_ldouble_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
-#endif /* H5_SIZEOF_LONG_DOUBLE */
/*-------------------------------------------------------------------------
* Function: diff_schar_element
@@ -2285,7 +2266,7 @@ diff_schar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2373,7 +2354,7 @@ diff_uchar_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2461,7 +2442,7 @@ diff_short_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2553,7 +2534,7 @@ diff_ushort_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2641,7 +2622,7 @@ diff_int_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, dif
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2729,7 +2710,7 @@ diff_uint_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2817,7 +2798,7 @@ diff_long_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, di
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -2907,7 +2888,7 @@ diff_ulong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
nfound++;
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -3000,7 +2981,7 @@ diff_llong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx, d
}
}
- H5TOOLS_ENDDEBUG(":%lld - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(":%" PRIuHSIZE " - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -3100,7 +3081,7 @@ diff_ullong_element(unsigned char *mem1, unsigned char *mem2, hsize_t elem_idx,
}
}
- H5TOOLS_ENDDEBUG(": %lld zero:%d", nfound, both_zero);
+ H5TOOLS_ENDDEBUG(": %" PRIuHSIZE " zero:%d", nfound, both_zero);
return nfound;
}
@@ -3203,7 +3184,6 @@ equal_double(double value, double expected, diff_opt_t *opts)
*-------------------------------------------------------------------------
*/
-#if H5_SIZEOF_LONG_DOUBLE != 0
static hbool_t
equal_ldouble(long double value, long double expected, diff_opt_t *opts)
{
@@ -3244,8 +3224,6 @@ equal_ldouble(long double value, long double expected, diff_opt_t *opts)
return FALSE;
}
-#endif /* #if H5_SIZEOF_LONG_DOUBLE !=0 */
-
/*-------------------------------------------------------------------------
* Function: equal_float
*
@@ -3348,7 +3326,7 @@ print_header(diff_opt_t *opts)
static void
print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
{
- H5TOOLS_START_DEBUG(" -- idx:%lld", idx);
+ H5TOOLS_START_DEBUG(" -- idx:%" PRIuHSIZE, idx);
if (print_data(opts)) {
hsize_t curr_pos = idx;
@@ -3361,8 +3339,8 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
H5TOOLS_DEBUG("rank=%d", opts->rank);
if (opts->rank > 0) {
parallel_print("[ ");
- H5TOOLS_DEBUG("do calc_acc_pos[%lld] nelmts:%lld - errstat:%d", idx, opts->hs_nelmts,
- opts->err_stat);
+ H5TOOLS_DEBUG("do calc_acc_pos[%" PRIuHSIZE "] nelmts:%" PRIuHSIZE " - errstat:%d", idx,
+ opts->hs_nelmts, opts->err_stat);
if (opts->sset[0] != NULL) {
/* Subsetting is used - calculate total position */
hsize_t curr_idx = 0; /* current pos in the selection space for each dimension */
@@ -3389,33 +3367,36 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
j = opts->rank - i - 1;
prev_total_dim_size *= prev_dim_size;
dim_size = opts->dims[j];
- H5TOOLS_DEBUG("j=%d, dim_size=%lld, prev_dim_size=%lld, total_dim_size=%lld, "
- "prev_total_dim_size=%lld",
+ H5TOOLS_DEBUG("j=%d, dim_size=%" PRIuHSIZE ", prev_dim_size=%" PRIuHSIZE
+ ", total_dim_size=%" PRIuHSIZE ", "
+ "prev_total_dim_size=%" PRIuHSIZE,
j, dim_size, prev_dim_size, total_dim_size, prev_total_dim_size);
count = opts->sset[0]->count.data[j];
block = opts->sset[0]->block.data[j];
stride = opts->sset[0]->stride.data[j];
- H5TOOLS_DEBUG("stride=%lld, count=%lld, block=%lld", stride, count, block);
+ H5TOOLS_DEBUG("stride=%" PRIuHSIZE ", count=%" PRIuHSIZE ", block=%" PRIuHSIZE,
+ stride, count, block);
tmp = count * block;
k0 = curr_idx / tmp;
k1 = curr_idx % tmp;
curr_pos += k1 * stride * prev_total_dim_size;
- H5TOOLS_DEBUG("curr_idx=%lld, k0=%lld, k1=%lld, curr_pos=%lld", curr_idx, k0, k1,
- curr_pos);
+ H5TOOLS_DEBUG("curr_idx=%" PRIuHSIZE ", k0=%" PRIuHSIZE ", k1=%" PRIuHSIZE
+ ", curr_pos=%" PRIuHSIZE,
+ curr_idx, k0, k1, curr_pos);
if (k0 > 0)
curr_idx = k0 * total_dim_size;
- H5TOOLS_DEBUG("curr_idx=%lld, tmp=%lld", curr_idx, tmp);
+ H5TOOLS_DEBUG("curr_idx=%" PRIuHSIZE ", tmp=%" PRIuHSIZE, curr_idx, tmp);
total_dim_size *= dim_size;
/* if last calculation exists within in current dimension */
if (k0 == 0)
break;
- H5TOOLS_DEBUG("j=%d, curr_pos=%lld", j, curr_pos);
+ H5TOOLS_DEBUG("j=%d, curr_pos=%" PRIuHSIZE, j, curr_pos);
prev_dim_size = dim_size;
}
/* check if there is a final calculation needed for slowest changing dimension */
if (k0 > 0)
curr_pos += k0 * stride * prev_total_dim_size;
- H5TOOLS_DEBUG("4:curr_idx=%lld, curr_pos=%lld", curr_idx, curr_pos);
+ H5TOOLS_DEBUG("4:curr_idx=%" PRIuHSIZE ", curr_pos=%" PRIuHSIZE, curr_idx, curr_pos);
}
}
/*
@@ -3425,11 +3406,11 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
calc_acc_pos((unsigned)opts->rank, curr_pos, opts->acc, opts->pos);
for (int i = 0; i < opts->rank; i++) {
- H5TOOLS_DEBUG("pos loop:%d with opts->pos=%lld opts->sm_pos=%lld", i, opts->pos[i],
- opts->sm_pos[i]);
+ H5TOOLS_DEBUG("pos loop:%d with opts->pos=%" PRIuHSIZE " opts->sm_pos=%" PRIuHSIZE, i,
+ opts->pos[i], opts->sm_pos[i]);
opts->pos[i] += (unsigned long)opts->sm_pos[i];
- H5TOOLS_DEBUG("pos loop:%d with opts->pos=%lld", i, opts->pos[i]);
- parallel_print(HSIZE_T_FORMAT, (unsigned long long)opts->pos[i]);
+ H5TOOLS_DEBUG("pos loop:%d with opts->pos=%" PRIuHSIZE, i, opts->pos[i]);
+ parallel_print("%" PRIuHSIZE, opts->pos[i]);
parallel_print(" ");
}
parallel_print("]");
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 5c1777a..63b6d8f 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -292,7 +292,7 @@ build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t **table_out,
}
if (opts->mode_verbose_level >= 1)
- parallel_print("Attributes status: %d common, %d only in obj1, %d only in obj2\n",
+ parallel_print("Attributes status: %zu common, %zu only in obj1, %zu only in obj2\n",
table_lp->nattrs - table_lp->nattrs_only1 - table_lp->nattrs_only2,
table_lp->nattrs_only1, table_lp->nattrs_only2);
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index e487a12..05f380a 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -39,11 +39,11 @@ print_dimensions(int rank, hsize_t *dims)
else {
parallel_print("[");
for (i = 0; i < rank - 1; i++) {
- parallel_print(HSIZE_T_FORMAT, dims[i]);
+ parallel_print("%" PRIuHSIZE, dims[i]);
parallel_print("x");
}
- parallel_print(HSIZE_T_FORMAT, dims[rank - 1]);
+ parallel_print("%" PRIuHSIZE, dims[rank - 1]);
parallel_print("]");
}
}
@@ -133,10 +133,8 @@ print_type(hid_t type)
parallel_print("H5T_NATIVE_FLOAT");
else if (H5Tequal(type, H5T_NATIVE_DOUBLE))
parallel_print("H5T_NATIVE_DOUBLE");
-#if H5_SIZEOF_LONG_DOUBLE != 0
else if (H5Tequal(type, H5T_NATIVE_LDOUBLE))
parallel_print("H5T_NATIVE_LDOUBLE");
-#endif
else
parallel_print("undefined float");
break;
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index ae1f91d..3273a11 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -460,8 +460,8 @@ h5tools_set_error_file(const char *fname, int is_bin)
/*-------------------------------------------------------------------------
* Function: h5tools_set_fapl_vfd
*
- * Purpose: Given a VFL driver name, sets the appropriate driver on the
- * specified FAPL.
+ * Purpose: Given a VFL driver name or ID, sets the appropriate driver on
+ * the specified FAPL.
*
* Return: positive - succeeded
* negative - failed
@@ -472,113 +472,146 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info)
{
herr_t ret_value = SUCCEED;
- /* Determine which driver the user wants to open the file with */
- if (!HDstrcmp(vfd_info->name, drivernames[SEC2_VFD_IDX])) {
- /* SEC2 Driver */
- if (H5Pset_fapl_sec2(fapl_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[DIRECT_VFD_IDX])) {
+ switch (vfd_info->type) {
+ case VFD_BY_NAME:
+ /* Determine which driver the user wants to open the file with */
+ if (!HDstrcmp(vfd_info->u.name, drivernames[SEC2_VFD_IDX])) {
+ /* SEC2 Driver */
+ if (H5Pset_fapl_sec2(fapl_id) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[DIRECT_VFD_IDX])) {
#ifdef H5_HAVE_DIRECT
- /* Direct Driver */
- if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_direct failed");
+ /* Direct Driver */
+ if (H5Pset_fapl_direct(fapl_id, 1024, 4096, 8 * 4096) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_direct failed");
#else
- H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled");
+ H5TOOLS_GOTO_ERROR(FAIL, "Direct VFD is not enabled");
#endif
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[LOG_VFD_IDX])) {
- unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[LOG_VFD_IDX])) {
+ unsigned long long log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
- /* Log Driver */
- if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t)0) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[WINDOWS_VFD_IDX])) {
+ /* Log Driver */
+ if (H5Pset_fapl_log(fapl_id, NULL, log_flags, (size_t)0) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_log failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[WINDOWS_VFD_IDX])) {
#ifdef H5_HAVE_WINDOWS
- /* There is no Windows VFD - use SEC2 */
- if (H5Pset_fapl_sec2(fapl_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed");
+ /* There is no Windows VFD - use SEC2 */
+ if (H5Pset_fapl_sec2(fapl_id) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_sec2 failed");
#else
- H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled");
+ H5TOOLS_GOTO_ERROR(FAIL, "Windows VFD is not enabled");
#endif
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[STDIO_VFD_IDX])) {
- /* Stdio Driver */
- if (H5Pset_fapl_stdio(fapl_id) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[CORE_VFD_IDX])) {
- /* Core Driver */
- if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, TRUE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[FAMILY_VFD_IDX])) {
- /* FAMILY Driver */
- /* Set member size to be 0 to indicate the current first member size
- * is the member size.
- */
- if (H5Pset_fapl_family(fapl_id, (hsize_t)0, H5P_DEFAULT) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[SPLIT_VFD_IDX])) {
- /* SPLIT Driver */
- if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[MULTI_VFD_IDX])) {
- /* MULTI Driver */
- if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed");
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[MPIO_VFD_IDX])) {
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[STDIO_VFD_IDX])) {
+ /* Stdio Driver */
+ if (H5Pset_fapl_stdio(fapl_id) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_stdio failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[CORE_VFD_IDX])) {
+ /* Core Driver */
+ if (H5Pset_fapl_core(fapl_id, (size_t)H5_MB, TRUE) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_core failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[FAMILY_VFD_IDX])) {
+ /* FAMILY Driver */
+ /* Set member size to be 0 to indicate the current first member size
+ * is the member size.
+ */
+ if (H5Pset_fapl_family(fapl_id, (hsize_t)0, H5P_DEFAULT) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_family failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[SPLIT_VFD_IDX])) {
+ /* SPLIT Driver */
+ if (H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_split failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[MULTI_VFD_IDX])) {
+ /* MULTI Driver */
+ if (H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_multi failed");
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[MPIO_VFD_IDX])) {
#ifdef H5_HAVE_PARALLEL
- int mpi_initialized, mpi_finalized;
+ int mpi_initialized, mpi_finalized;
- /* MPI-I/O Driver */
+ /* MPI-I/O Driver */
- /* check if MPI is available. */
- MPI_Initialized(&mpi_initialized);
- MPI_Finalized(&mpi_finalized);
+ /* check if MPI is available. */
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
- if (mpi_initialized && !mpi_finalized) {
- if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_mpio failed");
- }
+ if (mpi_initialized && !mpi_finalized) {
+ if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_mpio failed");
+ }
#else
- H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled");
+ H5TOOLS_GOTO_ERROR(FAIL, "MPI-I/O VFD is not enabled");
#endif /* H5_HAVE_PARALLEL */
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[ROS3_VFD_IDX])) {
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[ROS3_VFD_IDX])) {
#ifdef H5_HAVE_ROS3_VFD
- if (!vfd_info->info)
- H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid");
- if (H5Pset_fapl_ros3(fapl_id, (H5FD_ros3_fapl_t *)vfd_info->info) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed");
+ if (!vfd_info->info)
+ H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD info is invalid");
+ if (H5Pset_fapl_ros3(fapl_id, (H5FD_ros3_fapl_t *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_ros3() failed");
#else
- H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled");
+ H5TOOLS_GOTO_ERROR(FAIL, "Read-only S3 VFD is not enabled");
#endif
- }
- else if (!HDstrcmp(vfd_info->name, drivernames[HDFS_VFD_IDX])) {
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[HDFS_VFD_IDX])) {
#ifdef H5_HAVE_LIBHDFS
- if (!vfd_info->info)
- H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid");
- if (H5Pset_fapl_hdfs(fapl_id, (H5FD_hdfs_fapl_t *)vfd_info->info) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_hdfs() failed");
+ if (!vfd_info->info)
+ H5TOOLS_GOTO_ERROR(FAIL, "HDFS VFD info is invalid");
+ if (H5Pset_fapl_hdfs(fapl_id, (H5FD_hdfs_fapl_t *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_hdfs() failed");
#else
- H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled");
+ H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled");
#endif
+ }
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) {
+ /* Onion driver */
+ if (!vfd_info->info)
+ H5TOOLS_GOTO_ERROR(FAIL, "Onion VFD info is invalid");
+ if (H5Pset_fapl_onion(fapl_id, (H5FD_onion_fapl_info_t *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_onion() failed");
+ }
+ else {
+ /*
+ * Try to load VFD plugin.
+ *
+ * Currently, driver configuration strings are unsupported.
+ */
+ if (H5Pset_driver_by_name(fapl_id, vfd_info->u.name, (const char *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "can't load VFD plugin by driver name '%s'", vfd_info->u.name);
+ }
+
+ break;
+
+ case VFD_BY_VALUE:
+ /*
+ * Try to load VFD plugin.
+ *
+ * Currently, driver configuration strings are unsupported.
+ */
+ if (H5Pset_driver_by_value(fapl_id, vfd_info->u.value, (const char *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "can't load VFD plugin by driver value '%ld'",
+ (long int)vfd_info->u.value);
+ break;
+
+ default:
+ H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD retrieval type");
}
- else if (!HDstrcmp(vfd_info->name, drivernames[ONION_VFD_IDX])) {
- if (!vfd_info->info)
- H5TOOLS_GOTO_ERROR(FAIL, "Onion VFD info is invalid");
- if (H5Pset_fapl_onion(fapl_id, (H5FD_onion_fapl_info_t *)vfd_info->info) < 0)
- H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_onion() failed");
- }
- else
- H5TOOLS_GOTO_ERROR(FAIL, "invalid VFD name");
done:
+ if (ret_value < 0) {
+ /* Clear error message unless asked for */
+ if (enable_error_stack <= 1)
+ H5Epop(H5tools_ERR_STACK_g, 1);
+ }
+
return ret_value;
}
@@ -678,6 +711,10 @@ done:
if (ret_value < 0) {
if (connector_id >= 0 && H5Idec_ref(connector_id) < 0)
H5TOOLS_ERROR(FAIL, "failed to decrement refcount on VOL connector ID");
+
+ /* Clear error message unless asked for */
+ if (enable_error_stack <= 1)
+ H5Epop(H5tools_ERR_STACK_g, 1);
}
return ret_value;
@@ -726,9 +763,15 @@ h5tools_get_fapl(hid_t prev_fapl_id, h5tools_vol_info_t *vol_info, h5tools_vfd_i
ret_value = new_fapl_id;
done:
- if ((new_fapl_id >= 0) && (ret_value < 0)) {
- H5Pclose(new_fapl_id);
- new_fapl_id = H5I_INVALID_HID;
+ if (ret_value < 0) {
+ if (new_fapl_id >= 0) {
+ H5Pclose(new_fapl_id);
+ new_fapl_id = H5I_INVALID_HID;
+ }
+
+ /* Clear error message unless asked for */
+ if (enable_error_stack <= 1)
+ H5Epop(H5tools_ERR_STACK_g, 1);
}
return ret_value;
@@ -910,7 +953,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
* as TRUE, we should return failure now since the file couldn't be opened with
* the VFL driver/VOL connector that was set on the FAPL by the caller.
*/
- if (fid < 0 && use_specific_driver)
+ if (use_specific_driver)
H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to open file using specified FAPL");
/*
@@ -944,8 +987,9 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
if (drivernum == LOG_VFD_IDX)
continue;
- vfd_info.info = NULL;
- vfd_info.name = drivernames[drivernum];
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.info = NULL;
+ vfd_info.u.name = drivernames[drivernum];
/* Get a fapl reflecting the selected VOL connector and VFD */
if ((tmp_fapl_id = h5tools_get_fapl(fapl_id, &vol_info, &vfd_info)) < 0)
@@ -996,6 +1040,10 @@ done:
if (tmp_fapl_id >= 0)
H5Pclose(tmp_fapl_id);
+ /* Clear error message unless asked for */
+ if (ret_value < 0 && enable_error_stack <= 1)
+ H5Epop(H5tools_ERR_STACK_g, 1);
+
return ret_value;
}
@@ -1012,7 +1060,7 @@ done:
H5_ATTR_PURE static size_t
h5tools_count_ncols(const char *s)
{
- register size_t i;
+ size_t i;
for (i = 0; *s; s++)
if (*s >= ' ')
@@ -1850,15 +1898,21 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
hid_t region_id = H5I_INVALID_HID;
hid_t region_space = H5I_INVALID_HID;
H5S_sel_type region_type;
+ H5R_ref_t tref;
+
+ if (size > sizeof(tref))
+ H5TOOLS_THROW((-1), "unexpectedly large ref");
+
+ HDmemset(&tref, 0, sizeof(tref));
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char *)_mem) + block_index * size;
- if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ HDmemcpy(&tref, mem, size);
+ if ((region_id = H5Ropen_object(&tref, H5P_DEFAULT, H5P_DEFAULT)) < 0)
H5TOOLS_INFO("H5Ropen_object H5T_STD_REF failed");
else {
- if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >=
- 0) {
- if (!h5tools_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
+ if ((region_space = H5Ropen_region(&tref, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (!h5tools_is_zero(&tref, H5Tget_size(H5T_STD_REF))) {
region_type = H5Sget_select_type(region_space);
if (region_type == H5S_SEL_POINTS)
render_bin_output_region_points(region_space, region_id, stream,
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index f8b6389..fdc354c 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -29,9 +29,6 @@
#define START_OF_DATA 0x0001
#define END_OF_DATA 0x0002
-/* format for hsize_t */
-#define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u"
-
#define H5TOOLS_DUMP_MAX_RANK H5S_MAX_RANK
/* Stream macros */
@@ -240,7 +237,7 @@ typedef struct h5tool_format_t {
*
* fmt_schar: The printf() format to use when rendering data which is
* typed `signed char'. The default is `%d'. This format is
- * used ony if the `ascii' field is zero.
+ * used only if the `ascii' field is zero.
*
* fmt_uchar: The printf() format to use when rendering data which is
* typed `unsigned char'. The default is `%u'. This format
@@ -411,9 +408,9 @@ typedef struct h5tool_format_t {
* sep: Each integer in the index list will be separated from the
* others by this string, which defaults to a comma.
*
- * fmt: After the index values are formated individually and
+ * fmt: After the index values are formatted individually and
* separated from one another by some string, the entire
- * resulting string will be formated according to this
+ * resulting string will be formatted according to this
* printf(3c) format which should include a format for a
* character string. The default is "%s".
*/
@@ -483,7 +480,7 @@ typedef struct h5tool_format_t {
const char *line_suf; /*string to append to each line */
const char *line_sep; /*separates lines */
int line_multi_new; /*split multi-line outputs? */
- const char *line_indent; /*for extra identation if we need it*/
+ const char *line_indent; /*for extra indentation if we need it*/
/*used to skip the first set of checks for line length*/
int skip_first;
@@ -553,6 +550,7 @@ typedef struct h5tools_context_t {
*/
typedef enum { VOL_BY_NAME, VOL_BY_VALUE } h5tools_vol_info_type_t;
+typedef enum { VFD_BY_NAME, VFD_BY_VALUE } h5tools_vfd_info_type_t;
typedef struct h5tools_vol_info_t {
h5tools_vol_info_type_t type;
@@ -568,12 +566,16 @@ typedef struct h5tools_vol_info_t {
} h5tools_vol_info_t;
typedef struct h5tools_vfd_info_t {
+ h5tools_vfd_info_type_t type;
/* Pointer to information to be passed to the driver for its setup */
const void *info;
- /* Name of the VFD */
- const char *name;
+ /* Field specifying either the driver's name or value (ID) */
+ union {
+ const char * name;
+ H5FD_class_value_t value;
+ } u;
} h5tools_vfd_info_t;
/* This enum should match the entries in the above 'volnames'
@@ -602,7 +604,7 @@ typedef enum {
} driver_idx;
/* The following include, h5tools_str.h, must be after the
- * above stucts are defined. There is a dependency in the following
+ * above structs are defined. There is a dependency in the following
* include that hasn't been identified yet. */
#include "h5tools_str.h"
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index cb4f9d2..78dd3ff 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -478,7 +478,7 @@ done:
* This is a special case subfunction to print the data in a region reference of type blocks.
*
* Return:
- * The function returns FAIL if there was an error, otherwise SUCEED
+ * The function returns FAIL if there was an error, otherwise SUCCEED
*
* Parameters Description:
* h5tools_str_t *buffer is the string into which to render
@@ -500,7 +500,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for
hsize_t * count = NULL;
hsize_t blkndx;
hsize_t total_size[H5S_MAX_RANK];
- hsize_t elmtno; /* elemnt index */
+ hsize_t elmtno; /* element index */
hsize_t curr_pos = 0;
unsigned int region_flags; /* buffer extent flags */
hsize_t numelem;
@@ -745,11 +745,11 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea
/* Start coordinates and opposite corner */
for (loop_indx = 0; loop_indx < ndims; loop_indx++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : "(",
+ h5tools_str_append(buffer, "%s%" PRIuHSIZE, loop_indx ? "," : "(",
ptdata[indx * 2 * ndims + loop_indx]);
for (loop_indx = 0; loop_indx < ndims; loop_indx++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : ")-(",
+ h5tools_str_append(buffer, "%s%" PRIuHSIZE, loop_indx ? "," : ")-(",
ptdata[indx * 2 * ndims + loop_indx + ndims]);
h5tools_str_append(buffer, ")");
@@ -896,7 +896,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre
{
hbool_t dimension_break = TRUE;
hsize_t * dims1 = NULL;
- hsize_t elmtno; /* elemnt index */
+ hsize_t elmtno; /* element index */
hsize_t curr_pos = 0;
hsize_t total_size[H5S_MAX_RANK];
hsize_t jndx;
@@ -1101,7 +1101,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea
(unsigned long)indx);
for (loop_indx = 0; loop_indx < ndims; loop_indx++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : "(",
+ h5tools_str_append(buffer, "%s%" PRIuHSIZE, loop_indx ? "," : "(",
ptdata[indx * ndims + loop_indx]);
h5tools_str_append(buffer, ")");
@@ -1286,7 +1286,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
H5TOOLS_START_DEBUG(" ");
if ((size_t)ctx->ndims > NELMTS(sm_size))
- H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed");
+ H5TOOLS_THROW(FAIL, "ndims and sm_size comparison failed");
size_row_block = ctx->sset->block.data[row_dim];
@@ -2486,7 +2486,7 @@ found_string_type:
ctx->need_prefix = TRUE;
h5tools_str_reset(buffer);
- h5tools_str_append(buffer, "OPAQUE_SIZE \"%s\";", size);
+ h5tools_str_append(buffer, "OPAQUE_SIZE \"%zu\";", size);
h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
}
@@ -2608,7 +2608,7 @@ found_string_type:
if (H5Tget_array_dims2(type, dims) >= 0) {
/* Print array dimensions */
for (i = 0; i < ndims; i++)
- h5tools_str_append(buffer, "[" HSIZE_T_FORMAT "]", dims[i]);
+ h5tools_str_append(buffer, "[%" PRIuHSIZE "]", dims[i]);
h5tools_str_append(buffer, " ");
}
@@ -2683,12 +2683,12 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
case H5S_SIMPLE:
/* simple dataspace */
- h5tools_str_append(buffer, "%s %s { %s " HSIZE_T_FORMAT,
+ h5tools_str_append(buffer, "%s %s { %s %" PRIuHSIZE,
h5tools_dump_header_format->dataspacedescriptionbegin, S_SIMPLE,
h5tools_dump_header_format->dataspacedimbegin, size[0]);
for (i = 1; i < ndims; i++)
- h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, size[i]);
+ h5tools_str_append(buffer, ", %" PRIuHSIZE, size[i]);
h5tools_str_append(buffer, " %s / ", h5tools_dump_header_format->dataspacedimend);
@@ -2696,14 +2696,14 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedimbegin,
"H5S_UNLIMITED");
else
- h5tools_str_append(buffer, "%s " HSIZE_T_FORMAT,
- h5tools_dump_header_format->dataspacedimbegin, maxsize[0]);
+ h5tools_str_append(buffer, "%s %" PRIuHSIZE, h5tools_dump_header_format->dataspacedimbegin,
+ maxsize[0]);
for (i = 1; i < ndims; i++)
if (maxsize[i] == H5S_UNLIMITED)
h5tools_str_append(buffer, ", %s", "H5S_UNLIMITED");
else
- h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, maxsize[i]);
+ h5tools_str_append(buffer, ", %" PRIuHSIZE, maxsize[i]);
h5tools_str_append(buffer, " %s }", h5tools_dump_header_format->dataspacedimend);
break;
@@ -2742,7 +2742,6 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
{
char ** name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
- unsigned char *copy = NULL; /*a pointer to value array */
unsigned i;
unsigned nmembs = 0; /*number of members */
int snmembs;
@@ -2834,16 +2833,16 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
h5tools_str_append(buffer, "%02x", value[i * dst_size + j]);
}
else if (H5T_SGN_NONE == H5Tget_sign(native)) {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value + i * dst_size;
- h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long *)((void *)copy)));
+ unsigned long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(buffer, "%llu", copy);
}
else {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value + i * dst_size;
- h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "d", *((long long *)((void *)copy)));
+ long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(buffer, "%lld", copy);
}
h5tools_str_append(buffer, ";");
@@ -2996,7 +2995,7 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END);
+ h5tools_str_append(&buffer, "%s %s %" PRId64 " %s", OBJID, BEGIN, oid, END);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
h5tools_str_close(&buffer);
@@ -3174,10 +3173,10 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tools_str_append(&buffer, "%s ", CHUNKED);
rank = H5Pget_chunk(dcpl_id, (int)NELMTS(chsize), chsize);
- h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin,
+ h5tools_str_append(&buffer, "%s %" PRIuHSIZE, h5tools_dump_header_format->dataspacedimbegin,
chsize[0]);
for (i = 1; i < rank; i++)
- h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]);
+ h5tools_str_append(&buffer, ", %" PRIuHSIZE, chsize[i]);
h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
@@ -3219,17 +3218,17 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if (storage_size != 0)
ratio = (double)uncomp_size / (double)storage_size;
- h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT " (%.3f:1 COMPRESSION)", storage_size,
+ h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE " (%.3f:1 COMPRESSION)", storage_size,
ratio);
}
else
- h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
+ h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size);
H5Sclose(sid);
H5Tclose(tid);
}
else {
- h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
+ h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size);
}
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
@@ -3247,7 +3246,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
+ h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
ctx->indent_level--;
@@ -3283,7 +3282,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size);
+ h5tools_str_append(&buffer, "FILENAME %s SIZE %" PRIuHSIZE, name, size);
h5tools_str_append(&buffer, " OFFSET %ld", offset);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
@@ -3313,7 +3312,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
ctx->need_prefix = TRUE;
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size);
+ h5tools_str_append(&buffer, "SIZE %" PRIuHSIZE, storage_size);
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0,
(hsize_t)0);
@@ -3340,7 +3339,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
} break;
case H5D_VIRTUAL: {
- char dsetname[256]; /* virtual datset name */
+ char dsetname[256]; /* virtual dataset name */
size_t n_vmaps;
H5Pget_virtual_count(dcpl_id, &n_vmaps);
@@ -3909,7 +3908,7 @@ h5tools_print_dims(h5tools_str_t *buffer, hsize_t *s, int dims)
int i;
for (i = 0; i < dims; i++) {
- h5tools_str_append(buffer, HSIZE_T_FORMAT, s[i]);
+ h5tools_str_append(buffer, "%" PRIuHSIZE, s[i]);
if (i + 1 != dims)
h5tools_str_append(buffer, ", ");
@@ -4330,7 +4329,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if (string_dataformat.pindex) {
string_dataformat.idx_fmt = "(%s): ";
- string_dataformat.idx_n_fmt = HSIZE_T_FORMAT;
+ string_dataformat.idx_n_fmt = "%" PRIuHSIZE;
string_dataformat.idx_sep = ",";
string_dataformat.line_pre = "%s";
}
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 50f283d..1c97a52 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -70,7 +70,7 @@ free_ref_path_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op
/*-------------------------------------------------------------------------
* Function: init_ref_path_cb
*
- * Purpose: Called by interator to create references for
+ * Purpose: Called by iterator to create references for
* all objects and enter them in the table.
*
* Return: Error status.
@@ -123,7 +123,7 @@ ref_path_table_cmp(const void *key1, const void *key2)
/*-------------------------------------------------------------------------
* Function: init_ref_path_table
*
- * Purpose: Initalize the reference path table
+ * Purpose: Initialize the reference path table
*
* Return: Non-negative on success, negative on failure
*
@@ -377,7 +377,7 @@ lookup_ref_path(H5R_ref_t refbuf)
/*-------------------------------------------------------------------------
* Function: fill_ref_path_table
*
- * Purpose: Called by interator to create references for
+ * Purpose: Called by iterator to create references for
* all objects and enter them in the table.
*
* Return: Error status.
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index abc0058..5976044 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -129,7 +129,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
/* Note: HDvsnprintf() behaves differently on Windows as Unix, when
* buffer is smaller than source string. On Unix, this function
- * returns length of the source string and copy string upto the
+ * returns length of the source string and copy string up to the
* buffer size with NULL at the end of the buffer. However on
* Windows with the same condition, this function returns -1 and
* doesn't add NULL at the end of the buffer.
@@ -147,7 +147,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
* following conditions, each of which indicates that the proper C99 return value probably
* should have been positive when the format string is
* something other than "%s"
- * Alocate at least twice as much space and try again.
+ * Allocate at least twice as much space and try again.
*/
size_t newsize = MAX(str->len + (size_t)nchars + 1, 2 * str->nalloc);
HDassert(newsize > str->nalloc); /*overflow*/
@@ -300,11 +300,11 @@ h5tools_str_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *info, h
if (i)
h5tools_str_append(str, "%s", OPT(info->idx_sep, ","));
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)ctx->pos[i]);
+ h5tools_str_append(str, OPT(info->idx_n_fmt, "%" PRIuHSIZE), (hsize_t)ctx->pos[i]);
}
}
else /* Scalar */
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)elmtno);
+ h5tools_str_append(str, OPT(info->idx_n_fmt, "%" PRIuHSIZE), (hsize_t)elmtno);
H5TOOLS_DEBUG("str=%s", str->s);
H5TOOLS_ENDDEBUG(" ");
@@ -341,11 +341,11 @@ h5tools_str_region_prefix(h5tools_str_t *str /*in,out*/, const h5tool_format_t *
if (i)
h5tools_str_append(str, "%s", OPT(info->idx_sep, ","));
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)ctx->pos[i]);
+ h5tools_str_append(str, OPT(info->idx_n_fmt, "%" PRIuHSIZE), (hsize_t)ctx->pos[i]);
}
}
else /* Scalar */
- h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)0);
+ h5tools_str_append(str, OPT(info->idx_n_fmt, "%" PRIuHSIZE), (hsize_t)0);
H5TOOLS_DEBUG("str=%s", str->s);
H5TOOLS_ENDDEBUG(" ");
@@ -385,7 +385,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, const h5tool_form
/* Start coordinates */
h5tools_str_append(str, "%s%s ", info->line_indent, START);
for (j = 0; j < ndims; j++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", start[j]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, j ? "," : "(", start[j]);
h5tools_str_append(str, ")");
h5tools_str_append(str, "%s", "\n");
h5tools_str_indent(str, info, ctx);
@@ -393,7 +393,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, const h5tool_form
/* Stride coordinates */
h5tools_str_append(str, "%s ", STRIDE);
for (j = 0; j < ndims; j++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", stride[j]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, j ? "," : "(", stride[j]);
h5tools_str_append(str, ")");
h5tools_str_append(str, "%s", "\n");
h5tools_str_indent(str, info, ctx);
@@ -404,7 +404,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, const h5tool_form
if (count[j] == H5S_UNLIMITED)
h5tools_str_append(str, "%s%s", j ? "," : "(", "H5S_UNLIMITED");
else
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", count[j]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, j ? "," : "(", count[j]);
}
h5tools_str_append(str, ")");
h5tools_str_append(str, "%s", "\n");
@@ -416,7 +416,7 @@ h5tools_str_dump_space_slabs(h5tools_str_t *str, hid_t rspace, const h5tool_form
if (block[j] == H5S_UNLIMITED)
h5tools_str_append(str, "%s%s", j ? "," : "(", "H5S_UNLIMITED");
else
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", block[j]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, j ? "," : "(", block[j]);
}
h5tools_str_append(str, ")");
}
@@ -468,11 +468,10 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for
/* Start coordinates and opposite corner */
for (v = 0; v < ndims; v++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", ptdata[u * 2 * ndims + v]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, v ? "," : "(", ptdata[u * 2 * ndims + v]);
for (v = 0; v < ndims; v++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : ")-(",
- ptdata[u * 2 * ndims + v + ndims]);
+ h5tools_str_append(str, "%s%" PRIuHSIZE, v ? "," : ")-(", ptdata[u * 2 * ndims + v + ndims]);
h5tools_str_append(str, ")");
}
@@ -527,7 +526,7 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for
(unsigned long)u);
for (v = 0; v < ndims; v++)
- h5tools_str_append(str, "%s" HSIZE_T_FORMAT, v ? "," : "(", (ptdata[u * ndims + v]));
+ h5tools_str_append(str, "%s%" PRIuHSIZE, v ? "," : "(", (ptdata[u * ndims + v]));
h5tools_str_append(str, ")");
}
@@ -705,7 +704,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
HDmemcpy(&tempdouble, vp, sizeof(double));
h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble);
-#if H5_SIZEOF_LONG_DOUBLE != 0
}
else if (sizeof(long double) == nsize) {
/* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */
@@ -713,7 +711,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
HDmemcpy(&templdouble, vp, sizeof(long double));
h5tools_str_append(str, "%Lg", templdouble);
-#endif
}
else {
size_t i;
@@ -1054,7 +1051,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
H5TOOLS_DEBUG("H5T_ENUM");
if (H5Tenum_nameof(type, vp, enum_name, sizeof enum_name) >= 0)
- h5tools_str_append(str, h5tools_escape(enum_name, sizeof(enum_name)));
+ h5tools_str_append(str, "%s", h5tools_escape(enum_name, sizeof(enum_name)));
else {
size_t i;
if (1 == nsize)
@@ -1248,7 +1245,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
/* Print the closing bracket */
h5tools_str_append(str, "%s", OPT(info->arr_suf, "]"));
- is_next_arry_elmt = 1; /* set for begining of next array element */
+ is_next_arry_elmt = 1; /* set for beginning of next array element */
H5Tclose(memb);
} break;
@@ -1404,10 +1401,10 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp)
static char *
h5tools_escape(char *s /*in,out*/, size_t size)
{
- register size_t i;
- const char * escape;
- char octal[8];
- size_t n = HDstrlen(s);
+ size_t i;
+ const char *escape;
+ char octal[8];
+ size_t n = HDstrlen(s);
for (i = 0; i < n; i++) {
switch (s[i]) {
@@ -1506,7 +1503,7 @@ h5tools_str_is_zero(const void *_mem, size_t size)
* March 8, 2012
*
* Notes:
- * Applications need to call free() to free the memoery allocated for
+ * Applications need to call free() to free the memory allocated for
* the return string
*
*-------------------------------------------------------------------------
diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h
index eee87c9..f4610f0 100644
--- a/tools/lib/h5tools_str.h
+++ b/tools/lib/h5tools_str.h
@@ -26,7 +26,7 @@ typedef struct h5tools_str_t {
H5TOOLS_DLL void h5tools_str_close(h5tools_str_t *str);
H5TOOLS_DLL size_t h5tools_str_len(h5tools_str_t *str);
-H5TOOLS_DLL char * h5tools_str_append(h5tools_str_t *str, const char *fmt, ...);
+H5TOOLS_DLL char * h5tools_str_append(h5tools_str_t *str, const char *fmt, ...) H5_ATTR_FORMAT(printf, 2, 3);
H5TOOLS_DLL char * h5tools_str_reset(h5tools_str_t *str);
H5TOOLS_DLL char * h5tools_str_trunc(h5tools_str_t *str, size_t size);
H5TOOLS_DLL char * h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt);
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index ea9812b..66d3ef6 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -180,7 +180,7 @@ help_ref_msg(FILE *output)
* * Last two characters in the string MUST be ")\0".
*
* * Generates a copy of the input string `start`, (src..")\0"), replacing
- * separators and close-paren with null charaters.
+ * separators and close-paren with null characters.
* * This string is allocated at runtime and should be freed when done.
* * Generates array of char pointers, and directs start of each element
* (each pointer) into this copy.
@@ -227,7 +227,7 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char *
char * elem_ptr = NULL;
char * dest_ptr = NULL;
unsigned elems_count = 0;
- char ** elems = NULL; /* more like *elems[], but complier... */
+ char ** elems = NULL; /* more like *elems[], but compiler... */
char ** elems_re = NULL; /* temporary pointer, for realloc */
char * cpy = NULL;
herr_t ret_value = SUCCEED;
@@ -337,7 +337,7 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char *
/* Found terminal, non-escaped close-paren. Last element.
* Write null terminator to copy.
* Advance source pointer to gently break from loop.
- * Requred to prevent ")" from always being added to last element.
+ * Required to prevent ")" from always being added to last element.
*/
start++;
}
diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h
index 095ad6c..4cf4e40 100644
--- a/tools/lib/h5tools_utils.h
+++ b/tools/lib/h5tools_utils.h
@@ -70,11 +70,11 @@ H5TOOLS_DLLVAR unsigned h5tools_nCols; /*max number of columns for outputting *
/* Definitions of useful routines */
H5TOOLS_DLL void indentation(unsigned);
H5TOOLS_DLL void print_version(const char *progname);
-H5TOOLS_DLL void parallel_print(const char *format, ...);
+H5TOOLS_DLL void parallel_print(const char *format, ...) H5_ATTR_FORMAT(printf, 1, 2);
H5TOOLS_DLL herr_t parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems,
char ***ptrs_out);
-H5TOOLS_DLL void error_msg(const char *fmt, ...);
-H5TOOLS_DLL void warn_msg(const char *fmt, ...);
+H5TOOLS_DLL void error_msg(const char *fmt, ...) H5_ATTR_FORMAT(printf, 1, 2);
+H5TOOLS_DLL void warn_msg(const char *fmt, ...) H5_ATTR_FORMAT(printf, 1, 2);
H5TOOLS_DLL void help_ref_msg(FILE *output);
H5TOOLS_DLL void free_table(table_t *table);
#ifdef H5DUMP_DEBUG
@@ -100,7 +100,7 @@ typedef enum toolname_t {
TOOL__H5DUMP /* add as necessary */
} h5tool_toolname_t;
-/* this struct can be used to differntiate among tools */
+/* this struct can be used to differentiate among tools */
typedef struct {
h5tool_toolname_t toolname;
int msg_mode;
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index d0c299f..cca36e4 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -53,11 +53,6 @@ typedef struct trav_path_op_data_t {
const char *path;
} trav_path_op_data_t;
-/* format for hsize_t */
-#ifdef H5TRAV_PRINT_SPACE
-#define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u"
-#endif /* H5TRAV_PRINT_SPACE */
-
/*-------------------------------------------------------------------------
* local functions
*-------------------------------------------------------------------------
@@ -534,7 +529,7 @@ trav_info_free(trav_info_t *info)
/*-------------------------------------------------------------------------
* Function: trav_table_visit_obj
*
- * Purpose: Callback for visiting object, with 'table' sructure
+ * Purpose: Callback for visiting object, with 'table' structure
*
* Return: 0 on success,
* -1 on failure
@@ -559,7 +554,7 @@ trav_table_visit_obj(const char *path, const H5O_info2_t *oinfo, const char *alr
/*-------------------------------------------------------------------------
* Function: trav_table_visit_lnk
*
- * Purpose: Callback for visiting link, with 'table' sructure
+ * Purpose: Callback for visiting link, with 'table' structure
*
* Return: 0 on success,
* -1 on failure
@@ -856,7 +851,7 @@ trav_attr(hid_t
/* simple dataspace */
HDprintf(" {");
for (i = 0; i < ndims; i++) {
- HDprintf("%s" HSIZE_T_FORMAT, i ? ", " : "", size[i]);
+ HDprintf("%s%" PRIuHSIZE, i ? ", " : "", size[i]);
}
HDprintf("}\n");
break;
@@ -1127,7 +1122,7 @@ symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, c
/* Look for symlink */
for (u = 0; u < visited->nused; u++) {
/* Check for symlink values already in array */
- /* check type and path pair to distingush between symbolic links */
+ /* check type and path pair to distinguish between symbolic links */
if ((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) {
/* if external link, file need to be matched as well */
if (visited->objs[u].type == H5L_TYPE_EXTERNAL)
diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h
index 7a8a63d..58d347d 100644
--- a/tools/lib/h5trav.h
+++ b/tools/lib/h5trav.h
@@ -87,7 +87,7 @@ typedef struct trav_link_t {
} trav_link_t;
/*-------------------------------------------------------------------------
- * struct to store basic info needed for the h5trav table traversal algorythm
+ * struct to store basic info needed for the h5trav table traversal algorithm
*-------------------------------------------------------------------------
*/
diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c
index aec7e9b..ce21b3e 100644
--- a/tools/lib/io_timer.c
+++ b/tools/lib/io_timer.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* changes:
* rename pio_timer.c as io_timer.c;
- * Removed pio_perf.h so that it is not dependant on it;
+ * Removed pio_perf.h so that it is not dependent on it;
* Removed set_timer_type() and get_timer_type() since no one calls them;
* Merged sio_timer.c into io_timer.c;
*/
diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c
index 37d38fd..072179b 100644
--- a/tools/libtest/h5tools_test_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -431,7 +431,7 @@ test_parse_tuple(void)
{"stuff keeps on going"},
},
{
- "4-ple, escaped seperator",
+ "4-ple, escaped separator",
"(elem0,elem1,el\\,em2,elem3)", /* "el\,em" */
',',
SUCCEED,
@@ -701,7 +701,7 @@ test_populate_ros3_fa(void)
}
/* NULL region
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -720,7 +720,7 @@ test_populate_ros3_fa(void)
}
/* empty region
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -739,7 +739,7 @@ test_populate_ros3_fa(void)
}
/* region overflow
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -781,7 +781,7 @@ test_populate_ros3_fa(void)
}
/* empty id (non-empty region, key)
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -851,7 +851,7 @@ test_populate_ros3_fa(void)
}
/* empty key (non-empty region, id)
- * yeilds authenticating fapl
+ * yields authenticating fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -870,7 +870,7 @@ test_populate_ros3_fa(void)
}
/* empty key, region (non-empty id)
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -889,7 +889,7 @@ test_populate_ros3_fa(void)
}
/* empty key, id (non-empty region)
- * yeilds default fapl
+ * yields default fapl
*/
{
H5FD_ros3_fapl_t fa = {bad_version, FALSE, "a", "b", "c"};
@@ -1201,9 +1201,10 @@ test_set_configured_fapl(void)
#endif /* UTIL_TEST_DEBUG */
/* test */
- vfd_info.info = C.conf_fa;
- vfd_info.name = C.vfdname;
- result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info);
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.info = C.conf_fa;
+ vfd_info.u.name = C.vfdname;
+ result = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info);
if (C.expected == 0)
JSVERIFY(result, H5I_INVALID_HID, C.message)
else
diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c
index 4e9a25e..eacd05b 100644
--- a/tools/src/h5copy/h5copy.c
+++ b/tools/src/h5copy/h5copy.c
@@ -19,7 +19,7 @@
#define PROGRAMNAME "h5copy"
/* command-line options: short and long-named parameters */
-static const char * s_opts = "d:f:hi:o:ps:vVE";
+static const char * s_opts = "d:f:hi:o:ps:vVE*";
static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
{"flag", require_arg, 'f'},
{"help", no_arg, 'h'},
@@ -29,7 +29,7 @@ static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'},
{"source", require_arg, 's'},
{"verbose", no_arg, 'v'},
{"version", no_arg, 'V'},
- {"enable-error-stack", no_arg, 'E'},
+ {"enable-error-stack", optional_arg, 'E'},
{NULL, 0, '\0'}};
char * fname_src = NULL;
char * fname_dst = NULL;
@@ -93,15 +93,17 @@ usage(void)
PRINTVALSTREAM(rawoutstream, " -o, --output output file name\n");
PRINTVALSTREAM(rawoutstream, " -s, --source source object name\n");
PRINTVALSTREAM(rawoutstream, " -d, --destination destination object name\n");
+ PRINTVALSTREAM(rawoutstream, " ERROR\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
+ PRINTVALSTREAM(rawoutstream,
+ " Optional value 2 also prints file open errors.\n");
PRINTVALSTREAM(rawoutstream, " OPTIONS\n");
PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n");
PRINTVALSTREAM(rawoutstream,
" -p, --parents No error if existing, make parent groups as needed\n");
PRINTVALSTREAM(rawoutstream, " -v, --verbose Print information about OBJECTS and OPTIONS\n");
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
- PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n");
- PRINTVALSTREAM(rawoutstream,
- " Prints messages from the HDF5 error stack as they occur.\n");
PRINTVALSTREAM(rawoutstream, " -f, --flag Flag type\n\n");
PRINTVALSTREAM(rawoutstream, " Flag type is one of the following strings:\n\n");
PRINTVALSTREAM(rawoutstream, " shallow Copy only immediate members for groups\n\n");
@@ -212,7 +214,7 @@ parse_flag(const char *s_flag, unsigned *flag)
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid_src = H5I_INVALID_HID;
hid_t fid_dst = H5I_INVALID_HID;
@@ -242,7 +244,7 @@ main(int argc, const char *argv[])
} /* end if */
/* parse command line options */
- while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'd':
oname_dst = HDstrdup(H5_optarg);
@@ -288,7 +290,10 @@ main(int argc, const char *argv[])
break;
case 'E':
- enable_error_stack = 1;
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
+ else
+ enable_error_stack = 1;
break;
default:
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index fba73a4..2619a9d 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -25,7 +25,7 @@ static int check_d_input(const char *);
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S";
+static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S*";
static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"version", no_arg, 'V'},
{"report", no_arg, 'r'},
@@ -41,44 +41,21 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"no-dangling-links", no_arg, 'x'},
{"exclude-path", require_arg, 'E'},
{"exclude-attribute", require_arg, 'A'},
- {"enable-error-stack", no_arg, 'S'},
+ {"enable-error-stack", optional_arg, 'S'},
{"vol-value-1", require_arg, '1'},
{"vol-name-1", require_arg, '2'},
{"vol-info-1", require_arg, '3'},
{"vol-value-2", require_arg, '4'},
{"vol-name-2", require_arg, '5'},
{"vol-info-2", require_arg, '6'},
- {"vfd-name-1", require_arg, '7'},
- {"vfd-info-1", require_arg, '8'},
- {"vfd-name-2", require_arg, '9'},
- {"vfd-info-2", require_arg, '0'},
+ {"vfd-value-1", require_arg, '7'},
+ {"vfd-name-1", require_arg, '8'},
+ {"vfd-info-1", require_arg, '9'},
+ {"vfd-value-2", require_arg, '0'},
+ {"vfd-name-2", require_arg, 'Y'},
+ {"vfd-info-2", require_arg, 'Z'},
{NULL, 0, '\0'}};
-static H5FD_onion_fapl_info_t onion_fa_g_1 = {
- H5FD_ONION_FAPL_INFO_VERSION_CURR,
- H5P_DEFAULT, /* backing_fapl_id */
- 32, /* page_size */
- H5FD_ONION_STORE_TARGET_ONION, /* store_target */
- H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST,
- 0, /* force_write_open */
- 0, /* creation_flags */
- "indoor speaking voices", /* comment */
-};
-
-static H5FD_onion_fapl_info_t onion_fa_g_2 = {
- H5FD_ONION_FAPL_INFO_VERSION_CURR,
- H5P_DEFAULT, /* backing_fapl_id */
- 32, /* page_size */
- H5FD_ONION_STORE_TARGET_ONION, /* store_target */
- H5FD_ONION_FAPL_INFO_REVISION_ID_LATEST,
- 0, /* force_write_open */
- 0, /* creation_flags */
- "indoor speaking voices", /* comment */
-};
-
-static const char *driver_name_g_1 = NULL; /* The driver to open the first file with. */
-static const char *driver_name_g_2 = NULL; /* The driver to open the second file with. */
-
/*-------------------------------------------------------------------------
* Function: check_options
*
@@ -229,7 +206,7 @@ parse_subset_params(const char *dset)
*/
void
-parse_command_line(int argc, const char *argv[], const char **fname1, const char **fname2,
+parse_command_line(int argc, const char *const *argv, const char **fname1, const char **fname2,
const char **objname1, const char **objname2, diff_opt_t *opts)
{
int i;
@@ -306,7 +283,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
break;
case 'q':
- /* use quiet mode; supress the message "0 differences found" */
+ /* use quiet mode; suppress the message "0 differences found" */
opts->mode_quiet = 1;
break;
@@ -323,7 +300,10 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
break;
case 'S':
- enable_error_stack = 1;
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
+ else
+ enable_error_stack = 1;
break;
case 'E':
@@ -461,42 +441,40 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
case '6':
opts->vol_info[1].info_string = H5_optarg;
break;
+
case '7':
- driver_name_g_1 = HDstrdup(H5_optarg);
+ opts->vfd_info[0].type = VFD_BY_VALUE;
+ opts->vfd_info[0].u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ opts->custom_vfd[0] = TRUE;
break;
+
case '8':
- onion_fa_g_1.revision_id = (uint64_t)HDatol(H5_optarg);
+ opts->vfd_info[0].type = VFD_BY_NAME;
+ opts->vfd_info[0].u.name = H5_optarg;
+ opts->custom_vol[0] = TRUE;
break;
+
case '9':
- driver_name_g_2 = HDstrdup(H5_optarg);
+ opts->vfd_info[0].info = (const void *)H5_optarg;
break;
- case '0':
- onion_fa_g_2.revision_id = (uint64_t)HDatol(H5_optarg);
- }
- }
- /* Copy the VFD driver info for both the files */
- if (driver_name_g_1) {
- if (!HDstrcmp(driver_name_g_1, "onion")) {
- opts->vfd_info[0].name = HDstrdup(driver_name_g_1);
- opts->vfd_info[0].info = HDmalloc(sizeof(H5FD_onion_fapl_info_t));
- HDmemcpy(opts->vfd_info[0].info, &onion_fa_g_1, sizeof(H5FD_onion_fapl_info_t));
- }
+ case '0':
+ opts->vfd_info[1].type = VFD_BY_VALUE;
+ opts->vfd_info[1].u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ opts->custom_vfd[1] = TRUE;
+ break;
- if (driver_name_g_1)
- HDfree(driver_name_g_1);
- } /* driver name defined */
+ case 'Y':
+ opts->vfd_info[1].type = VFD_BY_NAME;
+ opts->vfd_info[1].u.name = H5_optarg;
+ opts->custom_vfd[1] = TRUE;
+ break;
- if (driver_name_g_2) {
- if (!HDstrcmp(driver_name_g_2, "onion")) {
- opts->vfd_info[1].name = HDstrdup(driver_name_g_2);
- opts->vfd_info[1].info = HDmalloc(sizeof(H5FD_onion_fapl_info_t));
- HDmemcpy(opts->vfd_info[1].info, &onion_fa_g_2, sizeof(H5FD_onion_fapl_info_t));
+ case 'Z':
+ opts->vfd_info[1].info = (const void *)H5_optarg;
+ break;
}
-
- if (driver_name_g_2)
- HDfree(driver_name_g_2);
- } /* driver name defined */
+ }
/* check options */
check_options(opts);
@@ -677,6 +655,10 @@ usage(void)
PRINTVALSTREAM(rawoutstream, " [obj1] Name of an HDF5 object, in absolute path\n");
PRINTVALSTREAM(rawoutstream, " [obj2] Name of an HDF5 object, in absolute path\n");
PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " ERROR\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
+ PRINTVALSTREAM(rawoutstream, " Optional value 2 also prints file open errors.\n");
PRINTVALSTREAM(rawoutstream, " OPTIONS\n");
PRINTVALSTREAM(rawoutstream, " -h, --help\n");
PRINTVALSTREAM(rawoutstream, " Print a usage message and exit.\n");
@@ -699,9 +681,6 @@ usage(void)
PRINTVALSTREAM(rawoutstream, " 3 : All level 2 information plus file names.\n");
PRINTVALSTREAM(rawoutstream, " -q, --quiet\n");
PRINTVALSTREAM(rawoutstream, " Quiet mode. Do not produce output.\n");
- PRINTVALSTREAM(rawoutstream, " --enable-error-stack\n");
- PRINTVALSTREAM(rawoutstream,
- " Prints messages from the HDF5 error stack as they occur.\n");
PRINTVALSTREAM(rawoutstream,
" --vol-value-1 Value (ID) of the VOL connector to use for opening the\n");
PRINTVALSTREAM(rawoutstream, " first HDF5 file specified\n");
@@ -721,15 +700,23 @@ usage(void)
" --vol-info-2 VOL-specific info to pass to the VOL connector used for\n");
PRINTVALSTREAM(rawoutstream, " opening the second HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
- " --vfd-name-1 Name of the VFD driver to use for opening the first\n");
+ " --vfd-value-1 Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " first HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-name-1 Name of the VFL driver to use for opening the first\n");
PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
- " --vfd-info-1 VFD-specific info to open the first HDF5 file specified\n");
+ " --vfd-info-1 VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the first HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
- " --vfd-name-2 Name of the VFD driver to use for opening the second\n");
+ " --vfd-value-2 Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " second HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-name-2 Name of the VFL driver to use for opening the second\n");
PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
- " --vfd-info-2 VFD-specific info to open the second HDF5 file specified\n");
+ " --vfd-info-2 VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the second HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream, " --follow-symlinks\n");
PRINTVALSTREAM(rawoutstream,
" Follow symbolic links (soft links and external links and compare the)\n");
@@ -851,7 +838,7 @@ usage(void)
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Modes of output:\n");
PRINTVALSTREAM(rawoutstream,
- " Default mode: print the number of differences found and where they occured\n");
+ " Default mode: print the number of differences found and where they occurred\n");
PRINTVALSTREAM(rawoutstream, " -r Report mode: print the above plus the differences\n");
PRINTVALSTREAM(rawoutstream, " -v Verbose mode: print the above plus a list of objects and warnings\n");
PRINTVALSTREAM(rawoutstream, " -q Quiet mode: do not print output\n");
diff --git a/tools/src/h5diff/h5diff_common.h b/tools/src/h5diff/h5diff_common.h
index 83f4255..35e5dfb 100644
--- a/tools/src/h5diff/h5diff_common.h
+++ b/tools/src/h5diff/h5diff_common.h
@@ -23,7 +23,7 @@ extern "C" {
#endif
void usage(void);
-void parse_command_line(int argc, const char *argv[], const char **fname1, const char **fname2,
+void parse_command_line(int argc, const char *const *argv, const char **fname1, const char **fname2,
const char **objname1, const char **objname2, diff_opt_t *opts);
void h5diff_exit(int status);
void print_info(diff_opt_t *opts);
diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c
index ab70dba..2a43b56 100644
--- a/tools/src/h5diff/h5diff_main.c
+++ b/tools/src/h5diff/h5diff_main.c
@@ -33,7 +33,7 @@
*
* Modifications: July 2004
* Introduced the four modes:
- * Normal mode: print the number of differences found and where they occured
+ * Normal mode: print the number of differences found and where they occurred
* Report mode: print the above plus the differences
* Verbose mode: print the above plus a list of objects and warnings
* Quiet mode: do not print output
@@ -65,7 +65,7 @@
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int ret;
int i;
@@ -86,7 +86,7 @@ main(int argc, const char *argv[])
* process the command-line
*-------------------------------------------------------------------------
*/
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
+ parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2, &opts);
/* enable error reporting if command line option */
h5tools_error_report();
@@ -131,11 +131,6 @@ main(int argc, const char *argv[])
HDfree(opts.sset[i]);
opts.sset[i] = NULL;
}
-
- if (opts.vfd_info[i].name)
- HDfree((void *)opts.vfd_info[i].name);
- if (opts.vfd_info[i].info)
- HDfree((void *)opts.vfd_info[i].info);
}
h5diff_exit(ret);
diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c
index ec78e49..8e5c3e8 100644
--- a/tools/src/h5diff/ph5diff_main.c
+++ b/tools/src/h5diff/ph5diff_main.c
@@ -44,7 +44,7 @@ static void ph5diff_worker(int);
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int nID = 0;
const char *fname1 = NULL;
@@ -72,7 +72,7 @@ main(int argc, const char *argv[])
g_Parallel = 0;
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
+ parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2, &opts);
h5diff(fname1, fname2, objname1, objname2, &opts);
@@ -83,7 +83,8 @@ main(int argc, const char *argv[])
/* Have the manager process the command-line */
if (nID == 0) {
- parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
+ parse_command_line(argc, (const char *const *)argv, &fname1, &fname2, &objname1, &objname2,
+ &opts);
h5diff(fname1, fname2, objname1, objname2, &opts);
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index 3a2a563..8bbd271 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -18,14 +18,15 @@
/* Name of tool */
#define PROGRAMNAME "h5dump"
-static const char *driver_name_g = NULL; /* The driver to open the file with. */
const char * outfname_g = NULL;
static hbool_t doxml_g = FALSE;
static hbool_t useschema_g = TRUE;
static const char *xml_dtd_uri_g = NULL;
static hbool_t use_custom_vol_g = FALSE;
+static hbool_t use_custom_vfd_g = FALSE;
static h5tools_vol_info_t vol_info_g;
+static h5tools_vfd_info_t vfd_info_g;
#ifdef H5_HAVE_ROS3_VFD
/* Default "anonymous" S3 configuration */
@@ -139,6 +140,9 @@ static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'},
{"vol-value", require_arg, '1'},
{"vol-name", require_arg, '2'},
{"vol-info", require_arg, '3'},
+ {"vfd-value", require_arg, '4'},
+ {"vfd-name", require_arg, '5'},
+ {"vfd-info", require_arg, '6'},
{NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
@@ -173,6 +177,12 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " OPTIONS\n");
PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n");
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
+ PRINTVALSTREAM(rawoutstream, "--------------- Error Options ---------------\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
+ PRINTVALSTREAM(rawoutstream,
+ " Optional value 2 also prints file open errors.\n");
+ PRINTVALSTREAM(rawoutstream, " Default setting disables any error reporting.\n");
PRINTVALSTREAM(rawoutstream, "--------------- File Options ---------------\n");
PRINTVALSTREAM(rawoutstream, " -n, --contents Print a list of the file contents and exit\n");
PRINTVALSTREAM(rawoutstream, " Optional value 1 also prints attributes.\n");
@@ -208,6 +218,14 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream,
" --vol-info VOL-specific info to pass to the VOL connector used for\n");
PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-value Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream, " --vfd-name Name of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-info VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream, "--------------- Object Options ---------------\n");
PRINTVALSTREAM(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
PRINTVALSTREAM(rawoutstream,
@@ -254,10 +272,6 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
PRINTVALSTREAM(rawoutstream,
- " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
- PRINTVALSTREAM(rawoutstream,
- " Optional value 2 also prints file open errors.\n");
- PRINTVALSTREAM(rawoutstream,
" --no-compact-subset Disable compact form of subsetting and allow the use\n");
PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n");
PRINTVALSTREAM(rawoutstream,
@@ -828,7 +842,7 @@ free_handler(struct handler_t *hand, int len)
*-------------------------------------------------------------------------
*/
static struct handler_t *
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
struct handler_t *hand = NULL;
struct handler_t *last_dset = NULL;
@@ -952,7 +966,10 @@ parse_start:
last_was_dset = TRUE;
break;
case 'f':
- driver_name_g = HDstrdup(H5_optarg);
+ vfd_info_g.type = VFD_BY_NAME;
+ vfd_info_g.u.name = H5_optarg;
+ vfd_info_g.info = NULL;
+ use_custom_vfd_g = TRUE;
break;
case 'g':
dump_opts.display_all = 0;
@@ -1213,6 +1230,11 @@ end_collect:
else
enable_error_stack = 1;
break;
+ case 'F':
+ /* TODO: Convert to strtoumax */
+ onion_revision_g = (uint64_t)HDatol(H5_optarg);
+ HDprintf("Using revision %" PRIu64 "\n", onion_revision_g);
+ break;
case 'C':
dump_opts.disable_compact_subset = TRUE;
break;
@@ -1272,11 +1294,23 @@ end_collect:
case '3':
vol_info_g.info_string = H5_optarg;
break;
- case 'F':
- /* TODO: Convert to strtoumax */
- onion_revision_g = (uint64_t)HDatol(H5_optarg);
- HDprintf("Using revision %" PRIu64 "\n", onion_revision_g);
+
+ case '4':
+ vfd_info_g.type = VFD_BY_VALUE;
+ vfd_info_g.u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ use_custom_vfd_g = TRUE;
+ break;
+
+ case '5':
+ vfd_info_g.type = VFD_BY_NAME;
+ vfd_info_g.u.name = H5_optarg;
+ use_custom_vfd_g = TRUE;
+ break;
+
+ case '6':
+ vfd_info_g.info = (const void *)H5_optarg;
break;
+
case '?':
default:
usage(h5tools_getprogname());
@@ -1314,7 +1348,7 @@ error:
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid = H5I_INVALID_HID;
hid_t gid = H5I_INVALID_HID;
@@ -1334,7 +1368,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- if ((hand = parse_command_line(argc, argv)) == NULL) {
+ if ((hand = parse_command_line(argc, (const char *const *)argv)) == NULL) {
goto done;
}
@@ -1391,44 +1425,9 @@ main(int argc, const char *argv[])
/* Initialize indexing options */
h5trav_set_index(sort_by, sort_order);
- if (driver_name_g != NULL) {
- h5tools_vfd_info_t vfd_info;
-
- vfd_info.info = NULL;
- vfd_info.name = driver_name_g;
-
- if (!HDstrcmp(driver_name_g, drivernames[ROS3_VFD_IDX])) {
-#ifdef H5_HAVE_ROS3_VFD
- vfd_info.info = (void *)&ros3_fa_g;
-#else
- error_msg("Read-Only S3 VFD not enabled.\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
-#endif
- }
- else if (!HDstrcmp(driver_name_g, drivernames[HDFS_VFD_IDX])) {
-#ifdef H5_HAVE_LIBHDFS
- vfd_info.info = (void *)&hdfs_fa_g;
-#else
- error_msg("The HDFS VFD is not enabled.\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
-#endif
- }
- else if (!HDstrcmp(driver_name_g, drivernames[ONION_VFD_IDX])) {
- onion_fa_g.revision_id = onion_revision_g;
- vfd_info.info = (void *)&onion_fa_g;
- }
-
- if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) {
- error_msg("unable to create FAPL for file access\n");
- h5tools_setstatus(EXIT_FAILURE);
- goto done;
- }
- } /* driver name defined */
-
- if (use_custom_vol_g) {
- if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vol_info_g, NULL)) < 0) {
+ if (use_custom_vol_g || use_custom_vfd_g) {
+ if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, use_custom_vol_g ? &vol_info_g : NULL,
+ use_custom_vfd_g ? &vfd_info_g : NULL)) < 0) {
error_msg("unable to create FAPL for file access\n");
h5tools_setstatus(EXIT_FAILURE);
goto done;
@@ -1438,7 +1437,7 @@ main(int argc, const char *argv[])
while (H5_optind < argc) {
fname = HDstrdup(argv[H5_optind++]);
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0);
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id != H5P_DEFAULT), NULL, 0);
if (fid < 0) {
error_msg("unable to open file \"%s\"\n", fname);
@@ -1494,7 +1493,7 @@ main(int argc, const char *argv[])
dset_table = table_list.tables[0].dset_table;
type_table = table_list.tables[0].type_table;
- /* does there exist unamed committed datatype */
+ /* does there exist unnamed committed datatype */
for (u = 0; u < type_table->nobjs; u++)
if (!type_table->objs[u].recorded) {
unamedtype = 1;
@@ -1639,17 +1638,11 @@ done:
HDfree(prefix);
prefix = NULL;
}
-
if (fname) {
HDfree(fname);
fname = NULL;
}
- if (driver_name_g) {
- HDfree(driver_name_g);
- driver_name_g = NULL;
- }
-
if (hand)
free_handler(hand, argc);
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index 638a738..b0bce0c 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -829,7 +829,7 @@ dump_group(hid_t gid, const char *name)
if (!HDstrcmp(name, "/") && unamedtype) {
unsigned u; /* Local index variable */
- /* dump unamed type in root group */
+ /* dump unnamed type in root group */
for (u = 0; u < type_table->nobjs; u++)
if (!type_table->objs[u].recorded) {
char *obj_tok_str = NULL;
@@ -838,7 +838,7 @@ dump_group(hid_t gid, const char *name)
type = H5Dget_type(dset);
H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str);
- HDsprintf(type_name, "#%s", obj_tok_str);
+ HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str);
H5free_memory(obj_tok_str);
dump_function_table->dump_named_datatype_function(type, type_name);
@@ -1283,7 +1283,7 @@ dump_fcontents(hid_t fid)
{
PRINTSTREAM(rawoutstream, "%s %s\n", FILE_CONTENTS, BEGIN);
- /* special case of unamed types in root group */
+ /* special case of unnamed types in root group */
if (unamedtype) {
unsigned u;
@@ -1318,7 +1318,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a
j = (int)HDstrlen(op_name) - 1;
/* find the last / */
while (j >= 0) {
- if (op_name[j] == '/' && (j == 0 || (j > 0 && op_name[j - 1] != '\\')))
+ if (op_name[j] == '/' && (j == 0 || (op_name[j - 1] != '\\')))
break;
j--;
}
@@ -1541,7 +1541,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5
/* find the last / */
while (j >= 0) {
- if (attr[j] == '/' && (j == 0 || (j > 0 && attr[j - 1] != '\\')))
+ if (attr[j] == '/' && (j == 0 || (attr[j - 1] != '\\')))
break;
j--;
}
@@ -1959,7 +1959,7 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, int pe,
const char *real_name = display_name ? display_name : type;
if ((type_id = H5Topen2(fid, type, H5P_DEFAULT)) < 0) {
- /* check if type is unamed datatype */
+ /* check if type is unnamed datatype */
unsigned idx = 0;
while (idx < type_table->nobjs) {
@@ -1968,9 +1968,9 @@ handle_datatypes(hid_t fid, const char *type, void H5_ATTR_UNUSED *data, int pe,
if (!type_table->objs[idx].recorded) {
char *obj_tok_str = NULL;
- /* unamed datatype */
+ /* unnamed datatype */
H5Otoken_to_str(fid, &type_table->objs[idx].obj_token, &obj_tok_str);
- HDsprintf(name, "/#%s", obj_tok_str);
+ HDsnprintf(name, sizeof(name), "/#%s", obj_tok_str);
H5free_memory(obj_tok_str);
if (!HDstrcmp(name, real_name))
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index 0e881df..827daf3 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -23,7 +23,7 @@
const char *xmlnsprefix = "hdf5:";
/*
- * Alternative formating for data dumped to XML
+ * Alternative formatting for data dumped to XML
* In general, the numbers are the same, but separators
* except spaces are not used.
*
@@ -591,6 +591,8 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen
if (outlen < 22)
return 1;
+ H5_CHECK_OVERFLOW(outlen, int, size_t);
+
lookup_ret = ref_path_table_lookup(str, &obj_token);
if (lookup_ret < 0) {
if (HDstrlen(str) == 0) {
@@ -600,7 +602,7 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen
ref_path_table_gen_fake(str, &obj_token);
H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str);
- HDsprintf(outstr, "xid_%s", obj_tok_str);
+ HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str);
H5free_memory(obj_tok_str);
return 0;
@@ -615,7 +617,7 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen
ref_path_table_gen_fake(str, &obj_token);
H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str);
- HDsprintf(outstr, "xid_%s", obj_tok_str);
+ HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str);
H5free_memory(obj_tok_str);
return 0;
@@ -627,7 +629,7 @@ xml_name_to_XID(hid_t loc_id, const char *str, char *outstr, int outlen, int gen
}
H5Otoken_to_str(loc_id, &obj_token, &obj_tok_str);
- HDsprintf(outstr, "xid_%s", obj_tok_str);
+ HDsnprintf(outstr, (size_t)outlen, "xid_%s", obj_tok_str);
H5free_memory(obj_tok_str);
return 0;
@@ -1777,8 +1779,7 @@ xml_dump_dataspace(hid_t space)
/* Render the element */
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer,
- "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH
- "u\" MaxDimSize=\"UNLIMITED\"/>",
+ "<%sDimension DimSize=\"%" PRIuHSIZE "\" MaxDimSize=\"UNLIMITED\"/>",
xmlnsprefix, size[i]);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
@@ -1788,10 +1789,9 @@ xml_dump_dataspace(hid_t space)
/* Render the element */
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer,
- "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH
- "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>",
- xmlnsprefix, size[i], size[i]);
+ h5tools_str_append(
+ &buffer, "<%sDimension DimSize=\"%" PRIuHSIZE "\" MaxDimSize=\"%" PRIuHSIZE "\"/>",
+ xmlnsprefix, size[i], size[i]);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
}
@@ -1800,10 +1800,9 @@ xml_dump_dataspace(hid_t space)
/* Render the element */
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer,
- "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH
- "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>",
- xmlnsprefix, size[i], maxsize[i]);
+ h5tools_str_append(
+ &buffer, "<%sDimension DimSize=\"%" PRIuHSIZE "\" MaxDimSize=\"%" PRIuHSIZE "\"/>",
+ xmlnsprefix, size[i], maxsize[i]);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
}
@@ -2793,7 +2792,7 @@ xml_dump_group(hid_t gid, const char *name)
if (isRoot && unamedtype) {
unsigned u;
- /* Very special case: dump unamed type in root group */
+ /* Very special case: dump unnamed type in root group */
for (u = 0; u < type_table->nobjs; u++) {
if (!type_table->objs[u].recorded) {
char *obj_tok_str = NULL;
@@ -2802,7 +2801,7 @@ xml_dump_group(hid_t gid, const char *name)
type = H5Dget_type(dset);
H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str);
- HDsprintf(type_name, "#%s", obj_tok_str);
+ HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str);
H5free_memory(obj_tok_str);
dump_function_table->dump_named_datatype_function(type, type_name);
@@ -2886,7 +2885,7 @@ xml_dump_group(hid_t gid, const char *name)
if (isRoot && unamedtype) {
unsigned u;
- /* Very special case: dump unamed type in root group */
+ /* Very special case: dump unnamed type in root group */
for (u = 0; u < type_table->nobjs; u++) {
if (!type_table->objs[u].recorded) {
char *obj_tok_str = NULL;
@@ -2895,7 +2894,7 @@ xml_dump_group(hid_t gid, const char *name)
type = H5Dget_type(dset);
H5Otoken_to_str(dset, &type_table->objs[u].obj_token, &obj_tok_str);
- HDsprintf(type_name, "#%s", obj_tok_str);
+ HDsnprintf(type_name, sizeof(type_name), "#%s", obj_tok_str);
H5free_memory(obj_tok_str);
dump_function_table->dump_named_datatype_function(type, type_name);
@@ -2938,7 +2937,7 @@ xml_dump_group(hid_t gid, const char *name)
/*-------------------------------------------------------------------------
* Function: xml_print_refs
*
- * Purpose: Print a path to the objects referenced by HDF5 Referneces.
+ * Purpose: Print a path to the objects referenced by HDF5 References.
*
* Return: void
*
@@ -3598,7 +3597,10 @@ xml_dump_fill_value(hid_t dcpl, hid_t type)
h5tools_str_reset(&buffer);
h5tools_str_append(&buffer, "\"");
for (i = 0; i < sz; i++) {
- h5tools_str_append(&buffer, "%x ", *(unsigned int *)buf + (i * sizeof(unsigned int)));
+ unsigned long val = *(unsigned int *)buf + (i * sizeof(unsigned int));
+
+ H5_CHECK_OVERFLOW(val, unsigned long, unsigned);
+ h5tools_str_append(&buffer, "%x ", (unsigned)val);
}
h5tools_str_append(&buffer, "\"");
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
@@ -3892,8 +3894,8 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss
/* Render the element */
h5tools_str_reset(&buffer);
- h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />",
- xmlnsprefix, chsize[i]);
+ h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" PRIuHSIZE "\" />", xmlnsprefix,
+ chsize[i]);
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
}
@@ -4524,12 +4526,16 @@ xml_print_enum(hid_t type)
h5tools_str_append(&buffer, "%02x", value[i * dst_size + j]);
}
else if (H5T_SGN_NONE == H5Tget_sign(native)) {
- h5tools_str_append(&buffer, "%" H5_PRINTF_LL_WIDTH "u",
- *((unsigned long long *)((void *)(value + i * dst_size))));
+ unsigned long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(&buffer, "%llu", copy);
}
else {
- h5tools_str_append(&buffer, "%" H5_PRINTF_LL_WIDTH "d",
- *((long long *)((void *)(value + i * dst_size))));
+ long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(&buffer, "%lld", copy);
}
h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos,
(size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0);
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index ddf129c..50d0f5d 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -94,7 +94,7 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char **argv)
+parse_command_line(int argc, const char *const *argv)
{
int opt;
@@ -127,7 +127,7 @@ parse_command_line(int argc, const char **argv)
dname_g = HDstrdup(H5_optarg);
if (dname_g == NULL) {
h5tools_setstatus(EXIT_FAILURE);
- error_msg("No dataset name\n", H5_optarg);
+ error_msg("No dataset name `%s`\n", H5_optarg);
usage(h5tools_getprogname());
goto error;
}
@@ -383,7 +383,7 @@ error:
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid = H5I_INVALID_HID;
@@ -394,7 +394,7 @@ main(int argc, const char *argv[])
h5tools_init();
/* Parse command line options */
- if (parse_command_line(argc, argv) < 0)
+ if (parse_command_line(argc, (const char *const *)argv) < 0)
goto done;
else if (verbose_g)
HDfprintf(stdout, "Process command line options\n");
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 6517e43..317db81 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -467,14 +467,12 @@ readIntegerData(FILE *strm, struct Input *in)
H5DT_INT16 temp16;
H5DT_INT32 *in32;
H5DT_INT32 temp32;
-#ifdef H5_SIZEOF_LONG_LONG
H5DT_INT64 *in64;
H5DT_INT64 temp64;
char buffer[256];
-#endif
- hsize_t len = 1;
- hsize_t i;
- int j;
+ hsize_t len = 1;
+ hsize_t i;
+ int j;
const char *err1 = "Unable to get integer value from file.\n";
const char *err2 = "Unrecognized input class type.\n";
@@ -589,7 +587,6 @@ readIntegerData(FILE *strm, struct Input *in)
}
break;
-#ifdef H5_SIZEOF_LONG_LONG
case 64:
in64 = (H5DT_INT64 *)in->data;
switch (in->inputClass) {
@@ -626,7 +623,6 @@ readIntegerData(FILE *strm, struct Input *in)
return (-1);
}
break;
-#endif /* ifdef H5_SIZEOF_LONG_LONG */
default:
(void)HDfprintf(stderr, "%s", err3);
@@ -643,17 +639,15 @@ readUIntegerData(FILE *strm, struct Input *in)
H5DT_UINT16 temp16;
H5DT_UINT32 *in32;
H5DT_UINT32 temp32;
-#ifdef H5_SIZEOF_LONG_LONG
H5DT_UINT64 *in64;
H5DT_UINT64 temp64;
char buffer[256];
-#endif
- hsize_t len = 1;
- hsize_t i;
- int j;
- const char *err1 = "Unable to get unsigned integer value from file.\n";
- const char *err2 = "Unrecognized input class type.\n";
- const char *err3 = "Invalid input size.\n";
+ hsize_t len = 1;
+ hsize_t i;
+ int j;
+ const char * err1 = "Unable to get unsigned integer value from file.\n";
+ const char * err2 = "Unrecognized input class type.\n";
+ const char * err3 = "Invalid input size.\n";
for (j = 0; j < in->rank; j++)
len *= in->sizeOfDimension[j];
@@ -760,7 +754,6 @@ readUIntegerData(FILE *strm, struct Input *in)
}
break;
-#ifdef H5_SIZEOF_LONG_LONG
case 64:
in64 = (H5DT_UINT64 *)in->data;
switch (in->inputClass) {
@@ -797,7 +790,6 @@ readUIntegerData(FILE *strm, struct Input *in)
return (-1);
}
break;
-#endif /* ifdef H5_SIZEOF_LONG_LONG */
default:
(void)HDfprintf(stderr, "%s", err3);
@@ -2134,7 +2126,7 @@ processConfigurationFile(char *infile, struct Input *in)
}
} /* while (get_next_prop) */
} /* else if(!HDstrcmp("SUBSET", key)) */
- else if (!HDstrcmp("DATA", key)) { /* FINSHED */
+ else if (!HDstrcmp("DATA", key)) { /* FINISHED */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATA key\n");
#endif
@@ -2328,7 +2320,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err12a, infile);
goto error;
}
- /* cant appear before dimension sizes have been provided */
+ /* can't appear before dimension sizes have been provided */
if (in->configOptionVector[DIM] == 0) {
(void)HDfprintf(stderr, err12b, infile);
goto error;
@@ -2395,7 +2387,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err16a, infile);
goto error;
}
- /* cant appear before dimension sizes have been provided */
+ /* can't appear before dimension sizes have been provided */
if (in->configOptionVector[DIM] == 0) {
(void)HDfprintf(stderr, err16b, infile);
goto error;
@@ -2457,9 +2449,6 @@ validateConfigurationParameters(struct Input *in)
const char *err4a = "OUTPUT-ARCHITECTURE cannot be STD if OUTPUT-CLASS is floating point (FP).\n";
const char *err4b = "OUTPUT-ARCHITECTURE cannot be IEEE if OUTPUT-CLASS is integer (IN).\n";
const char *err5 = "For OUTPUT-CLASS FP, valid values for OUTPUT-SIZE are (32, 64) .\n";
-#ifndef H5_SIZEOF_LONG_LONG
- const char *err6 = "No support for reading 64-bit integer (INPUT-CLASS: IN, TEXTIN, UIN, TEXTUIN files\n";
-#endif
/* for class STR other parameters are ignored */
if (in->inputClass == 5) /* STR */
@@ -2485,14 +2474,14 @@ validateConfigurationParameters(struct Input *in)
}
}
- /* Arch cant be STD if O/p class is FP */
+ /* Arch can't be STD if O/p class is FP */
if (in->outputArchitecture == 1)
if (in->outputClass == 1) {
(void)HDfprintf(stderr, "%s", err4a);
return (-1);
}
- /* Arch cant be IEEE if O/p class is IN */
+ /* Arch can't be IEEE if O/p class is IN */
if (in->outputArchitecture == 2)
if (in->outputClass == 0) {
(void)HDfprintf(stderr, "%s", err4b);
@@ -2505,13 +2494,6 @@ validateConfigurationParameters(struct Input *in)
return (-1);
}
-#ifndef H5_SIZEOF_LONG_LONG
- if (in->inputSize == 64 &&
- (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7)) {
- (void)HDfprintf(stderr, "%s", err6);
- return -1;
- }
-#endif
return (0);
}
@@ -3250,7 +3232,6 @@ getInputClassType(struct Input *in, char *buffer)
kindex = 3;
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
else if (!HDstrcmp(buffer, "H5T_NATIVE_LDOUBLE")) {
in->inputSize = H5_SIZEOF_LONG_DOUBLE;
in->configOptionVector[INPUT_SIZE] = 1;
@@ -3263,7 +3244,6 @@ getInputClassType(struct Input *in, char *buffer)
kindex = 3;
}
-#endif
else if (!HDstrcmp(buffer, "H5T_TIME: not yet implemented")) {
kindex = -1;
}
@@ -3745,7 +3725,7 @@ getCompressionParameter(struct Input *in, FILE *strm)
int ival;
const char *err1 = "Unable to get integer value.\n";
- const char *err2 = "Invalid value for compression paramter.\n";
+ const char *err2 = "Invalid value for compression parameter.\n";
const char *err3 = "Unsupported Compression Type.\n";
switch (in->compressionType) {
@@ -3804,7 +3784,7 @@ setDefaultValues(struct Input *in, int count)
in->path.count = 1;
HDstrcpy(temp, "dataset");
- HDsprintf(num, "%d", count);
+ HDsnprintf(num, sizeof(num), "%d", count);
HDstrcat(temp, num);
HDstrcpy(in->path.group[0], temp);
@@ -4709,7 +4689,7 @@ process(struct Options *opt)
}
if (in->configOptionVector[EXTERNALSTORE] == 1) {
- /* creating the external file if it doesnt exist */
+ /* creating the external file if it doesn't exist */
if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) {
(void)HDfprintf(stderr, "%s", err4);
H5Pclose(proplist);
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 7f3385c..45978bb 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -22,7 +22,7 @@
herr_t write_pad(int ofile, hsize_t old_where, hsize_t *new_where);
hsize_t compute_user_block_size(hsize_t);
hsize_t copy_some_to_file(int, int, hsize_t, hsize_t, ssize_t);
-void parse_command_line(int, const char *[]);
+void parse_command_line(int, const char *const *);
int do_clobber = FALSE;
char *output_file = NULL;
@@ -104,7 +104,7 @@ leave(int ret)
*/
void
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
int opt = FALSE;
@@ -149,7 +149,7 @@ parse_command_line(int argc, const char *argv[])
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int ufid = -1;
int h5fid = -1;
@@ -174,7 +174,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- parse_command_line(argc, argv);
+ parse_command_line(argc, (const char *const *)argv);
/* enable error reporting if command line option */
h5tools_error_report();
@@ -358,7 +358,7 @@ done:
* Purpose: Copy part of the input file to output.
* infid: fd of file to read
* outfid: fd of file to write
- * startin: offset of where to read from infid
+ * starting: offset of where to read from infid
* startout: offset of where to write to outfid
* limit: bytes to read/write
*
@@ -373,7 +373,7 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssize_t limit)
+copy_some_to_file(int infid, int outfid, hsize_t starting, hsize_t startout, ssize_t limit)
{
char buf[1024];
h5_stat_t sbuf;
@@ -386,9 +386,9 @@ copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssiz
ssize_t toend;
ssize_t fromend;
- if (startin > startout) {
+ if (starting > startout) {
/* this case is prohibited */
- error_msg("copy_some_to_file: panic: startin > startout?\n");
+ error_msg("copy_some_to_file: panic: starting > startout?\n");
exit(EXIT_FAILURE);
} /* end if */
@@ -409,7 +409,7 @@ copy_some_to_file(int infid, int outfid, hsize_t startin, hsize_t startout, ssiz
return 0;
toend = (ssize_t)startout + howmuch;
- fromend = (ssize_t)startin + howmuch;
+ fromend = (ssize_t)starting + howmuch;
if (howmuch > 512) {
to = toend - 512;
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index fa23b06..8ff354e 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -92,7 +92,7 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
int opt = FALSE;
@@ -172,7 +172,7 @@ leave(int ret)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t ifile = H5I_INVALID_HID;
hid_t plist = H5I_INVALID_HID;
@@ -189,7 +189,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- if (EXIT_FAILURE == parse_command_line(argc, argv))
+ if (EXIT_FAILURE == parse_command_line(argc, (const char *const *)argv))
goto done;
/* enable error reporting if command line option */
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 4392d85..c30c08f 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -32,7 +32,7 @@
#define NAME_BUF_SIZE 2048
/*
- * Alternative formating for data dumped by H5LS
+ * Alternative formatting for data dumped by H5LS
*
* This table only affects H5LS output.
*/
@@ -78,9 +78,9 @@ static h5tool_format_t ls_dataformat = {
",", /*elmt_suf1 */
" ", /*elmt_suf2 */
- HSIZE_T_FORMAT, /*idx_n_fmt */
- ",", /*idx_sep */
- "(%s)", /*idx_fmt */
+ "%" PRIuHSIZE, /*idx_n_fmt */
+ ",", /*idx_sep */
+ "(%s)", /*idx_fmt */
65535,
/*line_ncols */ /*standard default columns */
@@ -240,6 +240,12 @@ usage(void)
PRINTVALSTREAM(rawoutstream,
" --vol-info VOL-specific info to pass to the VOL connector used for\n");
PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream, " --vfd-value Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream, " --vfd-name Name of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream, " --vfd-info VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " file/OBJECT\n");
PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n");
@@ -936,8 +942,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Print members */
for (i = 0; i < (unsigned)nmembs; i++) {
- unsigned char *copy; /* a pointer to value array */
- int nchars; /* number of output characters */
+ int nchars; /* number of output characters */
h5tools_str_append(buffer, "\n%*s", ind + 4, "");
nchars = print_string(buffer, name[i], TRUE);
@@ -951,16 +956,16 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind)
h5tools_str_append(buffer, "%02x", value[i * dst_size + j]);
}
else if (H5T_SGN_NONE == H5Tget_sign(native)) {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value + i * dst_size;
- h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long *)((void *)copy)));
+ unsigned long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(buffer, "%llu", copy);
}
else {
- /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
- *strangely, unless use another pointer "copy".*/
- copy = value + i * dst_size;
- h5tools_str_append(buffer, "%lld", *((long long *)((void *)copy)));
+ long long copy;
+
+ HDmemcpy(&copy, value + i * dst_size, sizeof(copy));
+ h5tools_str_append(buffer, "%lld", copy);
}
}
@@ -1179,13 +1184,13 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind)
/* Print dimensions */
for (i = 0; i < ndims; i++)
- h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, i ? "," : "[", dims[i]);
+ h5tools_str_append(buffer, "%s%" PRIuHSIZE, i ? "," : "[", dims[i]);
h5tools_str_append(buffer, "]");
HDfree(dims);
}
else
- h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream);
+ h5tools_str_append(buffer, " [SCALAR]\n");
/* Print parent type */
h5tools_str_append(buffer, " ");
@@ -1695,7 +1700,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
/* simple dataspace */
h5tools_str_append(&buffer, " {");
for (i = 0; i < ndims; i++) {
- h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i ? ", " : "", size[i]);
+ h5tools_str_append(&buffer, "%s%" PRIuHSIZE, i ? ", " : "", size[i]);
nelmts *= size[i];
}
h5tools_str_append(&buffer, "}\n");
@@ -1783,12 +1788,12 @@ dataset_list1(hid_t dset)
ndims = H5Sget_simple_extent_dims(space, cur_size, max_size);
h5tools_str_append(&buffer, " {");
for (i = 0; i < ndims; i++) {
- h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i ? ", " : "", cur_size[i]);
+ h5tools_str_append(&buffer, "%s%" PRIuHSIZE, i ? ", " : "", cur_size[i]);
if (max_size[i] == H5S_UNLIMITED) {
h5tools_str_append(&buffer, "/%s", "Inf");
}
else if (max_size[i] != cur_size[i] || verbose_g > 0) {
- h5tools_str_append(&buffer, "/" HSIZE_T_FORMAT, max_size[i]);
+ h5tools_str_append(&buffer, "/%" PRIuHSIZE, max_size[i]);
}
}
if (space_type == H5S_SCALAR)
@@ -1862,10 +1867,10 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
h5tools_str_append(&buffer, " %-10s {", "Chunks:");
total = H5Tget_size(type);
for (i = 0; i < ndims; i++) {
- h5tools_str_append(&buffer, "%s" HSIZE_T_FORMAT, i ? ", " : "", chsize[i]);
+ h5tools_str_append(&buffer, "%s%" PRIuHSIZE, i ? ", " : "", chsize[i]);
total *= chsize[i];
}
- h5tools_str_append(&buffer, "} " HSIZE_T_FORMAT " bytes\n", total);
+ h5tools_str_append(&buffer, "} %" PRIuHSIZE " bytes\n", total);
} break;
case H5D_COMPACT:
break;
@@ -1891,15 +1896,13 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size) <
0) {
h5tools_str_append(
- &buffer,
- " #%03d %10" H5_PRINTF_LL_WIDTH "u %10s %10s ***ERROR*** %s\n", i,
+ &buffer, " #%03d %10" PRIuHSIZE " %10s %10s ***ERROR*** %s\n", i,
total, "", "", i + 1 < nf ? "Following addresses are incorrect" : "");
}
else if (H5S_UNLIMITED == f_size) {
h5tools_str_append(&buffer,
- " #%03d %10" H5_PRINTF_LL_WIDTH
- "u %10" H5_PRINTF_LL_WIDTH "u %10s ",
- i, total, (hsize_t)f_offset, "INF");
+ " #%03d %10" PRIuHSIZE " %10" PRIuHSIZE " %10s ", i,
+ total, (hsize_t)f_offset, "INF");
print_string(&buffer, f_name, TRUE);
}
else {
@@ -1979,8 +1982,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name)
case H5T_ARRAY:
case H5T_NCLASSES:
default:
- h5tools_str_append(&buffer,
- HSIZE_T_FORMAT " logical byte%s, " HSIZE_T_FORMAT " allocated byte%s",
+ h5tools_str_append(&buffer, "%" PRIuHSIZE " logical byte%s, %" PRIuHSIZE " allocated byte%s",
total, 1 == total ? "" : "s", used, 1 == used ? "" : "s");
if (used > 0) {
utilization = ((double)total * 100.0) / (double)used;
@@ -2297,7 +2299,7 @@ list_lnk(const char *name, const H5L_info2_t *linfo, void *_iter)
iter->symlink_list->dangle_link = TRUE;
h5tools_str_append(&buffer, "Soft Link {");
- h5tools_str_append(&buffer, buf);
+ h5tools_str_append(&buffer, "%s", buf);
h5tools_str_append(&buffer, "}");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols,
(hsize_t)0, (hsize_t)0);
@@ -2365,11 +2367,11 @@ list_lnk(const char *name, const H5L_info2_t *linfo, void *_iter)
goto done;
h5tools_str_append(&buffer, "External Link {");
- h5tools_str_append(&buffer, filename);
+ h5tools_str_append(&buffer, "%s", filename);
h5tools_str_append(&buffer, "/");
if (*path != '/')
h5tools_str_append(&buffer, "/");
- h5tools_str_append(&buffer, path);
+ h5tools_str_append(&buffer, "%s", path);
h5tools_str_append(&buffer, "}");
h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols,
(hsize_t)0, (hsize_t)0);
@@ -2520,7 +2522,7 @@ done:
* were borrowed from the GNU less(1).
*
* Return: Success: Number of columns.
- * Failure: Some default number of columms.
+ * Failure: Some default number of columns.
*-------------------------------------------------------------------------
*/
static int
@@ -2640,7 +2642,7 @@ leave(int ret)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t file_id = H5I_INVALID_HID;
char * fname = NULL, *oname = NULL, *x = NULL;
@@ -2649,11 +2651,12 @@ main(int argc, const char *argv[])
int argno;
static char root_name[] = "/";
char drivername[50];
- const char * preferred_driver = NULL;
- int err_exit = 0;
- hid_t fapl_id = H5P_DEFAULT;
- hbool_t custom_vol_fapl = FALSE;
+ int err_exit = 0;
+ hid_t fapl_id = H5P_DEFAULT;
+ hbool_t custom_vol_fapl = FALSE;
+ hbool_t custom_vfd_fapl = FALSE;
h5tools_vol_info_t vol_info;
+ h5tools_vfd_info_t vfd_info;
#ifdef H5_HAVE_ROS3_VFD
/* Default "anonymous" S3 configuration */
@@ -2684,8 +2687,9 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- /* Initialize fapl info struct */
+ /* Initialize fapl info structs */
HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t));
+ HDmemset(&vfd_info, 0, sizeof(h5tools_vfd_info_t));
/* Build object display table */
DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL);
@@ -2714,9 +2718,9 @@ main(int argc, const char *argv[])
}
else if (!HDstrcmp(argv[argno], "--enable-error-stack")) {
enable_error_stack = 1;
- /* deprecated --errors */
}
else if (!HDstrcmp(argv[argno], "--errors")) {
+ /* deprecated --errors */
enable_error_stack = 1;
}
else if (!HDstrcmp(argv[argno], "--follow-symlinks")) {
@@ -2747,9 +2751,6 @@ main(int argc, const char *argv[])
else if (!HDstrcmp(argv[argno], "--string")) {
string_g = TRUE;
}
- else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) {
- preferred_driver = argv[argno] + 6;
- }
else if (!HDstrncmp(argv[argno], "--vol-value=", (size_t)12)) {
vol_info.type = VOL_BY_VALUE;
vol_info.u.value = (H5VL_class_value_t)HDatoi(argv[argno] + 12);
@@ -2763,6 +2764,25 @@ main(int argc, const char *argv[])
else if (!HDstrncmp(argv[argno], "--vol-info=", (size_t)11)) {
vol_info.info_string = argv[argno] + 11;
}
+ else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) {
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.u.name = argv[argno] + 6;
+ vfd_info.info = NULL;
+ custom_vfd_fapl = TRUE;
+ }
+ else if (!HDstrncmp(argv[argno], "--vfd-value=", (size_t)12)) {
+ vfd_info.type = VFD_BY_VALUE;
+ vfd_info.u.value = (H5FD_class_value_t)HDatoi(argv[argno] + 12);
+ custom_vfd_fapl = TRUE;
+ }
+ else if (!HDstrncmp(argv[argno], "--vfd-name=", (size_t)11)) {
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.u.name = argv[argno] + 11;
+ custom_vfd_fapl = TRUE;
+ }
+ else if (!HDstrncmp(argv[argno], "--vfd-info=", (size_t)11)) {
+ vfd_info.info = (const void *)(argv[argno] + 11);
+ }
else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) {
width_g = (int)HDstrtol(argv[argno] + 8, &rest, 0);
@@ -2959,42 +2979,14 @@ main(int argc, const char *argv[])
}
/* Setup a custom fapl for file accesses */
- if (custom_vol_fapl) {
- if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vol_info, NULL)) < 0) {
+ if (custom_vol_fapl || custom_vfd_fapl) {
+ if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, custom_vol_fapl ? &vol_info : NULL,
+ custom_vfd_fapl ? &vfd_info : NULL)) < 0) {
error_msg("failed to setup file access property list (fapl) for file\n");
leave(EXIT_FAILURE);
}
}
- if (preferred_driver) {
- h5tools_vfd_info_t vfd_info;
-
- vfd_info.info = NULL;
- vfd_info.name = preferred_driver;
-
- if (!HDstrcmp(preferred_driver, drivernames[ROS3_VFD_IDX])) {
-#ifdef H5_HAVE_ROS3_VFD
- vfd_info.info = (void *)&ros3_fa;
-#else
- HDfprintf(rawerrorstream, "Error: Read-Only S3 VFD is not enabled\n\n");
- leave(EXIT_FAILURE);
-#endif
- }
- else if (!HDstrcmp(preferred_driver, drivernames[HDFS_VFD_IDX])) {
-#ifdef H5_HAVE_LIBHDFS
- vfd_info.info = (void *)&hdfs_fa;
-#else
- HDfprintf(rawerrorstream, "Error: The HDFS VFD is not enabled\n\n");
- leave(EXIT_FAILURE);
-#endif
- }
-
- if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) {
- HDfprintf(rawerrorstream, "Error: Unable to create FAPL for file access\n\n");
- leave(EXIT_FAILURE);
- }
- }
-
/* Each remaining argument is an hdf5 file followed by an optional slash
* and object name.
*
@@ -3019,8 +3011,8 @@ main(int argc, const char *argv[])
file_id = H5I_INVALID_HID;
while (fname && *fname) {
- file_id = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE,
- drivername, sizeof drivername);
+ file_id = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id != H5P_DEFAULT), drivername,
+ sizeof drivername);
if (file_id >= 0) {
if (verbose_g)
diff --git a/tools/src/h5perf/perf.c b/tools/src/h5perf/perf.c
index 83d4ab0..84be7e8 100644
--- a/tools/src/h5perf/perf.c
+++ b/tools/src/h5perf/perf.c
@@ -119,7 +119,7 @@ static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *_suf
int
main(int argc, char **argv)
{
- char * buf, *tmp, *buf2 = NULL, *tmp2 = NULL, *check;
+ char * buf = NULL, *tmp = NULL, *buf2 = NULL, *tmp2 = NULL, *check = NULL;
int i, j, mynod = 0, nprocs = 1, my_correct = 1, correct, myerrno;
double stim, etim;
double write_tim = 0;
@@ -605,7 +605,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fu
* we are using the split driver since both of those
* use the multi VFD under the hood.
*/
- env = HDgetenv("HDF5_DRIVER");
+ env = HDgetenv(HDF5_DRIVER);
#ifdef HDF5_DRIVER
/* Use the environment variable, then the compile-time constant */
if (!env)
diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c
index cac36d7..1baaca2 100644
--- a/tools/src/h5perf/pio_engine.c
+++ b/tools/src/h5perf/pio_engine.c
@@ -244,7 +244,7 @@ do_pio(parameters param)
if (((size_t)(snbytes / pio_mpi_nprocs_g) % buf_size) != 0) {
HDfprintf(stderr,
"Dataset size/process (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
- "trasfer buffer size (%zu)\n",
+ "transfer buffer size (%zu)\n",
(long long)(snbytes / pio_mpi_nprocs_g), buf_size);
GOTOERROR(FAIL);
}
@@ -253,7 +253,7 @@ do_pio(parameters param)
if (((size_t)snbytes % buf_size) != 0) {
HDfprintf(stderr,
"Dataset side size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
- "trasfer buffer size (%zu)\n",
+ "transfer buffer size (%zu)\n",
(long long)snbytes, buf_size);
GOTOERROR(FAIL);
}
@@ -282,7 +282,7 @@ do_pio(parameters param)
/* Open file for write */
char base_name[256];
- HDsprintf(base_name, "#pio_tmp_%lu", nf);
+ HDsnprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf);
pio_create_filename(iot, base_name, fname, sizeof(fname));
if (pio_debug_level > 0)
HDfprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname);
@@ -420,7 +420,7 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
/* If the prefix specifies the HDF5_PARAPREFIX directory, then
* default to using the "/tmp/$USER" or "/tmp/$LOGIN"
* directory instead. */
- register char *user, *login, *subdir;
+ char *user, *login, *subdir;
user = HDgetenv("USER");
login = HDgetenv("LOGIN");
@@ -898,7 +898,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby
} /* end if */
} /* end else */
- HDsprintf(dname, "Dataset_%ld", ndset);
+ HDsnprintf(dname, sizeof(dname), "Dataset_%ld", ndset);
h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, h5dcpl);
if (h5ds_id < 0) {
@@ -1183,7 +1183,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby
/* Set the file view */
mrc = MPI_File_set_view(fd->mpifd, mpi_offset, mpi_blk_type, mpi_file_type,
- (char *)"native", h5_io_info_g);
+ "native", h5_io_info_g);
VRFY((mrc == MPI_SUCCESS), "MPIO_VIEW");
/* Perform write */
@@ -1320,7 +1320,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nby
else {
/* Set the file view */
mrc = MPI_File_set_view(fd->mpifd, mpi_offset, MPI_BYTE, mpi_collective_type,
- (char *)"native", h5_io_info_g);
+ "native", h5_io_info_g);
VRFY((mrc == MPI_SUCCESS), "MPIO_VIEW");
/* Perform write */
@@ -1879,7 +1879,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt
break;
case PHDF5:
- HDsprintf(dname, "Dataset_%ld", ndset);
+ HDsnprintf(dname, sizeof(dname), "Dataset_%ld", ndset);
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
@@ -2154,7 +2154,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt
/* Set the file view */
mrc = MPI_File_set_view(fd->mpifd, mpi_offset, mpi_blk_type, mpi_file_type,
- (char *)"native", h5_io_info_g);
+ "native", h5_io_info_g);
VRFY((mrc == MPI_SUCCESS), "MPIO_VIEW");
/* Perform collective read */
@@ -2291,7 +2291,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, off_t nbyt
else {
/* Set the file view */
mrc = MPI_File_set_view(fd->mpifd, mpi_offset, MPI_BYTE, mpi_collective_type,
- (char *)"native", h5_io_info_g);
+ "native", h5_io_info_g);
VRFY((mrc == MPI_SUCCESS), "MPIO_VIEW");
/* Perform read */
@@ -2676,7 +2676,7 @@ do_cleanupfile(iotype iot, char *fname)
return;
if (clean_file_g == -1)
- clean_file_g = (getenv("HDF5_NOCLEANUP") == NULL) ? 1 : 0;
+ clean_file_g = (getenv(HDF5_NOCLEANUP) == NULL) ? 1 : 0;
if (clean_file_g) {
switch (iot) {
diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c
index 41245d9..003c4f2 100644
--- a/tools/src/h5perf/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -188,7 +188,7 @@ typedef struct _minmax {
/* local functions */
static off_t parse_size_directive(const char *size);
-static struct options *parse_command_line(int argc, char *argv[]);
+static struct options *parse_command_line(int argc, const char *const *argv);
static void run_test_loop(struct options *options);
static int run_test(iotype iot, parameters parms, struct options *opts);
static void output_all_info(minmax *mm, int count, int indent_level);
@@ -200,7 +200,7 @@ static void output_results(const struct options *options, const char *name, min
off_t data_size);
static void output_times(const struct options *options, const char *name, minmax *table, int table_size);
static void output_report(const char *fmt, ...);
-static void print_indent(register int indent);
+static void print_indent(int indent);
static void usage(const char *prog);
static void report_parameters(struct options *opts);
static off_t squareo(off_t);
@@ -260,7 +260,7 @@ main(int argc, char *argv[])
pio_comm_g = MPI_COMM_WORLD;
h5_set_info_object();
- opts = parse_command_line(argc, argv);
+ opts = parse_command_line(argc, (const char *const *)argv);
if (!opts) {
exit_value = EXIT_FAILURE;
@@ -336,7 +336,7 @@ run_test_loop(struct options *opts)
/* start with max_num_procs and decrement it by half for each loop. */
/* if performance needs restart, fewer processes may be needed. */
for (num_procs = opts->max_num_procs; num_procs >= opts->min_num_procs; num_procs >>= 1) {
- register size_t buf_size;
+ size_t buf_size;
parms.num_procs = num_procs;
@@ -411,34 +411,34 @@ run_test_loop(struct options *opts)
static int
run_test(iotype iot, parameters parms, struct options *opts)
{
- results res;
- register int i, ret_value = SUCCESS;
- int comm_size;
- off_t raw_size;
- minmax * write_mpi_mm_table = NULL;
- minmax * write_mm_table = NULL;
- minmax * write_gross_mm_table = NULL;
- minmax * write_raw_mm_table = NULL;
- minmax * read_mpi_mm_table = NULL;
- minmax * read_mm_table = NULL;
- minmax * read_gross_mm_table = NULL;
- minmax * read_raw_mm_table = NULL;
- minmax * read_open_mm_table = NULL;
- minmax * read_close_mm_table = NULL;
- minmax * write_open_mm_table = NULL;
- minmax * write_close_mm_table = NULL;
- minmax write_mpi_mm = {0.0, 0.0, 0.0, 0};
- minmax write_mm = {0.0, 0.0, 0.0, 0};
- minmax write_gross_mm = {0.0, 0.0, 0.0, 0};
- minmax write_raw_mm = {0.0, 0.0, 0.0, 0};
- minmax read_mpi_mm = {0.0, 0.0, 0.0, 0};
- minmax read_mm = {0.0, 0.0, 0.0, 0};
- minmax read_gross_mm = {0.0, 0.0, 0.0, 0};
- minmax read_raw_mm = {0.0, 0.0, 0.0, 0};
- minmax read_open_mm = {0.0, 0.0, 0.0, 0};
- minmax read_close_mm = {0.0, 0.0, 0.0, 0};
- minmax write_open_mm = {0.0, 0.0, 0.0, 0};
- minmax write_close_mm = {0.0, 0.0, 0.0, 0};
+ results res;
+ int i, ret_value = SUCCESS;
+ int comm_size;
+ off_t raw_size;
+ minmax *write_mpi_mm_table = NULL;
+ minmax *write_mm_table = NULL;
+ minmax *write_gross_mm_table = NULL;
+ minmax *write_raw_mm_table = NULL;
+ minmax *read_mpi_mm_table = NULL;
+ minmax *read_mm_table = NULL;
+ minmax *read_gross_mm_table = NULL;
+ minmax *read_raw_mm_table = NULL;
+ minmax *read_open_mm_table = NULL;
+ minmax *read_close_mm_table = NULL;
+ minmax *write_open_mm_table = NULL;
+ minmax *write_close_mm_table = NULL;
+ minmax write_mpi_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_gross_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_raw_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_mpi_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_gross_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_raw_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_open_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_close_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_open_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_close_mm = {0.0, 0.0, 0.0, 0};
raw_size = parms.num_files * (off_t)parms.num_dsets * (off_t)parms.num_bytes;
parms.io_type = iot;
@@ -579,7 +579,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts, "Raw Data Write", write_raw_mm_table, parms.num_iters, raw_size);
} /* end if */
- /* show mpi write statics */
+ /* show mpi write statistics */
if (pio_debug_level >= 3) {
/* output all of the times for all iterations */
print_indent(3);
@@ -645,7 +645,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts, "Raw Data Read", read_raw_mm_table, parms.num_iters, raw_size);
} /* end if */
- /* show mpi read statics */
+ /* show mpi read statistics */
if (pio_debug_level >= 3) {
/* output all of the times for all iterations */
print_indent(3);
@@ -904,7 +904,7 @@ accumulate_minmax_stuff(minmax *mm, int count)
int i;
minmax total_mm;
- total_mm.sum = 0.0f;
+ total_mm.sum = 0.0;
total_mm.max = -DBL_MAX;
total_mm.min = DBL_MAX;
total_mm.num = count;
@@ -1098,10 +1098,9 @@ output_report(const char *fmt, ...)
* things.
* Return: Nothing
* Programmer: Bill Wendling, 29. October 2001
- * Modifications:
*/
static void
-print_indent(register int indent)
+print_indent(int indent)
{
int myrank;
@@ -1276,9 +1275,9 @@ report_parameters(struct options *opts)
* Added 2D testing (Christian Chilan, 10. August 2005)
*/
static struct options *
-parse_command_line(int argc, char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
- register int opt;
+ int opt;
struct options *cl_opts;
cl_opts = (struct options *)malloc(sizeof(struct options));
@@ -1305,7 +1304,7 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = FALSE; /* Do both read and write by default */
cl_opts->verify = FALSE; /* No Verify data correctness by default */
- while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) {
+ while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
switch ((char)opt) {
case 'a':
cl_opts->h5_alignment = parse_size_directive(H5_optarg);
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c
index e69a7cd..bdd2c08 100644
--- a/tools/src/h5perf/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -179,7 +179,7 @@ do_sio(parameters param, results *res)
if ((param.dset_size[i] % param.buf_size[i]) != 0) {
HDfprintf(stderr,
"Dataset size[%d] (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
- "trasfer buffer size[%d] (%zu)\n",
+ "transfer buffer size[%d] (%zu)\n",
param.rank, (long long)param.dset_size[i], param.rank, param.buf_size[i]);
GOTOERROR(FAIL);
}
@@ -328,7 +328,7 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si
/* If the prefix specifies the HDF5_PREFIX directory, then
* default to using the "/tmp/$USER" or "/tmp/$LOGIN"
* directory instead. */
- register char *user, *login, *subdir;
+ char *user, *login, *subdir;
user = HDgetenv("USER");
login = HDgetenv("LOGIN");
@@ -1267,12 +1267,12 @@ done:
static void
do_cleanupfile(iotype iot, char *filename)
{
- char temp[2048];
+ char temp[4096 + sizeof("-?.h5")];
int j;
hid_t driver;
if (clean_file_g == -1)
- clean_file_g = (HDgetenv("HDF5_NOCLEANUP") == NULL) ? 1 : 0;
+ clean_file_g = (HDgetenv(HDF5_NOCLEANUP) == NULL) ? 1 : 0;
if (clean_file_g) {
diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c
index 9c7675f..dc2e15e 100644
--- a/tools/src/h5perf/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -164,7 +164,7 @@ typedef struct {
/* local functions */
static hsize_t parse_size_directive(const char *size);
-static struct options *parse_command_line(int argc, const char *argv[]);
+static struct options *parse_command_line(int argc, const char *const *argv);
static void run_test_loop(struct options *options);
static int run_test(iotype iot, parameters parms, struct options *opts);
static void output_all_info(minmax *mm, int count, int indent_level);
@@ -173,7 +173,7 @@ static void accumulate_minmax_stuff(const minmax *mm, int count, minm
static void output_results(const struct options *options, const char *name, minmax *table, int table_size,
off_t data_size);
static void output_report(const char *fmt, ...);
-static void print_indent(register int indent);
+static void print_indent(int indent);
static void usage(const char *prog);
static void report_parameters(struct options *opts);
@@ -185,7 +185,7 @@ static void report_parameters(struct options *opts);
* Modifications:
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int exit_value = EXIT_SUCCESS;
struct options *opts = NULL;
@@ -197,7 +197,7 @@ main(int argc, const char *argv[])
output = stdout;
- opts = parse_command_line(argc, argv);
+ opts = parse_command_line(argc, (const char *const *)argv);
if (!opts) {
exit_value = EXIT_FAILURE;
@@ -277,7 +277,7 @@ run_test_loop(struct options *opts)
}
/* print size information */
- output_report("Transfer Buffer Size (bytes): %d\n", buf_bytes);
+ output_report("Transfer Buffer Size (bytes): %zu\n", buf_bytes);
output_report("File Size(MB): %.2f\n", ((double)parms.num_bytes) / ONE_MB);
print_indent(0);
@@ -299,25 +299,25 @@ run_test_loop(struct options *opts)
static int
run_test(iotype iot, parameters parms, struct options *opts)
{
- results res;
- register int i, ret_value = SUCCESS;
- off_t raw_size;
- minmax * write_sys_mm_table = NULL;
- minmax * write_mm_table = NULL;
- minmax * write_gross_mm_table = NULL;
- minmax * write_raw_mm_table = NULL;
- minmax * read_sys_mm_table = NULL;
- minmax * read_mm_table = NULL;
- minmax * read_gross_mm_table = NULL;
- minmax * read_raw_mm_table = NULL;
- minmax write_sys_mm = {0.0, 0.0, 0.0, 0};
- minmax write_mm = {0.0, 0.0, 0.0, 0};
- minmax write_gross_mm = {0.0, 0.0, 0.0, 0};
- minmax write_raw_mm = {0.0, 0.0, 0.0, 0};
- minmax read_sys_mm = {0.0, 0.0, 0.0, 0};
- minmax read_mm = {0.0, 0.0, 0.0, 0};
- minmax read_gross_mm = {0.0, 0.0, 0.0, 0};
- minmax read_raw_mm = {0.0, 0.0, 0.0, 0};
+ results res;
+ int i, ret_value = SUCCESS;
+ off_t raw_size;
+ minmax *write_sys_mm_table = NULL;
+ minmax *write_mm_table = NULL;
+ minmax *write_gross_mm_table = NULL;
+ minmax *write_raw_mm_table = NULL;
+ minmax *read_sys_mm_table = NULL;
+ minmax *read_mm_table = NULL;
+ minmax *read_gross_mm_table = NULL;
+ minmax *read_raw_mm_table = NULL;
+ minmax write_sys_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_gross_mm = {0.0, 0.0, 0.0, 0};
+ minmax write_raw_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_sys_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_gross_mm = {0.0, 0.0, 0.0, 0};
+ minmax read_raw_mm = {0.0, 0.0, 0.0, 0};
raw_size = (off_t)parms.num_bytes;
parms.io_type = iot;
@@ -427,7 +427,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts, "Raw Data Write", write_raw_mm_table, parms.num_iters, raw_size);
} /* end if */
- /* show sys write statics */
+ /* show sys write statistics */
#if 0
if (sio_debug_level >= 3) {
/* output all of the times for all iterations */
@@ -473,7 +473,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts, "Raw Data Read", read_raw_mm_table, parms.num_iters, raw_size);
} /* end if */
- /* show mpi read statics */
+ /* show mpi read statistics */
#if 0
if (sio_debug_level >= 3) {
/* output all of the times for all iterations */
@@ -657,10 +657,9 @@ output_report(const char *fmt, ...)
* things.
* Return: Nothing
* Programmer: Bill Wendling, 29. October 2001
- * Modifications:
*/
static void
-print_indent(register int indent)
+print_indent(int indent)
{
indent *= TAB_SPACE;
@@ -817,7 +816,7 @@ report_parameters(struct options *opts)
* Added multidimensional testing (Christian Chilan, April, 2008)
*/
static struct options *
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
int opt;
struct options *cl_opts;
@@ -1278,7 +1277,7 @@ usage(const char *prog)
HDprintf("\n");
HDprintf(" Example: 2K,2K,3K\n");
HDprintf("\n");
- HDprintf(" The example defines an object (dataset, tranfer buffer) with three\n");
+ HDprintf(" The example defines an object (dataset, transfer buffer) with three\n");
HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n");
HDprintf(" the total size of the object increases exponentially.\n");
HDprintf("\n");
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 7cad36b..d0aad79 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -221,6 +221,7 @@ h5repack_addlayout(const char *str, pack_opt_t *options)
* to free the stack.
*-------------------------------------------------------------------------
*/
+
hid_t
copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt,
pack_opt_t *options)
@@ -354,24 +355,28 @@ done:
int
copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options)
{
- hid_t attr_id = H5I_INVALID_HID; /* attr ID */
- hid_t attr_out = H5I_INVALID_HID; /* attr ID */
- hid_t space_id = H5I_INVALID_HID; /* space ID */
- hid_t ftype_id = H5I_INVALID_HID; /* file type ID */
- hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */
- size_t msize; /* size of type */
- void * buf = NULL; /* data buffer */
- hsize_t nelmts; /* number of elements in dataset */
- int rank; /* rank of dataset */
- htri_t is_named; /* Whether the datatype is named */
- hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */
- char name[255];
- H5O_info2_t oinfo; /* object info */
- int j;
- unsigned u;
- hbool_t is_ref = 0;
- H5T_class_t type_class = -1;
- int ret_value = 0;
+ hid_t attr_id = H5I_INVALID_HID; /* attr ID */
+ hid_t attr_out = H5I_INVALID_HID; /* attr ID */
+ hid_t space_id = H5I_INVALID_HID; /* space ID */
+ hid_t ftype_id = H5I_INVALID_HID; /* file type ID */
+ hid_t wtype_id = H5I_INVALID_HID; /* read/write type ID */
+ size_t msize; /* size of type */
+ void * buf = NULL; /* data buffer */
+ hsize_t nelmts; /* number of elements in dataset */
+ int rank; /* rank of dataset */
+ htri_t is_named; /* Whether the datatype is named */
+ hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */
+ H5_timer_t timer; /* Timer for read/write operations */
+ H5_timevals_t times; /* Elapsed time for each operation */
+ static double read_time = 0;
+ static double write_time = 0;
+ char name[255];
+ H5O_info2_t oinfo; /* object info */
+ int j;
+ unsigned u;
+ hbool_t is_ref = 0;
+ H5T_class_t type_class = -1;
+ int ret_value = 0;
if (H5Oget_info3(loc_in, &oinfo, H5O_INFO_NUM_ATTRS) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Oget_info failed");
@@ -468,6 +473,9 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_
} /* end for each member */
} /* end if type_class is H5T_COMPOUND */
+ read_time = 0;
+ write_time = 0;
+
if (!is_ref) {
/*-----------------------------------------------------------------
* read to memory
@@ -478,8 +486,17 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_
if (buf == NULL) {
H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed");
} /* end if */
+ if (options->verbose == 2) {
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Aread(attr_id, wtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Aread failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ read_time += times.elapsed;
+ }
/*-----------------------------------------------------------------
* copy
@@ -488,8 +505,18 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_
if ((attr_out = H5Acreate2(loc_out, name, wtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Acreate2 failed on ,%s>", name);
+
+ if (options->verbose == 2) {
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Awrite(attr_out, wtype_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Awrite failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ write_time += times.elapsed;
+ }
/*close*/
if (H5Aclose(attr_out) < 0)
@@ -499,11 +526,14 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_
* be reclaimed */
if (TRUE == h5tools_detect_vlen(wtype_id))
H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf);
+
HDfree(buf);
buf = NULL;
} /*H5T_REFERENCE*/
- if (options->verbose)
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_ATTR_TIME, "attr", read_time, write_time, name);
+ else
HDprintf(FORMAT_OBJ_ATTR, "attr", name);
/*---------------------------------------------------------------------
@@ -569,7 +599,7 @@ check_options(pack_opt_t *options)
* Objects to layout
*-------------------------------------------------------------------------
*/
- if (options->verbose && have_request(options)) {
+ if (options->verbose > 0 && have_request(options)) {
if (options->all_layout == 1) {
HDprintf("All objects to modify layout are...\n");
switch (options->layout_g) {
@@ -610,7 +640,7 @@ check_options(pack_opt_t *options)
char *name = options->op_tbl->objs[i].path;
if (options->op_tbl->objs[i].chunk.rank > 0) {
- if (options->verbose) {
+ if (options->verbose > 0) {
HDprintf(" <%s> with chunk size ", name);
for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++)
HDprintf("%d ", (int)options->op_tbl->objs[i].chunk.chunk_lengths[k]);
@@ -619,7 +649,7 @@ check_options(pack_opt_t *options)
has_ck = 1;
}
else if (options->op_tbl->objs[i].chunk.rank == -2) { /* TODO: replace 'magic number' */
- if (options->verbose)
+ if (options->verbose > 0)
HDprintf(" <%s> %s\n", name, "NONE (contiguous)");
has_ck = 1;
}
@@ -633,7 +663,7 @@ check_options(pack_opt_t *options)
*-------------------------------------------------------------------------
*/
- if (options->verbose && have_request(options)) {
+ if (options->verbose > 0 && have_request(options)) {
if (options->all_filter == 1) {
HDprintf("All objects to apply filter are...\n");
for (k = 0; k < options->n_filter_g; k++) {
@@ -670,7 +700,7 @@ check_options(pack_opt_t *options)
char * name = pack.path;
for (j = 0; j < pack.nfilters; j++) {
- if (options->verbose) {
+ if (options->verbose > 0) {
if (pack.filter[j].filtn >= 0) {
if (pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) {
HDprintf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn),
@@ -708,7 +738,7 @@ check_options(pack_opt_t *options)
*------------------------------------------------------------------------
*/
if (options->ublock_filename != NULL && options->ublock_size == 0) {
- if (options->verbose) {
+ if (options->verbose > 0) {
HDprintf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n",
options->ublock_filename);
options->ublock_size = 1024;
@@ -758,8 +788,8 @@ check_objects(const char *fname, pack_opt_t *options)
* open the file
*-------------------------------------------------------------------------
*/
- if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, options->fin_fapl,
- (options->fin_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0)
+ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, options->fin_fapl, (options->fin_fapl != H5P_DEFAULT),
+ NULL, 0)) < 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR);
/*-------------------------------------------------------------------------
@@ -781,21 +811,21 @@ check_objects(const char *fname, pack_opt_t *options)
*-------------------------------------------------------------------------
*/
- if (options->verbose)
+ if (options->verbose > 0)
HDprintf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs);
for (i = 0; i < options->op_tbl->nelems; i++) {
pack_info_t obj = options->op_tbl->objs[i];
char * name = obj.path;
- if (options->verbose)
+ if (options->verbose > 0)
HDprintf(" <%s>", name);
/* the input object names are present in the file and are valid */
if (h5trav_getindext(name, travt) < 0)
H5TOOLS_GOTO_ERROR((-1), "%s Could not find <%s> in file <%s>. Exiting...\n",
- (options->verbose ? "\n" : ""), name, fname);
- if (options->verbose)
+ (options->verbose > 0 ? "\n" : ""), name, fname);
+ if (options->verbose > 0)
HDprintf("...Found\n");
for (ifil = 0; ifil < obj.nfilters; ifil++) {
diff --git a/tools/src/h5repack/h5repack.h b/tools/src/h5repack/h5repack.h
index 74525f4..65e5d40 100644
--- a/tools/src/h5repack/h5repack.h
+++ b/tools/src/h5repack/h5repack.h
@@ -27,6 +27,12 @@
#define FORMAT_OBJ_ATTR " %-27s %s\n" /* obj type, name */
#define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */
+/* timing formats */
+#define FORMAT_OBJ_TIME " %-27s %e/%e %s\n" /* obj type, name */
+#define FORMAT_OBJ_ATTR_TIME " %-27s %e/%e %s\n" /* obj type, name */
+#define FORMAT_OBJ_NOTIME " %-27s %s\n" /* obj type, name */
+#define FORMAT_OBJ_ATTR_NOTIME " %-27s %s\n" /* obj type, name */
+
/* File space default information */
#define FS_PAGESIZE_DEF 4096
#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
@@ -118,7 +124,7 @@ typedef struct {
int grp_compact; /* Set the maximum number of links to store as header messages in the group */
int grp_indexed; /* Set the minimum number of links to store in the indexed format */
int msg_size[8]; /* Minimum size of shared messages: dataspace,
- datatype, fill value, filter pipleline, attribute */
+ datatype, fill value, filter pipeline, attribute */
const char * ublock_filename; /* user block file name */
hsize_t ublock_size; /* user block size */
hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 934b4d1..c38a431 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -39,7 +39,8 @@
*/
static int get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t size_datum,
hsize_t dims_hslab[], hsize_t *hslab_nbytes_p);
-static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr);
+static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr, pack_opt_t *options,
+ double read_time, double write_time);
static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *options);
static int copy_user_block(const char *infile, const char *outfile, hsize_t size);
#if defined(H5REPACK_DEBUG_USER_BLOCK)
@@ -66,7 +67,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */
trav_table_t * travt = NULL;
hsize_t ub_size = 0; /* size of user block */
- H5F_fspace_strategy_t set_strategy; /* Strategy to be set in outupt file */
+ H5F_fspace_strategy_t set_strategy; /* Strategy to be set in output file */
hbool_t set_persist; /* Persist free-space status to be set in output file */
hsize_t set_threshold; /* Free-space section threshold to be set in output file */
hsize_t set_pagesize; /* File space page size to be set in output file */
@@ -81,8 +82,8 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
* open input file
*-------------------------------------------------------------------------
*/
- if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, options->fin_fapl,
- (options->fin_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, (size_t)0)) < 0)
+ if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, options->fin_fapl, (options->fin_fapl != H5P_DEFAULT),
+ NULL, (size_t)0)) < 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR);
/* get user block size and file space strategy/persist/threshold */
@@ -187,7 +188,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
H5TOOLS_GOTO_ERROR((-1), "H5Pset_shared_mesg_nindexes failed to set the number of shared "
"object header message indexes");
- /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */
+ /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipeline, 4=attribute */
for (i = 0; i < (nindex - 1); i++)
if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Pset_shared_mesg_index failed to configure the specified "
@@ -298,7 +299,7 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
* create the output file
*-------------------------------------------------------------------------
*/
- if (options->verbose)
+ if (options->verbose > 0)
HDprintf("Making new file ...\n");
if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, options->fout_fapl)) < 0)
@@ -401,18 +402,18 @@ done:
/*-------------------------------------------------------------------------
* Function: get_hyperslab
*
- * Purpose: Calulate a hyperslab from a dataset for higher performance.
- * The size of hyperslab is limitted by H5TOOLS_BUFSIZE.
- * Return the hyperslab dimentions and size in byte.
+ * Purpose: Calculate a hyperslab from a dataset for higher performance.
+ * The size of hyperslab is limited by H5TOOLS_BUFSIZE.
+ * Return the hyperslab dimensions and size in byte.
*
* Return: 0 - SUCCEED, -1 FAILED
*
* Parameters:
* dcpl_id : [IN] dataset creation property.
* rank_dset : [IN] dataset rank
- * dims_dset[] : [IN] dataset dimentions
+ * dims_dset[] : [IN] dataset dimensions
* size_datum : [IN] size of a data element in byte
- * dims_hslab[] : [OUT] calculated hyperslab dimentions
+ * dims_hslab[] : [OUT] calculated hyperslab dimensions
* * hslab_nbytes_p : [OUT] total byte of the hyperslab
*
* Update:
@@ -427,7 +428,7 @@ done:
* 3. If not chunked, each data element would be a unit of collection and
* the boundary would be dataset's dims.
*
- * The calulation starts from the last dimention (h5dump dims output).
+ * The calculation starts from the last dimension (h5dump dims output).
*-----------------------------------------*/
int
@@ -441,8 +442,8 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
hsize_t size_chunk = 1;
hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */
- hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */
- hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */
+ hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimensions */
+ hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimensions */
hsize_t hslab_nbytes; /* size of hyperslab in byte */
int ret_value = 0;
@@ -467,18 +468,18 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
/* 1. if a chunk fit in hyperslab buffer */
if (nchunk_fit >= 1) {
- /* Calulate a hyperslab that contains as many chunks that can fit
+ /* Calculate a hyperslab that contains as many chunks that can fit
* in hyperslab buffer. Hyperslab will be increased starting from
- * the last dimention of the dataset (see h5dump's dims output).
+ * the last dimension of the dataset (see h5dump's dims output).
* The calculation boundary is dataset dims.
* In the loop, used mapping from a datum to a chunk to figure out
* chunk based hyperslab.
*/
for (k = rank_dset; k > 0; --k) {
- /* map dataset dimentions with a chunk dims */
+ /* map dataset dimensions with a chunk dims */
chunk_dims_map[k - 1] = dims_dset[k - 1] / dims_chunk[k - 1];
- /* if reminder exist, increse by 1 to cover partial edge chunks */
+ /* if reminder exist, increase by 1 to cover partial edge chunks */
if (dims_dset[k - 1] % dims_chunk[k - 1] > 0)
chunk_dims_map[k - 1]++;
@@ -491,7 +492,7 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
if (nchunk_fit == 0)
nchunk_fit = 1;
- /* get hyperslab dimentions as unmapping to actual size */
+ /* get hyperslab dimensions as unmapping to actual size */
dims_hslab[k - 1] = MIN((hs_dims_map[k - 1] * dims_chunk[k - 1]), dims_dset[k - 1]);
/* calculate total size for the hyperslab */
@@ -500,9 +501,9 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
}
/* 2. if a chunk is bigger than hyperslab buffer */
else {
- /* Calulate a hyperslab that contains as many data elements that
+ /* Calculate a hyperslab that contains as many data elements that
* can fit in hyperslab buffer. Hyperslab will be increased
- * starting from the last dimention of the chunk (see h5dump's dims
+ * starting from the last dimension of the chunk (see h5dump's dims
* output).
* The calculation boundary is a chunk dims.
*/
@@ -512,7 +513,7 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
/* if a datum is bigger than rest of buffer */
if (ndatum_fit == 0)
ndatum_fit = 1;
- /* get hyperslab dimentions within a chunk boundary */
+ /* get hyperslab dimensions within a chunk boundary */
dims_hslab[k - 1] = MIN(dims_chunk[k - 1], ndatum_fit);
/* calculate total size for the hyperslab */
@@ -525,9 +526,9 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
}
/* 3. if dataset is not chunked */
else {
- /* Calulate a hyperslab that contains as many data elements that can
+ /* Calculate a hyperslab that contains as many data elements that can
* fit in hyperslab buffer. Hyperslab will be increased starting from
- * the last dimention of the dataset (see h5dump's dims output).
+ * the last dimension of the dataset (see h5dump's dims output).
* The calculation boundary is dataset dims.
*/
for (k = rank_dset; k > 0; --k) {
@@ -536,7 +537,7 @@ get_hyperslab(hid_t dcpl_id, int rank_dset, const hsize_t dims_dset[], size_t si
/* if a datum is bigger than rest of buffer */
if (ndatum_fit == 0)
ndatum_fit = 1;
- /* get hyperslab dimentions within dataset boundary */
+ /* get hyperslab dimensions within dataset boundary */
dims_hslab[k - 1] = MIN(dims_dset[k - 1], ndatum_fit);
/* calculate total size for the hyperslab */
@@ -600,7 +601,7 @@ done:
* in (2) is that, when using the strip mine size, it assures that the "remaining" part
* of the dataset that does not fill an entire strip mine is processed.
*
- * 1. figure out a hyperslab (dimentions) and size (refer to get_hyperslab()).
+ * 1. figure out a hyperslab (dimensions) and size (refer to get_hyperslab()).
* 2. Calculate the hyperslab selections as the selection is moving forward.
* Selection would be same as the hyperslab except for the remaining edge portion
* of the dataset. The code take care of the remaining portion if exist.
@@ -643,6 +644,10 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
int req_filter; /* there was a request for a filter */
int req_obj_layout = 0; /* request layout to current object */
unsigned crt_order_flags; /* group creation order flag */
+ H5_timer_t timer; /* Timer for read/write operations */
+ H5_timevals_t times; /* Elapsed time for each operation */
+ static double read_time = 0;
+ static double write_time = 0;
h5tool_link_info_t linkinfo;
unsigned i;
unsigned u;
@@ -661,7 +666,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
- if (options->verbose) {
+ if (options->verbose == 2) {
+ HDprintf("-----------------------------------------------------------------\n");
+ HDprintf(" Type Filter (Compression) Timing read/write Name\n");
+ HDprintf("-----------------------------------------------------------------\n");
+ }
+ else {
HDprintf("-----------------------------------------\n");
HDprintf(" Type Filter (Compression) Name\n");
HDprintf("-----------------------------------------\n");
@@ -682,7 +692,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_GROUP:
- if (options->verbose)
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "group", travt->objs[i].name);
+ else
HDprintf(FORMAT_OBJ, "group", travt->objs[i].name);
/* open input group */
@@ -749,6 +761,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
case H5TRAV_TYPE_DATASET: {
hbool_t use_h5ocopy;
+ read_time = 0.0;
+ write_time = 0.0;
+
has_filter = 0;
req_filter = 0;
@@ -972,7 +987,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
H5P_DEFAULT, dcpl_out, H5P_DEFAULT);
if (dset_out == H5I_INVALID_HID) {
H5TOOLS_INFO("H5Dcreate2 failed");
- if (options->verbose)
+ if (options->verbose > 0)
HDprintf(" warning: could not create dataset <%s>. Applying original "
"settings\n",
travt->objs[i].name);
@@ -1013,11 +1028,27 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
}
if (buf != NULL) {
+ if (options->verbose == 2) {
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) <
0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ read_time += times.elapsed;
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ write_time += times.elapsed;
+ }
/* Check if we have VL data in the dataset's
* datatype that must be reclaimed */
@@ -1115,12 +1146,28 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
hs_select_nelmts = 1;
} /* end (else) rank == 0 */
+ if (options->verbose == 2) {
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Dread(dset_in, wtype_id, hslab_space, f_space_id,
H5P_DEFAULT, hslab_buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dread failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ read_time += times.elapsed;
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, dxpl_id,
hslab_buf) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ write_time += times.elapsed;
+ }
/* reclaim any VL memory, if necessary */
if (vl_data)
@@ -1149,7 +1196,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
* print amount of compression used
*-------------------------------------------------------------------------
*/
- if (options->verbose) {
+ if (options->verbose > 0) {
double ratio = 0;
/* only print the compression ration if there was a filter request */
@@ -1160,10 +1207,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
/* compression ratio = uncompressed size / compressed size */
if (dsize_out != 0)
ratio = (double)dsize_in / (double)dsize_out;
- print_dataset_info(dcpl_out, travt->objs[i].name, ratio, 1);
+ print_dataset_info(dcpl_out, travt->objs[i].name, ratio, 1, options,
+ read_time, write_time);
}
else
- print_dataset_info(dcpl_in, travt->objs[i].name, ratio, 0);
+ print_dataset_info(dcpl_in, travt->objs[i].name, ratio, 0, options,
+ read_time, write_time);
/* print a message that the filter was not applied
* (in case there was a filter)
@@ -1220,6 +1269,10 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (H5Pset_copy_object(ocpl_id, H5O_COPY_WITHOUT_ATTR_FLAG) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Pset_copy_object failed");
+ if (options->verbose == 2) {
+ H5_timer_init(&timer);
+ H5_timer_start(&timer);
+ }
if (H5Ocopy(fidin, /* Source file or group identifier */
travt->objs[i].name, /* Name of the source object to be copied */
fidout, /* Destination file or group identifier */
@@ -1227,6 +1280,11 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
ocpl_id, /* Properties which apply to the copy */
H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */
H5TOOLS_GOTO_ERROR((-1), "H5Ocopy failed");
+ if (options->verbose == 2) {
+ H5_timer_stop(&timer);
+ H5_timer_get_times(timer, &times);
+ write_time += times.elapsed;
+ }
if (H5Pclose(ocpl_id) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Pclose failed");
@@ -1247,7 +1305,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (H5Dclose(dset_out) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Dclose failed");
- if (options->verbose)
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_TIME, "dset", 0.0, write_time, travt->objs[i].name);
+ else
HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
} /* end whether we have request for filter/chunking */
@@ -1260,7 +1320,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*-------------------------------------------------------------------------
*/
case H5TRAV_TYPE_NAMED_DATATYPE:
- if (options->verbose)
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "type", travt->objs[i].name);
+ else
HDprintf(FORMAT_OBJ, "type", travt->objs[i].name);
if ((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
@@ -1300,7 +1362,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
*/
case H5TRAV_TYPE_LINK:
case H5TRAV_TYPE_UDLINK:
- if (options->verbose)
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "link", travt->objs[i].name);
+ else
HDprintf(FORMAT_OBJ, "link", travt->objs[i].name);
/* Check -X option. */
@@ -1425,7 +1489,8 @@ done:
*-------------------------------------------------------------------------
*/
static void
-print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
+print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_t *options, double read_time,
+ double write_time)
{
char strfilter[255];
#if defined(PRINT_DEBUG)
@@ -1514,7 +1579,10 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
} /* end for each filter */
if (!pr)
- HDprintf(FORMAT_OBJ, "dset", objname);
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_TIME, "dset", read_time, write_time, objname);
+ else
+ HDprintf(FORMAT_OBJ, "dset", objname);
else {
char str[512], temp[512];
@@ -1522,7 +1590,10 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr)
HDstrcat(str, strfilter);
HDsprintf(temp, " (%.3f:1)", ratio);
HDstrcat(str, temp);
- HDprintf(FORMAT_OBJ, str, objname);
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_TIME, str, read_time, write_time, objname);
+ else
+ HDprintf(FORMAT_OBJ, str, objname);
}
} /* end print_dataset_info() */
@@ -1550,7 +1621,7 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size)
/* Copy the userblock from the input file to the output file */
while (size > 0) {
- ssize_t nread, nbytes; /* # of bytes transfered, etc. */
+ ssize_t nread, nbytes; /* # of bytes transferred, etc. */
char rbuf[USERBLOCK_XFER_SIZE]; /* Buffer for reading */
const char *wbuf; /* Pointer into buffer, for writing */
diff --git a/tools/src/h5repack/h5repack_filters.c b/tools/src/h5repack/h5repack_filters.c
index 32476ce..76bac5e 100644
--- a/tools/src/h5repack/h5repack_filters.c
+++ b/tools/src/h5repack/h5repack_filters.c
@@ -231,7 +231,7 @@ aux_assign_obj(const char * name, /* object name from traverse list */
* do extra checking in the case of SZIP; delete all filters in the case
* of H5Z_FILTER_NONE present in the PACK_INFO_T filter array
*
- * Return: 0 success, -1 an error occured
+ * Return: 0 success, -1 an error occurred
*-------------------------------------------------------------------------
*/
@@ -258,7 +258,7 @@ apply_filters(const char * name, /* object name from traverse list */
H5TOOLS_GOTO_DONE(0);
/*-------------------------------------------------------------------------
- * initialize the assigment object
+ * initialize the assignment object
*-------------------------------------------------------------------------
*/
init_packobject(&obj);
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 3526268..a805b3d 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -18,7 +18,7 @@
/* Name of tool */
#define PROGRAMNAME "h5repack"
-static int parse_command_line(int argc, const char **argv, pack_opt_t *options);
+static int parse_command_line(int argc, const char *const *argv, pack_opt_t *options);
static void leave(int ret) H5_ATTR_NORETURN;
/* module-scoped variables */
@@ -31,7 +31,7 @@ const char *outfile = NULL;
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:";
+static const char *s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:v*z:E*G:LM:P:S:T:VXWY:Z:1:2:3:4:5:6:7:8:9:0:";
static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'},
{"block", require_arg, 'b'},
{"compact", require_arg, 'c'},
@@ -39,20 +39,20 @@ static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'},
{"file", require_arg, 'e'},
{"filter", require_arg, 'f'},
{"help", no_arg, 'h'},
- {"infile", require_arg, 'i'}, /* for backward compability */
+ {"infile", require_arg, 'i'}, /* for backward compatibility */
{"low", require_arg, 'j'},
{"high", require_arg, 'k'},
{"layout", require_arg, 'l'},
{"minimum", require_arg, 'm'},
{"native", no_arg, 'n'},
- {"outfile", require_arg, 'o'}, /* for backward compability */
+ {"outfile", require_arg, 'o'}, /* for backward compatibility */
{"sort_by", require_arg, 'q'},
{"ssize", require_arg, 's'},
{"threshold", require_arg, 't'},
{"ublock", require_arg, 'u'},
- {"verbose", no_arg, 'v'},
+ {"verbose", optional_arg, 'v'},
{"sort_order", require_arg, 'z'},
- {"enable-error-stack", no_arg, 'E'},
+ {"enable-error-stack", optional_arg, 'E'},
{"fs_pagesize", require_arg, 'G'},
{"latest", no_arg, 'L'},
{"metadata_block_size", require_arg, 'M'},
@@ -68,6 +68,12 @@ static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'},
{"dst-vol-value", require_arg, '4'},
{"dst-vol-name", require_arg, '5'},
{"dst-vol-info", require_arg, '6'},
+ {"src-vfd-value", require_arg, '7'},
+ {"src-vfd-name", require_arg, '8'},
+ {"src-vfd-info", require_arg, '9'},
+ {"dst-vfd-value", require_arg, '0'},
+ {"dst-vfd-name", require_arg, 'Y'},
+ {"dst-vfd-info", require_arg, 'Z'},
{NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
@@ -86,15 +92,18 @@ usage(const char *prog)
PRINTSTREAM(rawoutstream, "usage: %s [OPTIONS] file1 file2\n", prog);
PRINTVALSTREAM(rawoutstream, " file1 Input HDF5 File\n");
PRINTVALSTREAM(rawoutstream, " file2 Output HDF5 File\n");
+ PRINTVALSTREAM(rawoutstream, " ERROR\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --enable-error-stack Prints messages from the HDF5 error stack as they occur.\n");
+ PRINTVALSTREAM(rawoutstream,
+ " Optional value 2 also prints file open errors.\n");
PRINTVALSTREAM(rawoutstream, " OPTIONS\n");
PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n");
- PRINTVALSTREAM(rawoutstream, " -v, --verbose Verbose mode, print object information\n");
+ PRINTVALSTREAM(rawoutstream, " -v N, --verbose=N Verbose mode, print object information.\n");
+ PRINTVALSTREAM(rawoutstream, " N - is an integer greater than 1, 2 displays read/write timing\n");
PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
PRINTVALSTREAM(rawoutstream, " -n, --native Use a native HDF5 type when repacking\n");
PRINTVALSTREAM(rawoutstream,
- " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- PRINTVALSTREAM(rawoutstream, " occur\n");
- PRINTVALSTREAM(rawoutstream,
" --src-vol-value Value (ID) of the VOL connector to use for opening the\n");
PRINTVALSTREAM(rawoutstream, " input HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream,
@@ -112,6 +121,24 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream,
" --dst-vol-info VOL-specific info to pass to the VOL connector used for\n");
PRINTVALSTREAM(rawoutstream, " opening the output HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --src-vfd-value Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " input HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --src-vfd-name Name of the VFL driver to use for opening the input\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --src-vfd-info VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the input HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --dst-vfd-value Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " output HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --dst-vfd-name Name of the VFL driver to use for opening the output\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --dst-vfd-info VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the output HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream, " -L, --latest Use latest version of file format\n");
PRINTVALSTREAM(rawoutstream,
" This option will take precedence over the options\n");
@@ -374,7 +401,7 @@ read_info(const char *filename, pack_opt_t *options)
goto done;
}
- /* find begining of info */
+ /* find beginning of info */
i = 0;
c = '0';
while (c != ' ') {
@@ -482,19 +509,25 @@ set_sort_order(const char *form)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char **argv, pack_opt_t *options)
+parse_command_line(int argc, const char *const *argv, pack_opt_t *options)
{
h5tools_vol_info_t in_vol_info;
h5tools_vol_info_t out_vol_info;
- hbool_t custom_in_fapl = FALSE;
- hbool_t custom_out_fapl = FALSE;
- hid_t tmp_fapl = H5I_INVALID_HID;
+ h5tools_vfd_info_t in_vfd_info;
+ h5tools_vfd_info_t out_vfd_info;
+ hbool_t custom_in_vol = FALSE;
+ hbool_t custom_in_vfd = FALSE;
+ hbool_t custom_out_vol = FALSE;
+ hbool_t custom_out_vfd = FALSE;
+ hid_t tmp_fapl = H5I_INVALID_HID;
int bound, opt;
int ret_value = 0;
/* Initialize fapl info structs */
HDmemset(&in_vol_info, 0, sizeof(h5tools_vol_info_t));
HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t));
+ HDmemset(&in_vfd_info, 0, sizeof(h5tools_vfd_info_t));
+ HDmemset(&out_vfd_info, 0, sizeof(h5tools_vfd_info_t));
/* parse command line options */
while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) {
@@ -525,7 +558,12 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
goto done;
case 'v':
- options->verbose = 1;
+ if (H5_optarg != NULL) {
+ if (2 == HDatoi(H5_optarg))
+ options->verbose = 2;
+ }
+ else
+ options->verbose = 1;
break;
case 'f':
@@ -665,7 +703,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case 'a':
options->alignment = HDstrtoull(H5_optarg, NULL, 0);
if (options->alignment < 1) {
- error_msg("invalid alignment size\n", H5_optarg);
+ error_msg("invalid alignment size `%s`\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -685,7 +723,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
else if (!HDstrcmp(strategy, "NONE"))
options->fs_strategy = H5F_FSPACE_STRATEGY_NONE;
else {
- error_msg("invalid file space management strategy\n", H5_optarg);
+ error_msg("invalid file space management strategy `%s`\n", H5_optarg);
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
goto done;
@@ -735,19 +773,22 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
break;
case 'E':
- enable_error_stack = 1;
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
+ else
+ enable_error_stack = 1;
break;
case '1':
in_vol_info.type = VOL_BY_VALUE;
in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
- custom_in_fapl = TRUE;
+ custom_in_vol = TRUE;
break;
case '2':
in_vol_info.type = VOL_BY_NAME;
in_vol_info.u.name = H5_optarg;
- custom_in_fapl = TRUE;
+ custom_in_vol = TRUE;
break;
case '3':
@@ -757,19 +798,51 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
case '4':
out_vol_info.type = VOL_BY_VALUE;
out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
- custom_out_fapl = TRUE;
+ custom_out_vol = TRUE;
break;
case '5':
out_vol_info.type = VOL_BY_NAME;
out_vol_info.u.name = H5_optarg;
- custom_out_fapl = TRUE;
+ custom_out_vol = TRUE;
break;
case '6':
out_vol_info.info_string = H5_optarg;
break;
+ case '7':
+ in_vfd_info.type = VFD_BY_VALUE;
+ in_vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ custom_in_vfd = TRUE;
+ break;
+
+ case '8':
+ in_vfd_info.type = VFD_BY_NAME;
+ in_vfd_info.u.name = H5_optarg;
+ custom_in_vfd = TRUE;
+ break;
+
+ case '9':
+ in_vfd_info.info = (const void *)H5_optarg;
+ break;
+
+ case '0':
+ out_vfd_info.type = VFD_BY_VALUE;
+ out_vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ custom_out_vfd = TRUE;
+ break;
+
+ case 'Y':
+ out_vfd_info.type = VFD_BY_NAME;
+ out_vfd_info.u.name = H5_optarg;
+ custom_out_vfd = TRUE;
+ break;
+
+ case 'Z':
+ out_vfd_info.info = (const void *)H5_optarg;
+ break;
+
default:
break;
} /* end switch */
@@ -803,8 +876,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
}
/* Setup FAPL for input and output file accesses */
- if (custom_in_fapl) {
- if ((tmp_fapl = h5tools_get_fapl(options->fin_fapl, &in_vol_info, NULL)) < 0) {
+ if (custom_in_vol || custom_in_vfd) {
+ if ((tmp_fapl = h5tools_get_fapl(options->fin_fapl, custom_in_vol ? &in_vol_info : NULL,
+ custom_in_vfd ? &in_vfd_info : NULL)) < 0) {
error_msg("failed to setup FAPL for input file\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -823,8 +897,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options)
options->fin_fapl = tmp_fapl;
}
- if (custom_out_fapl) {
- if ((tmp_fapl = h5tools_get_fapl(options->fout_fapl, &out_vol_info, NULL)) < 0) {
+ if (custom_out_vol || custom_out_vfd) {
+ if ((tmp_fapl = h5tools_get_fapl(options->fout_fapl, custom_out_vol ? &out_vol_info : NULL,
+ custom_out_vfd ? &out_vfd_info : NULL)) < 0) {
error_msg("failed to setup FAPL for output file\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = -1;
@@ -858,7 +933,7 @@ done:
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char **argv)
+main(int argc, char **argv)
{
pack_opt_t options; /*the global options */
int parse_ret;
@@ -888,7 +963,7 @@ main(int argc, const char **argv)
/* Initialize default indexing options */
sort_by = H5_INDEX_CRT_ORDER;
- parse_ret = parse_command_line(argc, argv, &options);
+ parse_ret = parse_command_line(argc, (const char *const *)argv, &options);
if (parse_ret < 0) {
HDprintf("Error occurred while parsing command-line options\n");
h5tools_setstatus(EXIT_FAILURE);
diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c
index 6191624..3259b89 100644
--- a/tools/src/h5repack/h5repack_refs.c
+++ b/tools/src/h5repack/h5repack_refs.c
@@ -182,8 +182,11 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
/* create the reference, -1 parameter for objects */
if (H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Rcreate failed");
- if (options->verbose) {
- HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
+ if (options->verbose > 0) {
+ if (options->verbose == 2)
+ HDprintf(FORMAT_OBJ_NOTIME, "dset", travt->objs[i].name);
+ else
+ HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
HDprintf("object <%s> object reference created to <%s>\n",
travt->objs[i].name, refname);
}
@@ -276,7 +279,7 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
H5TOOLS_GOTO_ERROR((-1), "H5Rcreate failed");
if (H5Sclose(region_id) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Sclose failed");
- if (options->verbose) {
+ if (options->verbose > 0) {
HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name);
HDprintf("object <%s> region reference created to <%s>\n",
travt->objs[i].name, refname);
@@ -536,7 +539,7 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) /
}
/* This line below needs to be moved in this loop instead of inserting outside. Otherwise,
ref_comp_field_n may be >0 for the next attribute, which may not be
- the reference type and will be accidently treated as the reference type.
+ the reference type and will be accidentally treated as the reference type.
It will then cause the H5Acreate2 failed since that attribute is already created.
KY 2020-02-07
*/
diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c
index 0542d03..71ee72e 100644
--- a/tools/src/h5repack/h5repack_verify.c
+++ b/tools/src/h5repack/h5repack_verify.c
@@ -378,11 +378,11 @@ h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t
*-------------------------------------------------------------------------
*/
/* Open the files */
- if ((fid1 = h5tools_fopen(fname1, H5F_ACC_RDONLY, fname1_fapl,
- (fname1_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0)
+ if ((fid1 = h5tools_fopen(fname1, H5F_ACC_RDONLY, fname1_fapl, (fname1_fapl != H5P_DEFAULT), NULL, 0)) <
+ 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
- if ((fid2 = h5tools_fopen(fname2, H5F_ACC_RDONLY, fname2_fapl,
- (fname2_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0)
+ if ((fid2 = h5tools_fopen(fname2, H5F_ACC_RDONLY, fname2_fapl, (fname2_fapl != H5P_DEFAULT), NULL, 0)) <
+ 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
/*-------------------------------------------------------------------------
@@ -397,7 +397,7 @@ h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t
H5TOOLS_GOTO_ERROR((-1), "h5trav_gettable failed");
/*-------------------------------------------------------------------------
- * traverse the suppplied object list
+ * traverse the supplied object list
*-------------------------------------------------------------------------
*/
for (i = 0; i < trav->nobjs; i++) {
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index efc80b6..e42af10 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -33,7 +33,7 @@
#define H5_NFILTERS_IMPL \
8 /* Number of currently implemented filters + one to \
accommodate for user-define filters + one \
- to accomodate datasets whithout any filters */
+ to accommodate datasets without any filters */
/* File space management strategies: see H5Fpublic.h for declarations */
const char *FS_STRATEGY_NAME[] = {"H5F_FSPACE_STRATEGY_FSM_AGGR",
@@ -169,7 +169,7 @@ struct handler_t {
char **obj;
};
-static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:";
+static const char *s_opts = "Aa:Ddm:E*FfhGgl:sSTO:Vw:H:";
/* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */
static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"filemetadata", no_arg, 'F'},
@@ -181,7 +181,7 @@ static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"object", require_arg, 'O'},
{"version", no_arg, 'V'},
{"attribute", no_arg, 'A'},
- {"enable-error-stack", no_arg, 'E'},
+ {"enable-error-stack", optional_arg, 'E'},
{"numattrs", require_arg, 'a'},
{"freespace", no_arg, 's'},
{"summary", no_arg, 'S'},
@@ -211,6 +211,9 @@ usage(const char *prog)
HDfflush(stdout);
HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog);
HDfprintf(stdout, "\n");
+ HDfprintf(stdout, " ERROR\n");
+ HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
+ HDfprintf(stdout, " Optional value 2 also prints file open errors\n");
HDfprintf(stdout, " OPTIONS\n");
HDfprintf(stdout, " -h, --help Print a usage message and exit\n");
HDfprintf(stdout, " -V, --version Print version number and exit\n");
@@ -235,7 +238,6 @@ usage(const char *prog)
HDfprintf(stdout, " than 0. The default threshold is 10.\n");
HDfprintf(stdout, " -s, --freespace Print free space information\n");
HDfprintf(stdout, " -S, --summary Print summary of file space information\n");
- HDfprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they occur\n");
HDfprintf(stdout, " --s3-cred=<cred> Access file on S3, using provided credential\n");
HDfprintf(stdout, " <cred> :: (region,id,key)\n");
HDfprintf(stdout, " If <cred> == \"(,,)\", no authentication is used.\n");
@@ -830,7 +832,7 @@ hand_free(struct handler_t *hand)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
+parse_command_line(int argc, const char *const *argv, struct handler_t **hand_ret)
{
int opt;
unsigned u;
@@ -852,7 +854,10 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret)
break;
case 'E':
- enable_error_stack = 1;
+ if (H5_optarg != NULL)
+ enable_error_stack = HDatoi(H5_optarg);
+ else
+ enable_error_stack = 1;
break;
case 'F':
@@ -1677,7 +1682,7 @@ print_statistics(const char *name, const iter_t *iter)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
iter_t iter;
const char * fname = NULL;
@@ -1693,7 +1698,7 @@ main(int argc, const char *argv[])
HDmemset(&iter, 0, sizeof(iter));
- if (parse_command_line(argc, argv, &hand) < 0)
+ if (parse_command_line(argc, (const char *const *)argv, &hand) < 0)
goto done;
/* enable error reporting if command line option */
@@ -1702,25 +1707,9 @@ main(int argc, const char *argv[])
if (drivername) {
h5tools_vfd_info_t vfd_info;
- vfd_info.info = NULL;
- vfd_info.name = drivername;
-
- if (!HDstrcmp(drivername, drivernames[ROS3_VFD_IDX])) {
-#ifdef H5_HAVE_ROS3_VFD
- vfd_info.info = (void *)&ros3_fa;
-#else
- error_msg("Read-Only S3 VFD not enabled.\n");
- goto done;
-#endif
- }
- else if (!HDstrcmp(drivername, drivernames[HDFS_VFD_IDX])) {
-#ifdef H5_HAVE_LIBHDFS
- vfd_info.info = (void *)&hdfs_fa;
-#else
- error_msg("HDFS VFD not enabled.\n");
- goto done;
-#endif
- }
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.info = NULL;
+ vfd_info.u.name = drivername;
if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &vfd_info)) < 0) {
error_msg("Unable to create FAPL for file access\n");
@@ -1737,7 +1726,7 @@ main(int argc, const char *argv[])
HDprintf("Filename: %s\n", fname);
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0);
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id != H5P_DEFAULT), NULL, 0);
if (fid < 0) {
error_msg("unable to open file \"%s\"\n", fname);
@@ -1752,7 +1741,7 @@ main(int argc, const char *argv[])
warn_msg("Unable to retrieve file size\n");
HDassert(iter.filesize != 0);
- /* Get storge info for file-level structures */
+ /* Get storage info for file-level structures */
if (H5Fget_info2(fid, &finfo) < 0)
warn_msg("Unable to retrieve file info\n");
else {
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index face2f0..15c170d 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -109,7 +109,7 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char **argv)
+parse_command_line(int argc, const char *const *argv)
{
int opt;
@@ -224,7 +224,7 @@ leave(int ret)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
char * fname = NULL; /* File name */
hid_t fapl = H5I_INVALID_HID; /* File access property list */
@@ -240,7 +240,7 @@ main(int argc, const char *argv[])
h5tools_init();
/* Parse command line options */
- if (parse_command_line(argc, argv) < 0)
+ if (parse_command_line(argc, (const char *const *)argv) < 0)
goto done;
if (fname_g == NULL)
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 72f47cb..e03c72d 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -647,7 +647,7 @@ main(int argc, char *argv[])
}
else if (!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray header.
+ * Debug an extensible array header.
*/
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -668,7 +668,7 @@ main(int argc, char *argv[])
}
else if (!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray index block.
+ * Debug an extensible array index block.
*/
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -689,7 +689,7 @@ main(int argc, char *argv[])
}
else if (!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray super block.
+ * Debug an extensible array super block.
*/
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -709,7 +709,7 @@ main(int argc, char *argv[])
}
else if (!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray data block.
+ * Debug an extensible array data block.
*/
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
diff --git a/tools/src/misc/h5delete.c b/tools/src/misc/h5delete.c
index 3c4f8d5..20e81a1 100644
--- a/tools/src/misc/h5delete.c
+++ b/tools/src/misc/h5delete.c
@@ -29,7 +29,7 @@ usage(void)
}
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hbool_t quiet = FALSE;
const char *name = NULL;
diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c
index a85ee4d..1b8b23d 100644
--- a/tools/src/misc/h5mkgrp.c
+++ b/tools/src/misc/h5mkgrp.c
@@ -26,7 +26,8 @@ static const char * s_opts = "hlpvV";
static struct h5_long_options l_opts[] = {
{"help", no_arg, 'h'}, {"latest", no_arg, 'l'}, {"parents", no_arg, 'p'},
{"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, {"vol-value", require_arg, '1'},
- {"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {NULL, 0, '\0'}};
+ {"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {"vfd-value", require_arg, '4'},
+ {"vfd-name", require_arg, '5'}, {"vfd-info", require_arg, '6'}, {NULL, 0, '\0'}};
/* Command line parameter settings */
typedef struct mkgrp_opt_t {
@@ -105,6 +106,14 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream,
" --vol-info VOL-specific info to pass to the VOL connector used for\n");
PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-value Value (ID) of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream, " --vfd-name Name of the VFL driver to use for opening the\n");
+ PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n");
+ PRINTVALSTREAM(rawoutstream,
+ " --vfd-info VFD-specific info to pass to the VFL driver used for\n");
+ PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n");
PRINTVALSTREAM(rawoutstream, "\n");
} /* end usage() */
@@ -122,12 +131,14 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
static int
-parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
+parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options)
{
int opt; /* Option from command line */
size_t curr_group; /* Current group name to copy */
- hbool_t custom_fapl = FALSE;
+ hbool_t custom_vol = FALSE;
+ hbool_t custom_vfd = FALSE;
h5tools_vol_info_t vol_info;
+ h5tools_vfd_info_t vfd_info;
hid_t tmp_fapl_id = H5I_INVALID_HID;
/* Check for empty command line */
@@ -136,8 +147,9 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
leave(EXIT_SUCCESS);
}
- /* Initialize fapl info struct */
+ /* Initialize fapl info structs */
HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t));
+ HDmemset(&vfd_info, 0, sizeof(h5tools_vfd_info_t));
/* Parse command line options */
while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) {
@@ -172,19 +184,35 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
case '1':
vol_info.type = VOL_BY_VALUE;
vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg);
- custom_fapl = TRUE;
+ custom_vol = TRUE;
break;
case '2':
vol_info.type = VOL_BY_NAME;
vol_info.u.name = H5_optarg;
- custom_fapl = TRUE;
+ custom_vol = TRUE;
break;
case '3':
vol_info.info_string = H5_optarg;
break;
+ case '4':
+ vfd_info.type = VFD_BY_VALUE;
+ vfd_info.u.value = (H5FD_class_value_t)HDatoi(H5_optarg);
+ custom_vfd = TRUE;
+ break;
+
+ case '5':
+ vfd_info.type = VFD_BY_NAME;
+ vfd_info.u.name = H5_optarg;
+ custom_vfd = TRUE;
+ break;
+
+ case '6':
+ vfd_info.info = (const void *)H5_optarg;
+ break;
+
/* Bad command line argument */
default:
usage(h5tools_getprogname());
@@ -223,8 +251,9 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
}
/* Setup a custom fapl for file accesses */
- if (custom_fapl) {
- if ((tmp_fapl_id = h5tools_get_fapl(options->fapl_id, &vol_info, NULL)) < 0) {
+ if (custom_vol || custom_vfd) {
+ if ((tmp_fapl_id = h5tools_get_fapl(options->fapl_id, custom_vol ? &vol_info : NULL,
+ custom_vfd ? &vfd_info : NULL)) < 0) {
error_msg("failed to setup file access property list (fapl) for file\n");
leave(EXIT_FAILURE);
}
@@ -252,7 +281,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
hid_t fid = H5I_INVALID_HID; /* HDF5 file ID */
hid_t lcpl_id = H5I_INVALID_HID; /* Link creation property list ID */
@@ -274,7 +303,7 @@ main(int argc, const char *argv[])
}
/* Parse command line */
- if (parse_command_line(argc, argv, &params_g) < 0) {
+ if (parse_command_line(argc, (const char *const *)argv, &params_g) < 0) {
error_msg("unable to parse command line arguments\n");
leave(EXIT_FAILURE);
}
@@ -296,7 +325,8 @@ main(int argc, const char *argv[])
}
/* Attempt to open an existing HDF5 file first */
- fid = h5tools_fopen(params_g.fname, H5F_ACC_RDWR, params_g.fapl_id, FALSE, NULL, 0);
+ fid = h5tools_fopen(params_g.fname, H5F_ACC_RDWR, params_g.fapl_id, (params_g.fapl_id != H5P_DEFAULT),
+ NULL, 0);
/* If we couldn't open an existing file, try creating file */
/* (use "EXCL" instead of "TRUNC", so we don't blow away existing non-HDF5 file) */
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index e9b36fe..154ca15 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -211,7 +211,7 @@
endmacro ()
#
- # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target
+ # Similar to ADD_H5_TEST macro. Compare to outputs from source & target
# files instead of checking with h5ls.
#
macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname)
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 6898839..e415c97 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -618,7 +618,7 @@ gen_region_ref(hid_t loc_id)
goto out;
}
- /* create normal dataset which is refered */
+ /* create normal dataset which is referred */
oid2 = H5Dcreate2(loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid2 < 0) {
HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
@@ -923,7 +923,7 @@ out:
/*-------------------------------------------------------------------------
* Function: Test_Extlink_Copy
*
- * Purpose: gerenate external link files
+ * Purpose: generate external link files
*
*------------------------------------------------------------------------*/
static void
diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in
index 79b6fd5..6349ef4 100644
--- a/tools/test/h5copy/testh5copy.sh.in
+++ b/tools/test/h5copy/testh5copy.sh.in
@@ -88,7 +88,7 @@ test -d $TESTDIR || mkdir $TESTDIR
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index 4fcfa26..8e01605 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -1278,7 +1278,7 @@ ADD_H5_TEST (h5diff_208 0 -c ${FILE19} ${FILE20})
ADD_H5_TEST (h5diff_220 1 -c non_comparables1.h5 non_comparables2.h5 /g1)
# comparable dataset with non-comparable attribute and other comparable attributes.
-# Also test non-compatible attributes with different type, dimention, rank.
+# Also test non-compatible attributes with different type, dimension, rank.
# All the rest comparables should display differences.
ADD_H5_TEST (h5diff_221 1 -c non_comparables1.h5 non_comparables2.h5 /g2)
@@ -1438,7 +1438,7 @@ ADD_H5_TEST (h5diff_475 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_
# ##############################################################################
-# # test for group diff recursivly
+# # test for group diff recursively
# ##############################################################################
# root
ADD_H5_TEST (h5diff_500 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /)
diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in
index 0ab169a..28f723e 100644
--- a/tools/test/h5diff/h5diff_plugin.sh.in
+++ b/tools/test/h5diff/h5diff_plugin.sh.in
@@ -158,7 +158,7 @@ done
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
@@ -236,7 +236,7 @@ TOOLTEST() {
# don't add exit code check in pmode, as it causes failure. (exit code
# is from mpirun not tool)
# if any problem occurs relate to an exit code, it will be caught in
- # serial mode, so the test is fullfilled.
+ # serial mode, so the test is fulfilled.
if test $h5haveexitcode = 'yes' -a -z "$pmode"; then
echo "EXIT CODE: $EXIT_CODE" >> $actual
fi
@@ -327,7 +327,7 @@ TOOLTEST_ERR() {
# don't add exit code check in pmode, as it causes failure. (exit code
# is from mpirun not tool)
# if any problem occurs relate to an exit code, it will be caught in
- # serial mode, so the test is fullfilled.
+ # serial mode, so the test is fulfilled.
if test $h5haveexitcode = 'yes' -a -z "$pmode"; then
echo "EXIT CODE: $EXIT_CODE" >> $actual
fi
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index 7f1a346..92ea16a 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -86,7 +86,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024);
#define EXCLUDE_FILE3_2 "h5diff_exclude3-2.h5"
/* compound type with multiple vlen string types */
#define COMP_VL_STRS_FILE "h5diff_comp_vl_strs.h5"
-/* attribute compre with verbose level */
+/* attribute compare with verbose level */
#define ATTR_VERBOSE_LEVEL_FILE1 "h5diff_attr_v_level1.h5"
#define ATTR_VERBOSE_LEVEL_FILE2 "h5diff_attr_v_level2.h5"
/* file containing valid/invalid enum value mix */
@@ -1151,7 +1151,6 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
write_dset(gid1, 2, dims2, "d2", H5T_NATIVE_DOUBLE, data14);
}
-#if H5_SIZEOF_LONG_DOUBLE != 0
{
/*-------------------------------------------------------------------------
@@ -1163,7 +1162,6 @@ test_basic(const char *fname1, const char *fname2, const char *fname3)
write_dset(gid1, 2, dims2, "ld", H5T_NATIVE_LDOUBLE, data15);
}
-#endif
/*-------------------------------------------------------------------------
* NaNs in H5T_NATIVE_FLOAT
@@ -3615,7 +3613,7 @@ test_group_recurse2(void)
* FILE 2-3
*------------------------------------------------------------------------*/
- /* crate target file */
+ /* create target file */
fileid4 = H5Fcreate(GRP_RECURSE2_EXT3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*-----------------------------------------------
@@ -3649,7 +3647,7 @@ test_group_recurse2(void)
* FILE 2-2
*------------------------------------------------------------------------*/
- /* crate target file */
+ /* create target file */
fileid3 = H5Fcreate(GRP_RECURSE2_EXT2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*-----------------------------------------------
@@ -3701,7 +3699,7 @@ test_group_recurse2(void)
* FILE 2-1
*------------------------------------------------------------------------*/
- /* crate target file */
+ /* create target file */
fileid2 = H5Fcreate(GRP_RECURSE2_EXT1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/*-----------------------------------------------
@@ -5567,7 +5565,7 @@ test_data_nocomparables(const char *fname, int make_diffs)
/* attr1 - non-compatible : different type */
write_attr(did2, 1, dims1_1, "attr1", tid_attr1, attr_data_ptr2);
- /* attr2 - non-compatible : same rank, different dimention */
+ /* attr2 - non-compatible : same rank, different dimension */
write_attr(did2, 1, (hsize_t *)attr2_dim_ptr, "attr2", H5T_NATIVE_INT, data3);
/* attr3 - non-compatible : different rank */
@@ -8616,7 +8614,7 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */)
* Function: test_hyperslab
*
* Purpose: test diff by hyperslabs. create a dataset with 1GB dimensions
- * by iterating trough 1KB hyperslabs
+ * by iterating through 1KB hyperslabs
*
*-------------------------------------------------------------------------
*/
diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt
index 3631db7..b1d607e 100644
--- a/tools/test/h5diff/testfiles/h5diff_10.txt
+++ b/tools/test/h5diff/testfiles/h5diff_10.txt
@@ -4,6 +4,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -22,8 +25,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -36,6 +37,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -117,7 +130,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt
index 8a4ce6d..5236964 100644
--- a/tools/test/h5diff/testfiles/h5diff_600.txt
+++ b/tools/test/h5diff/testfiles/h5diff_600.txt
@@ -4,6 +4,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -22,8 +25,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -36,6 +37,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -117,7 +130,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt
index d4c7336..e7bad17 100644
--- a/tools/test/h5diff/testfiles/h5diff_603.txt
+++ b/tools/test/h5diff/testfiles/h5diff_603.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt
index 3123587..410528d 100644
--- a/tools/test/h5diff/testfiles/h5diff_606.txt
+++ b/tools/test/h5diff/testfiles/h5diff_606.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt
index ce2d887..ffc191e 100644
--- a/tools/test/h5diff/testfiles/h5diff_612.txt
+++ b/tools/test/h5diff/testfiles/h5diff_612.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt
index 61fd036..2ff50e9 100644
--- a/tools/test/h5diff/testfiles/h5diff_615.txt
+++ b/tools/test/h5diff/testfiles/h5diff_615.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt
index dc8655d..7db4959 100644
--- a/tools/test/h5diff/testfiles/h5diff_621.txt
+++ b/tools/test/h5diff/testfiles/h5diff_621.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt
index f20ffbe..db77f88 100644
--- a/tools/test/h5diff/testfiles/h5diff_622.txt
+++ b/tools/test/h5diff/testfiles/h5diff_622.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt
index f73d202..11739be 100644
--- a/tools/test/h5diff/testfiles/h5diff_623.txt
+++ b/tools/test/h5diff/testfiles/h5diff_623.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt
index 903b738..6af9fe3 100644
--- a/tools/test/h5diff/testfiles/h5diff_624.txt
+++ b/tools/test/h5diff/testfiles/h5diff_624.txt
@@ -5,6 +5,9 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
[obj1] Name of an HDF5 object, in absolute path
[obj2] Name of an HDF5 object, in absolute path
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help
Print a usage message and exit.
@@ -23,8 +26,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
3 : All level 2 information plus file names.
-q, --quiet
Quiet mode. Do not produce output.
- --enable-error-stack
- Prints messages from the HDF5 error stack as they occur.
--vol-value-1 Value (ID) of the VOL connector to use for opening the
first HDF5 file specified
--vol-name-1 Name of the VOL connector to use for opening the first
@@ -37,6 +38,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
HDF5 file specified
--vol-info-2 VOL-specific info to pass to the VOL connector used for
opening the second HDF5 file specified
+ --vfd-value-1 Value (ID) of the VFL driver to use for opening the
+ first HDF5 file specified
+ --vfd-name-1 Name of the VFL driver to use for opening the first
+ HDF5 file specified
+ --vfd-info-1 VFD-specific info to pass to the VFL driver used for
+ opening the first HDF5 file specified
+ --vfd-value-2 Value (ID) of the VFL driver to use for opening the
+ second HDF5 file specified
+ --vfd-name-2 Name of the VFL driver to use for opening the second
+ HDF5 file specified
+ --vfd-info-2 VFD-specific info to pass to the VFL driver used for
+ opening the second HDF5 file specified
--follow-symlinks
Follow symbolic links (soft links and external links and compare the)
links' target objects.
@@ -118,7 +131,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
This option can be used repeatedly to exclude multiple paths.
Modes of output:
- Default mode: print the number of differences found and where they occured
+ Default mode: print the number of differences found and where they occurred
-r Report mode: print the above plus the differences
-v Verbose mode: print the above plus a list of objects and warnings
-q Quiet mode: do not print output
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index be0d3bd..093d5b9 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -464,7 +464,7 @@ done
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
@@ -527,7 +527,7 @@ TOOLTEST() {
# don't add exit code check in pmode, as it causes failure. (exit code
# is from mpirun not tool)
# if any problem occurs relate to an exit code, it will be caught in
- # serial mode, so the test is fullfilled.
+ # serial mode, so the test is fulfilled.
if test $h5haveexitcode = 'yes' -a -z "$pmode"; then
echo "EXIT CODE: $EXIT_CODE" >> $actual
fi
@@ -935,7 +935,7 @@ TOOLTEST h5diff_207.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset8 g2/dset9
TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5
# non-comparable dataset with comparable attribute, and other comparable datasets.
-# Also test non-compatible attributes with different type, dimention, rank.
+# Also test non-compatible attributes with different type, dimension, rank.
# All the comparables should display differences.
TOOLTEST h5diff_220.txt -c non_comparables1.h5 non_comparables2.h5 /g1
@@ -1098,7 +1098,7 @@ TOOLTEST h5diff_474.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_li
TOOLTEST h5diff_475.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1
# ##############################################################################
-# # test for group diff recursivly
+# # test for group diff recursively
# ##############################################################################
# root
TOOLTEST h5diff_500.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / /
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index a8984de..933aba9 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -412,7 +412,7 @@
# --------------------------------------------------------------------
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files")
- if (WIN32)
+ if (WIN32 AND CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.18362.0)
configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
#file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
#file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
@@ -863,7 +863,7 @@
# test for named data types
ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5)
ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5)
- # test for unamed type
+ # test for unnamed type
ADD_H5ERR_MASK_TEST (tcomp-3 0 "object '#6632' doesn't exist" "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5")
# test complicated compound datatype
ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5)
diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake
index 06be332..0c3297f 100644
--- a/tools/test/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/test/h5dump/CMakeTestsPBITS.cmake
@@ -158,7 +158,7 @@
# Limits:
# Maximum number of packed bits is 8 (for now).
# Maximum integer size is 8*sizeof(long long).
- # Maximun Offset is Maximum size - 1.
+ # Maximum Offset is Maximum size - 1.
# Maximum Offset+Length is Maximum size.
# Tests:
# Normal operation on both signed and unsigned int datasets.
diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake
index 01834b3..7ab8c1f 100644
--- a/tools/test/h5dump/CMakeVFDTests.cmake
+++ b/tools/test/h5dump/CMakeVFDTests.cmake
@@ -15,20 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
-
-set (VFD_H5DUMP_LIST
- sec2
- stdio
- core
- core_paged
- split
- multi
- family
-)
-
-if (H5_HAVE_DIRECT)
- set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct)
-endif ()
+H5_CREATE_VFD_DIR()
# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
@@ -37,8 +24,7 @@ set (HDF5_VFD_H5DUMP_FILES
packedbits
)
-foreach (vfdtest ${VFD_H5DUMP_LIST})
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+foreach (vfdtest ${VFD_LIST})
foreach (h5_tfile ${HDF5_VFD_H5DUMP_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.h5" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.h5" "HDF5_VFD_H5DUMP_files")
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.ddl" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.ddl" "HDF5_VFD_H5DUMP_files")
@@ -79,7 +65,7 @@ endmacro ()
##############################################################################
# Run test with different Virtual File Driver
-foreach (vfd ${VFD_H5DUMP_LIST})
+foreach (vfd ${VFD_LIST})
# test for signed/unsigned datasets
ADD_VFD_H5DUMP_TEST (${vfd} packedbits 0 --enable-error-stack packedbits.h5)
endforeach ()
diff --git a/tools/test/h5dump/binread.c b/tools/test/h5dump/binread.c
index d6206ca..341a085 100644
--- a/tools/test/h5dump/binread.c
+++ b/tools/test/h5dump/binread.c
@@ -59,7 +59,7 @@ usage(void)
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
FILE * stream;
size_t numread;
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 6dbb700..fc0b995 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -243,7 +243,7 @@ typedef struct s1_t {
#define ARRAY3_DIM2 3
/* VL string datatype name */
-/* TODO remove complier error not used, remove the link when everything is OK */
+/* TODO remove compiler error not used, remove the link when everything is OK */
/* #define VLSTR_TYPE "vl_string_type" */
/* "File 41" macros */
@@ -1135,7 +1135,7 @@ gent_compound_dt(void)
H5Dclose(dataset);
H5Gclose(group);
- /* unamed data type */
+ /* unnamed data type */
group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
@@ -1319,7 +1319,7 @@ gent_compound_dt2(void)
H5Dclose(dataset);
H5Gclose(group);
- /* unamed data type */
+ /* unnamed data type */
group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
@@ -1529,11 +1529,11 @@ gent_loop2(void)
fid = H5Fcreate(FILE11, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- /* create group object g1 and implcit path from root object */
+ /* create group object g1 and implicit path from root object */
group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
- /* create group object g2 and implcit path from root object */
+ /* create group object g2 and implicit path from root object */
group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group);
@@ -2475,7 +2475,7 @@ gent_attrreg(void)
static void
gent_nestcomp(void)
{
- /* Compound memeber of the compound datatype*/
+ /* Compound member of the compound datatype*/
typedef struct cmp_t {
char a;
float b[2];
@@ -2548,7 +2548,7 @@ gent_nestcomp(void)
H5Tinsert(s2_tid, "c_name", HOFFSET(s2_t, c), H5T_NATIVE_DOUBLE);
H5Tinsert(s2_tid, "b_name", HOFFSET(s2_t, b), H5T_NATIVE_FLOAT);
- /* Insert compound memeber created above */
+ /* Insert compound member created above */
H5Tinsert(s2_tid, "d_name", HOFFSET(s2_t, d), cmp_tid);
/*
@@ -3921,9 +3921,9 @@ gent_multi(void)
static void
gent_large_objname(void)
{
- hid_t fid, group, group2;
- char grp_name[128];
- register int i;
+ hid_t fid, group, group2;
+ char grp_name[128];
+ int i;
fid = H5Fcreate(FILE37, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -5225,7 +5225,7 @@ gent_named_dtype_attr(void)
sid = H5Screate(H5S_SCALAR);
HDassert(sid > 0);
- /* Create attribute on commited datatype */
+ /* Create attribute on committed datatype */
aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
HDassert(aid > 0);
@@ -5742,7 +5742,7 @@ gent_filters(void)
HDassert(ret >= 0);
if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) {
- ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT);
+ ret = H5Oset_comment_by_name(fid, "mytype", "This is a committed datatype", H5P_DEFAULT);
HDassert(ret >= 0);
}
@@ -6810,7 +6810,7 @@ gent_attr_creation_order(void)
goto out;
/*-------------------------------------------------------------------------
- * create a dataset with creation order tracked for attributes and atributes in it
+ * create a dataset with creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -6834,7 +6834,7 @@ gent_attr_creation_order(void)
did = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
- * create a dataset without creation order tracked for attributes and atributes in it
+ * create a dataset without creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -6858,7 +6858,7 @@ gent_attr_creation_order(void)
did = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
- * create a group with creation order tracked for attributes and atributes in it
+ * create a group with creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -6881,7 +6881,7 @@ gent_attr_creation_order(void)
gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
- * create a group without creation order tracked for attributes and atributes in it
+ * create a group without creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -6904,7 +6904,7 @@ gent_attr_creation_order(void)
gid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
- * create a named datatype with creation order tracked for attributes and atributes in it
+ * create a named datatype with creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -6930,7 +6930,7 @@ gent_attr_creation_order(void)
tid = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
- * create a named datatype without creation order tracked for attributes and atributes in it
+ * create a named datatype without creation order tracked for attributes and attributes in it
*-------------------------------------------------------------------------
*/
@@ -7271,15 +7271,33 @@ gent_packedbits(void)
hid_t space = H5I_INVALID_HID;
hsize_t dims[2];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F66_XDIM][F66_YDIM8];
+ } * dsetu8;
+ struct {
+ uint16_t arr[F66_XDIM][F66_YDIM16];
+ } * dsetu16;
+ struct {
+ uint32_t arr[F66_XDIM][F66_YDIM32];
+ } * dsetu32;
+ struct {
+ uint64_t arr[F66_XDIM][F66_YDIM64];
+ } * dsetu64;
+ struct {
+ int8_t arr[F66_XDIM][F66_YDIM8];
+ } * dset8;
+ struct {
+ int16_t arr[F66_XDIM][F66_YDIM16];
+ } * dset16;
+ struct {
+ int32_t arr[F66_XDIM][F66_YDIM32];
+ } * dset32;
+ struct {
+ int64_t arr[F66_XDIM][F66_YDIM64];
+ } * dset64;
+ struct {
+ double arr[F66_XDIM][F66_YDIM8];
+ } * dsetdbl;
uint8_t valu8bits;
uint16_t valu16bits;
@@ -7293,15 +7311,15 @@ gent_packedbits(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
fid = H5Fcreate(FILE66, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -7313,13 +7331,13 @@ gent_packedbits(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
+ dsetu8->arr[i][0] = valu8bits;
for (j = 1; j < dims[1]; j++)
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
valu8bits = (uint8_t)(valu8bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8);
H5Sclose(space);
H5Dclose(dataset);
@@ -7331,13 +7349,13 @@ gent_packedbits(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
+ dsetu16->arr[i][0] = valu16bits;
for (j = 1; j < dims[1]; j++)
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
valu16bits = (uint16_t)(valu16bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16);
H5Sclose(space);
H5Dclose(dataset);
@@ -7349,13 +7367,13 @@ gent_packedbits(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
+ dsetu32->arr[i][0] = valu32bits;
for (j = 1; j < dims[1]; j++)
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
valu32bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32);
H5Sclose(space);
H5Dclose(dataset);
@@ -7367,13 +7385,13 @@ gent_packedbits(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
+ dsetu64->arr[i][0] = valu64bits;
for (j = 1; j < dims[1]; j++)
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
valu64bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64);
H5Sclose(space);
H5Dclose(dataset);
@@ -7385,13 +7403,13 @@ gent_packedbits(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
+ dset8->arr[i][0] = val8bits;
for (j = 1; j < dims[1]; j++)
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
val8bits = (int8_t)(val8bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8);
H5Sclose(space);
H5Dclose(dataset);
@@ -7403,13 +7421,13 @@ gent_packedbits(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
+ dset16->arr[i][0] = val16bits;
for (j = 1; j < dims[1]; j++)
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
val16bits = (int16_t)(val16bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16);
H5Sclose(space);
H5Dclose(dataset);
@@ -7421,13 +7439,13 @@ gent_packedbits(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
+ dset32->arr[i][0] = val32bits;
for (j = 1; j < dims[1]; j++)
- dset32[i][j] = dset32[i][j - 1] << 1;
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
val32bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32);
H5Sclose(space);
H5Dclose(dataset);
@@ -7439,13 +7457,13 @@ gent_packedbits(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
+ dset64->arr[i][0] = val64bits;
for (j = 1; j < dims[1]; j++)
- dset64[i][j] = dset64[i][j - 1] << 1;
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
val64bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64);
H5Sclose(space);
H5Dclose(dataset);
@@ -7457,9 +7475,9 @@ gent_packedbits(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++)
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl);
H5Sclose(space);
H5Dclose(dataset);
@@ -7496,15 +7514,33 @@ gent_attr_intsize(void)
hid_t root = H5I_INVALID_HID;
hsize_t dims[2];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F66_XDIM][F66_YDIM8];
+ } * dsetu8;
+ struct {
+ uint16_t arr[F66_XDIM][F66_YDIM16];
+ } * dsetu16;
+ struct {
+ uint32_t arr[F66_XDIM][F66_YDIM32];
+ } * dsetu32;
+ struct {
+ uint64_t arr[F66_XDIM][F66_YDIM64];
+ } * dsetu64;
+ struct {
+ int8_t arr[F66_XDIM][F66_YDIM8];
+ } * dset8;
+ struct {
+ int16_t arr[F66_XDIM][F66_YDIM16];
+ } * dset16;
+ struct {
+ int32_t arr[F66_XDIM][F66_YDIM64];
+ } * dset32;
+ struct {
+ int64_t arr[F66_XDIM][F66_YDIM64];
+ } * dset64;
+ struct {
+ double arr[F66_XDIM][F66_YDIM8];
+ } * dsetdbl;
uint8_t valu8bits;
uint16_t valu16bits;
@@ -7518,15 +7554,15 @@ gent_attr_intsize(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
fid = H5Fcreate(FILE69, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
root = H5Gopen2(fid, "/", H5P_DEFAULT);
@@ -7539,14 +7575,14 @@ gent_attr_intsize(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
+ dsetu8->arr[i][0] = valu8bits;
for (j = 1; j < dims[1]; j++) {
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
}
valu8bits = (uint8_t)(valu8bits << 1);
}
- H5Awrite(attr, H5T_NATIVE_UINT8, dsetu8[0]);
+ H5Awrite(attr, H5T_NATIVE_UINT8, dsetu8);
H5Sclose(space);
H5Aclose(attr);
@@ -7558,14 +7594,14 @@ gent_attr_intsize(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
+ dsetu16->arr[i][0] = valu16bits;
for (j = 1; j < dims[1]; j++) {
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
}
valu16bits = (uint16_t)(valu16bits << 1);
}
- H5Awrite(attr, H5T_NATIVE_UINT16, dsetu16[0]);
+ H5Awrite(attr, H5T_NATIVE_UINT16, dsetu16);
H5Sclose(space);
H5Aclose(attr);
@@ -7577,14 +7613,14 @@ gent_attr_intsize(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
+ dsetu32->arr[i][0] = valu32bits;
for (j = 1; j < dims[1]; j++) {
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
}
valu32bits <<= 1;
}
- H5Awrite(attr, H5T_NATIVE_UINT32, dsetu32[0]);
+ H5Awrite(attr, H5T_NATIVE_UINT32, dsetu32);
H5Sclose(space);
H5Aclose(attr);
@@ -7596,14 +7632,14 @@ gent_attr_intsize(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
+ dsetu64->arr[i][0] = valu64bits;
for (j = 1; j < dims[1]; j++) {
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
}
valu64bits <<= 1;
}
- H5Awrite(attr, H5T_NATIVE_UINT64, dsetu64[0]);
+ H5Awrite(attr, H5T_NATIVE_UINT64, dsetu64);
H5Sclose(space);
H5Aclose(attr);
@@ -7615,14 +7651,14 @@ gent_attr_intsize(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
+ dset8->arr[i][0] = val8bits;
for (j = 1; j < dims[1]; j++) {
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
}
val8bits = (int8_t)(val8bits << 1);
}
- H5Awrite(attr, H5T_NATIVE_INT8, dset8[0]);
+ H5Awrite(attr, H5T_NATIVE_INT8, dset8);
H5Sclose(space);
H5Aclose(attr);
@@ -7634,14 +7670,14 @@ gent_attr_intsize(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
+ dset16->arr[i][0] = val16bits;
for (j = 1; j < dims[1]; j++) {
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
}
val16bits = (int16_t)(val16bits << 1);
}
- H5Awrite(attr, H5T_NATIVE_INT16, dset16[0]);
+ H5Awrite(attr, H5T_NATIVE_INT16, dset16);
H5Sclose(space);
H5Aclose(attr);
@@ -7653,14 +7689,14 @@ gent_attr_intsize(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
+ dset32->arr[i][0] = val32bits;
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = dset32[i][j - 1] << 1;
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
}
val32bits <<= 1;
}
- H5Awrite(attr, H5T_NATIVE_INT32, dset32[0]);
+ H5Awrite(attr, H5T_NATIVE_INT32, dset32);
H5Sclose(space);
H5Aclose(attr);
@@ -7672,14 +7708,14 @@ gent_attr_intsize(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
+ dset64->arr[i][0] = val64bits;
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = dset64[i][j - 1] << 1;
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
}
val64bits <<= 1;
}
- H5Awrite(attr, H5T_NATIVE_INT64, dset64[0]);
+ H5Awrite(attr, H5T_NATIVE_INT64, dset64);
H5Sclose(space);
H5Aclose(attr);
@@ -7691,9 +7727,9 @@ gent_attr_intsize(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++)
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
- H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl[0]);
+ H5Awrite(attr, H5T_NATIVE_DOUBLE, dsetdbl);
H5Sclose(space);
H5Aclose(attr);
@@ -8593,15 +8629,33 @@ gent_intscalars(void)
hid_t tid = H5I_INVALID_HID;
hsize_t dims[2];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F73_XDIM][F73_YDIM8];
+ } * dsetu8;
+ struct {
+ uint16_t arr[F73_XDIM][F73_YDIM16];
+ } * dsetu16;
+ struct {
+ uint32_t arr[F73_XDIM][F73_YDIM32];
+ } * dsetu32;
+ struct {
+ uint64_t arr[F73_XDIM][F73_YDIM64];
+ } * dsetu64;
+ struct {
+ int8_t arr[F73_XDIM][F73_YDIM8];
+ } * dset8;
+ struct {
+ int16_t arr[F73_XDIM][F73_YDIM16];
+ } * dset16;
+ struct {
+ int32_t arr[F73_XDIM][F73_YDIM32];
+ } * dset32;
+ struct {
+ int64_t arr[F73_XDIM][F73_YDIM64];
+ } * dset64;
+ struct {
+ double arr[F73_XDIM][F73_YDIM8];
+ } * dsetdbl;
uint8_t valu8bits;
uint16_t valu16bits;
@@ -8615,15 +8669,15 @@ gent_intscalars(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
fid = H5Fcreate(FILE73, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -8636,14 +8690,14 @@ gent_intscalars(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
+ dsetu8->arr[i][0] = valu8bits;
for (j = 1; j < dims[1]; j++) {
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
}
valu8bits = (uint8_t)(valu8bits << 1);
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8);
H5Sclose(space);
H5Dclose(dataset);
@@ -8656,14 +8710,14 @@ gent_intscalars(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
+ dsetu16->arr[i][0] = valu16bits;
for (j = 1; j < dims[1]; j++) {
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
}
valu16bits = (uint16_t)(valu16bits << 1);
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16);
H5Sclose(space);
H5Dclose(dataset);
@@ -8676,14 +8730,14 @@ gent_intscalars(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
+ dsetu32->arr[i][0] = valu32bits;
for (j = 1; j < dims[1]; j++) {
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
}
valu32bits <<= 1;
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32);
H5Sclose(space);
H5Dclose(dataset);
@@ -8696,14 +8750,14 @@ gent_intscalars(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
+ dsetu64->arr[i][0] = valu64bits;
for (j = 1; j < dims[1]; j++) {
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
}
valu64bits <<= 1;
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64);
H5Sclose(space);
H5Dclose(dataset);
@@ -8716,14 +8770,14 @@ gent_intscalars(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
+ dset8->arr[i][0] = val8bits;
for (j = 1; j < dims[1]; j++) {
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
}
val8bits = (int8_t)(val8bits << 1);
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8);
H5Sclose(space);
H5Dclose(dataset);
@@ -8736,14 +8790,14 @@ gent_intscalars(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
+ dset16->arr[i][0] = val16bits;
for (j = 1; j < dims[1]; j++) {
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
}
val16bits = (int16_t)(val16bits << 1);
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16);
H5Sclose(space);
H5Dclose(dataset);
@@ -8756,14 +8810,14 @@ gent_intscalars(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
+ dset32->arr[i][0] = val32bits;
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = dset32[i][j - 1] << 1;
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
}
val32bits <<= 1;
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32);
H5Sclose(space);
H5Dclose(dataset);
@@ -8776,14 +8830,14 @@ gent_intscalars(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
+ dset64->arr[i][0] = val64bits;
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = dset64[i][j - 1] << 1;
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
}
val64bits <<= 1;
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64);
H5Sclose(space);
H5Dclose(dataset);
@@ -8796,9 +8850,9 @@ gent_intscalars(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++)
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl);
H5Sclose(space);
H5Dclose(dataset);
@@ -8836,15 +8890,33 @@ gent_attr_intscalars(void)
hid_t tid = H5I_INVALID_HID;
hsize_t dims[2];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F73_XDIM][F73_YDIM8];
+ } * dsetu8;
+ struct {
+ uint16_t arr[F73_XDIM][F73_YDIM16];
+ } * dsetu16;
+ struct {
+ uint32_t arr[F73_XDIM][F73_YDIM32];
+ } * dsetu32;
+ struct {
+ uint64_t arr[F73_XDIM][F73_YDIM64];
+ } * dsetu64;
+ struct {
+ int8_t arr[F73_XDIM][F73_YDIM8];
+ } * dset8;
+ struct {
+ int16_t arr[F73_XDIM][F73_YDIM16];
+ } * dset16;
+ struct {
+ int32_t arr[F73_XDIM][F73_YDIM32];
+ } * dset32;
+ struct {
+ int64_t arr[F73_XDIM][F73_YDIM64];
+ } * dset64;
+ struct {
+ double arr[F73_XDIM][F73_YDIM8];
+ } * dsetdbl;
uint8_t valu8bits;
uint16_t valu16bits;
@@ -8858,15 +8930,15 @@ gent_attr_intscalars(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
fid = H5Fcreate(FILE74, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
root = H5Gopen2(fid, "/", H5P_DEFAULT);
@@ -8880,14 +8952,14 @@ gent_attr_intscalars(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
+ dsetu8->arr[i][0] = valu8bits;
for (j = 1; j < dims[1]; j++) {
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
}
valu8bits = (uint8_t)(valu8bits << 1);
}
- H5Awrite(attr, tid, dsetu8[0]);
+ H5Awrite(attr, tid, dsetu8);
H5Sclose(space);
H5Aclose(attr);
@@ -8900,14 +8972,14 @@ gent_attr_intscalars(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
+ dsetu16->arr[i][0] = valu16bits;
for (j = 1; j < dims[1]; j++) {
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
}
valu16bits = (uint16_t)(valu16bits << 1);
}
- H5Awrite(attr, tid, dsetu16[0]);
+ H5Awrite(attr, tid, dsetu16);
H5Sclose(space);
H5Aclose(attr);
@@ -8920,14 +8992,14 @@ gent_attr_intscalars(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
+ dsetu32->arr[i][0] = valu32bits;
for (j = 1; j < dims[1]; j++) {
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
}
valu32bits <<= 1;
}
- H5Awrite(attr, tid, dsetu32[0]);
+ H5Awrite(attr, tid, dsetu32);
H5Sclose(space);
H5Aclose(attr);
@@ -8940,14 +9012,14 @@ gent_attr_intscalars(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
+ dsetu64->arr[i][0] = valu64bits;
for (j = 1; j < dims[1]; j++) {
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
}
valu64bits <<= 1;
}
- H5Awrite(attr, tid, dsetu64[0]);
+ H5Awrite(attr, tid, dsetu64);
H5Sclose(space);
H5Aclose(attr);
@@ -8960,14 +9032,14 @@ gent_attr_intscalars(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
+ dset8->arr[i][0] = val8bits;
for (j = 1; j < dims[1]; j++) {
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
}
val8bits = (int8_t)(val8bits << 1);
}
- H5Awrite(attr, tid, dset8[0]);
+ H5Awrite(attr, tid, dset8);
H5Sclose(space);
H5Aclose(attr);
@@ -8980,14 +9052,14 @@ gent_attr_intscalars(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
+ dset16->arr[i][0] = val16bits;
for (j = 1; j < dims[1]; j++) {
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
}
val16bits = (int16_t)(val16bits << 1);
}
- H5Awrite(attr, tid, dset16[0]);
+ H5Awrite(attr, tid, dset16);
H5Sclose(space);
H5Aclose(attr);
@@ -9000,14 +9072,14 @@ gent_attr_intscalars(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
+ dset32->arr[i][0] = val32bits;
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = dset32[i][j - 1] << 1;
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
}
val32bits <<= 1;
}
- H5Awrite(attr, tid, dset32[0]);
+ H5Awrite(attr, tid, dset32);
H5Sclose(space);
H5Aclose(attr);
@@ -9020,14 +9092,14 @@ gent_attr_intscalars(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
+ dset64->arr[i][0] = val64bits;
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = dset64[i][j - 1] << 1;
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
}
val64bits <<= 1;
}
- H5Awrite(attr, tid, dset64[0]);
+ H5Awrite(attr, tid, dset64);
H5Sclose(space);
H5Aclose(attr);
@@ -9040,9 +9112,9 @@ gent_attr_intscalars(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++)
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
- H5Awrite(attr, tid, dsetdbl[0]);
+ H5Awrite(attr, tid, dsetdbl);
H5Sclose(space);
H5Aclose(attr);
@@ -9625,15 +9697,33 @@ gent_intattrscalars(void)
hid_t tid = H5I_INVALID_HID;
hsize_t dims[2];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F73_XDIM][F73_YDIM8];
+ } *dsetu8 = NULL;
+ struct {
+ uint16_t arr[F73_XDIM][F73_YDIM16];
+ } *dsetu16 = NULL;
+ struct {
+ uint32_t arr[F73_XDIM][F73_YDIM32];
+ } *dsetu32 = NULL;
+ struct {
+ uint64_t arr[F73_XDIM][F73_YDIM64];
+ } *dsetu64 = NULL;
+ struct {
+ int8_t arr[F73_XDIM][F73_YDIM8];
+ } *dset8 = NULL;
+ struct {
+ int16_t arr[F73_XDIM][F73_YDIM16];
+ } *dset16 = NULL;
+ struct {
+ int32_t arr[F73_XDIM][F73_YDIM32];
+ } *dset32 = NULL;
+ struct {
+ int64_t arr[F73_XDIM][F73_YDIM64];
+ } *dset64 = NULL;
+ struct {
+ double arr[F73_XDIM][F73_YDIM8];
+ } *dsetdbl = NULL;
uint8_t valu8bits;
uint16_t valu16bits;
@@ -9647,15 +9737,15 @@ gent_intattrscalars(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F73_XDIM, F73_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F73_XDIM, F73_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F73_XDIM, F73_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F73_XDIM, F73_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F73_XDIM, F73_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
fid = H5Fcreate(FILE78, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -9668,9 +9758,9 @@ gent_intattrscalars(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
+ dsetu8->arr[i][0] = valu8bits;
for (j = 1; j < dims[1]; j++) {
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
}
valu8bits = (uint8_t)(valu8bits << 1);
}
@@ -9678,7 +9768,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8);
/* Attribute of 8 bits unsigned int */
attr = H5Acreate2(dataset, F73_DATASETU08, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dsetu8[0]);
+ H5Awrite(attr, tid, dsetu8);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9692,9 +9782,9 @@ gent_intattrscalars(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
+ dsetu16->arr[i][0] = valu16bits;
for (j = 1; j < dims[1]; j++) {
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
}
valu16bits = (uint16_t)(valu16bits << 1);
}
@@ -9702,7 +9792,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16);
/* Attribute of 16 bits unsigned int */
attr = H5Acreate2(dataset, F73_DATASETU16, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dsetu16[0]);
+ H5Awrite(attr, tid, dsetu16);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9716,9 +9806,9 @@ gent_intattrscalars(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
+ dsetu32->arr[i][0] = valu32bits;
for (j = 1; j < dims[1]; j++) {
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
}
valu32bits <<= 1;
}
@@ -9726,7 +9816,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32);
/* Attribute of 32 bits unsigned int */
attr = H5Acreate2(dataset, F73_DATASETU32, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dsetu32[0]);
+ H5Awrite(attr, tid, dsetu32);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9740,9 +9830,9 @@ gent_intattrscalars(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
+ dsetu64->arr[i][0] = valu64bits;
for (j = 1; j < dims[1]; j++) {
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
}
valu64bits <<= 1;
}
@@ -9750,7 +9840,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64);
/* Attribute of 64 bits unsigned int */
attr = H5Acreate2(dataset, F73_DATASETU64, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dsetu64[0]);
+ H5Awrite(attr, tid, dsetu64);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9764,9 +9854,9 @@ gent_intattrscalars(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
+ dset8->arr[i][0] = val8bits;
for (j = 1; j < dims[1]; j++) {
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
}
val8bits = (int8_t)(val8bits << 1);
}
@@ -9774,7 +9864,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8);
/* Attribute of 8 bits signed int */
attr = H5Acreate2(dataset, F73_DATASETS08, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dset8[0]);
+ H5Awrite(attr, tid, dset8);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9788,9 +9878,9 @@ gent_intattrscalars(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
+ dset16->arr[i][0] = val16bits;
for (j = 1; j < dims[1]; j++) {
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
}
val16bits = (int16_t)(val16bits << 1);
}
@@ -9798,7 +9888,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16);
/* Attribute of 16 bits signed int */
attr = H5Acreate2(dataset, F73_DATASETS16, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dset16[0]);
+ H5Awrite(attr, tid, dset16);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9812,9 +9902,9 @@ gent_intattrscalars(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
+ dset32->arr[i][0] = val32bits;
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = dset32[i][j - 1] << 1;
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
}
val32bits <<= 1;
}
@@ -9822,7 +9912,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32);
/* Attribute of 32 bits signed int */
attr = H5Acreate2(dataset, F73_DATASETS32, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dset32[0]);
+ H5Awrite(attr, tid, dset32);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9836,9 +9926,9 @@ gent_intattrscalars(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
+ dset64->arr[i][0] = val64bits;
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = dset64[i][j - 1] << 1;
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
}
val64bits <<= 1;
}
@@ -9846,7 +9936,7 @@ gent_intattrscalars(void)
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64);
/* Attribute of 64 bits signed int */
attr = H5Acreate2(dataset, F73_DATASETS64, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dset64[0]);
+ H5Awrite(attr, tid, dset64);
H5Aclose(attr);
H5Sclose(space);
H5Dclose(dataset);
@@ -9860,12 +9950,12 @@ gent_intattrscalars(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++)
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl);
/* Attribute of double */
attr = H5Acreate2(dataset, F73_DUMMYDBL, tid, space, H5P_DEFAULT, H5P_DEFAULT);
- H5Awrite(attr, tid, dsetdbl[0]);
+ H5Awrite(attr, tid, dsetdbl);
H5Aclose(attr);
H5Sclose(space);
@@ -9903,15 +9993,33 @@ gent_intsattrs(void)
hid_t aspace = H5I_INVALID_HID;
hsize_t dims[2], adims[1];
- uint8_t ** dsetu8 = NULL;
- uint16_t **dsetu16 = NULL;
- uint32_t **dsetu32 = NULL;
- uint64_t **dsetu64 = NULL;
- int8_t ** dset8 = NULL;
- int16_t ** dset16 = NULL;
- int32_t ** dset32 = NULL;
- int64_t ** dset64 = NULL;
- double ** dsetdbl = NULL;
+ struct {
+ uint8_t arr[F66_XDIM][F66_YDIM8];
+ } * dsetu8;
+ struct {
+ uint16_t arr[F66_XDIM][F66_YDIM16];
+ } * dsetu16;
+ struct {
+ uint32_t arr[F66_XDIM][F66_YDIM32];
+ } * dsetu32;
+ struct {
+ uint64_t arr[F66_XDIM][F66_YDIM64];
+ } * dsetu64;
+ struct {
+ int8_t arr[F66_XDIM][F66_YDIM8];
+ } * dset8;
+ struct {
+ int16_t arr[F66_XDIM][F66_YDIM16];
+ } * dset16;
+ struct {
+ int32_t arr[F66_XDIM][F66_YDIM32];
+ } * dset32;
+ struct {
+ int64_t arr[F66_XDIM][F66_YDIM64];
+ } * dset64;
+ struct {
+ double arr[F66_XDIM][F66_YDIM8];
+ } * dsetdbl;
uint8_t * asetu8 = NULL;
uint16_t *asetu16 = NULL;
@@ -9935,15 +10043,15 @@ gent_intsattrs(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dsetu8, uint8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu16, uint16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu32, uint32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dsetu64, uint64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset8, int8_t, F66_XDIM, F66_YDIM8);
- H5TEST_ALLOCATE_2D_ARRAY(dset16, int16_t, F66_XDIM, F66_YDIM16);
- H5TEST_ALLOCATE_2D_ARRAY(dset32, int32_t, F66_XDIM, F66_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, int64_t, F66_XDIM, F66_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dsetdbl, double, F66_XDIM, F66_YDIM8);
+ dsetu8 = malloc(sizeof(*dsetu8));
+ dsetu16 = malloc(sizeof(*dsetu16));
+ dsetu32 = malloc(sizeof(*dsetu32));
+ dsetu64 = malloc(sizeof(*dsetu64));
+ dset8 = malloc(sizeof(*dset8));
+ dset16 = malloc(sizeof(*dset16));
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dsetdbl = malloc(sizeof(*dsetdbl));
asetu8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t));
asetu16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t));
@@ -9965,16 +10073,16 @@ gent_intsattrs(void)
valu8bits = (uint8_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu8[i][0] = valu8bits;
- asetu8[i * dims[1]] = dsetu8[i][0];
+ dsetu8->arr[i][0] = valu8bits;
+ asetu8[i * dims[1]] = dsetu8->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dsetu8[i][j] = (uint8_t)(dsetu8[i][j - 1] << 1);
- asetu8[i * dims[1] + j] = dsetu8[i][j];
+ dsetu8->arr[i][j] = (uint8_t)(dsetu8->arr[i][j - 1] << 1);
+ asetu8[i * dims[1] + j] = dsetu8->arr[i][j];
}
valu8bits = (uint8_t)(valu8bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8);
/* Attribute of 8 bits unsigned int */
adims[0] = F66_XDIM * F66_YDIM8;
aspace = H5Screate_simple(1, adims, NULL);
@@ -9993,16 +10101,16 @@ gent_intsattrs(void)
valu16bits = (uint16_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu16[i][0] = valu16bits;
- asetu16[i * dims[1]] = dsetu16[i][0];
+ dsetu16->arr[i][0] = valu16bits;
+ asetu16[i * dims[1]] = dsetu16->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dsetu16[i][j] = (uint16_t)(dsetu16[i][j - 1] << 1);
- asetu16[i * dims[1] + j] = dsetu16[i][j];
+ dsetu16->arr[i][j] = (uint16_t)(dsetu16->arr[i][j - 1] << 1);
+ asetu16[i * dims[1] + j] = dsetu16->arr[i][j];
}
valu16bits = (uint16_t)(valu16bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16);
/* Attribute of 16 bits unsigned int */
adims[0] = F66_XDIM * F66_YDIM16;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10021,16 +10129,16 @@ gent_intsattrs(void)
valu32bits = (uint32_t)~0u; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu32[i][0] = valu32bits;
- asetu32[i * dims[1]] = dsetu32[i][0];
+ dsetu32->arr[i][0] = valu32bits;
+ asetu32[i * dims[1]] = dsetu32->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dsetu32[i][j] = dsetu32[i][j - 1] << 1;
- asetu32[i * dims[1] + j] = dsetu32[i][j];
+ dsetu32->arr[i][j] = dsetu32->arr[i][j - 1] << 1;
+ asetu32[i * dims[1] + j] = dsetu32->arr[i][j];
}
valu32bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32);
/* Attribute of 32 bits unsigned int */
adims[0] = F66_XDIM * F66_YDIM32;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10049,16 +10157,16 @@ gent_intsattrs(void)
valu64bits = (uint64_t)~0Lu; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dsetu64[i][0] = valu64bits;
- asetu64[i * dims[1]] = dsetu64[i][0];
+ dsetu64->arr[i][0] = valu64bits;
+ asetu64[i * dims[1]] = dsetu64->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dsetu64[i][j] = dsetu64[i][j - 1] << 1;
- asetu64[i * dims[1] + j] = dsetu64[i][j];
+ dsetu64->arr[i][j] = dsetu64->arr[i][j - 1] << 1;
+ asetu64[i * dims[1] + j] = dsetu64->arr[i][j];
}
valu64bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64[0]);
+ H5Dwrite(dataset, H5T_NATIVE_UINT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu64);
/* Attribute of 64 bits unsigned int */
adims[0] = F66_XDIM * F66_YDIM64;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10077,16 +10185,16 @@ gent_intsattrs(void)
val8bits = (int8_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset8[i][0] = val8bits;
- aset8[i * dims[1]] = dset8[i][0];
+ dset8->arr[i][0] = val8bits;
+ aset8[i * dims[1]] = dset8->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset8[i][j] = (int8_t)(dset8[i][j - 1] << 1);
- aset8[i * dims[1] + j] = dset8[i][j];
+ dset8->arr[i][j] = (int8_t)(dset8->arr[i][j - 1] << 1);
+ aset8[i * dims[1] + j] = dset8->arr[i][j];
}
val8bits = (int8_t)(val8bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8);
/* Attribute of 8 bits signed int */
adims[0] = F66_XDIM * F66_YDIM8;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10105,16 +10213,16 @@ gent_intsattrs(void)
val16bits = (int16_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset16[i][0] = val16bits;
- aset16[i * dims[1]] = dset16[i][0];
+ dset16->arr[i][0] = val16bits;
+ aset16[i * dims[1]] = dset16->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset16[i][j] = (int16_t)(dset16[i][j - 1] << 1);
- aset16[i * dims[1] + j] = dset16[i][j];
+ dset16->arr[i][j] = (int16_t)(dset16->arr[i][j - 1] << 1);
+ aset16[i * dims[1] + j] = dset16->arr[i][j];
}
val16bits = (int16_t)(val16bits << 1);
}
- H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16);
/* Attribute of 16 bits signed int */
adims[0] = F66_XDIM * F66_YDIM16;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10133,16 +10241,16 @@ gent_intsattrs(void)
val32bits = (int32_t)~0; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
- aset32[i * dims[1]] = dset32[i][0];
+ dset32->arr[i][0] = val32bits;
+ aset32[i * dims[1]] = dset32->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = dset32[i][j - 1] << 1;
- aset32[i * dims[1] + j] = dset32[i][j];
+ dset32->arr[i][j] = dset32->arr[i][j - 1] << 1;
+ aset32[i * dims[1] + j] = dset32->arr[i][j];
}
val32bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32);
/* Attribute of 32 bits signed int */
adims[0] = F66_XDIM * F66_YDIM32;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10161,16 +10269,16 @@ gent_intsattrs(void)
val64bits = (int64_t)~0L; /* all 1s */
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
- aset64[i * dims[1]] = dset64[i][0];
+ dset64->arr[i][0] = val64bits;
+ aset64[i * dims[1]] = dset64->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = dset64[i][j - 1] << 1;
- aset64[i * dims[1] + j] = dset64[i][j];
+ dset64->arr[i][j] = dset64->arr[i][j - 1] << 1;
+ aset64[i * dims[1] + j] = dset64->arr[i][j];
}
val64bits <<= 1;
}
- H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]);
+ H5Dwrite(dataset, H5T_NATIVE_INT64, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64);
/* Attribute of 64 bits signed int */
adims[0] = F66_XDIM * F66_YDIM64;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10189,11 +10297,11 @@ gent_intsattrs(void)
for (i = 0; i < dims[0]; i++)
for (j = 0; j < dims[1]; j++) {
- dsetdbl[i][j] = 0.0001 * (double)j + (double)i;
- asetdbl[i * dims[1] + j] = dsetdbl[i][j];
+ dsetdbl->arr[i][j] = 0.0001 * (double)j + (double)i;
+ asetdbl[i * dims[1] + j] = dsetdbl->arr[i][j];
}
- H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl[0]);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetdbl);
/* Attribute of double */
adims[0] = F66_XDIM * F66_YDIM8;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10245,9 +10353,15 @@ gent_floatsattrs(void)
hid_t aspace = H5I_INVALID_HID;
hsize_t dims[2], adims[1];
- float ** dset32 = NULL;
- double ** dset64 = NULL;
- long double **dset128 = NULL;
+ struct {
+ float arr[F89_XDIM][F89_YDIM32];
+ } * dset32;
+ struct {
+ double arr[F89_XDIM][F89_YDIM64];
+ } * dset64;
+ struct {
+ long double arr[F89_XDIM][F89_YDIM128];
+ } * dset128;
float * aset32 = NULL;
double * aset64 = NULL;
@@ -10260,9 +10374,9 @@ gent_floatsattrs(void)
unsigned int i, j;
/* Create arrays */
- H5TEST_ALLOCATE_2D_ARRAY(dset32, float, F89_XDIM, F89_YDIM32);
- H5TEST_ALLOCATE_2D_ARRAY(dset64, double, F89_XDIM, F89_YDIM64);
- H5TEST_ALLOCATE_2D_ARRAY(dset128, long double, F89_XDIM, F89_YDIM128);
+ dset32 = malloc(sizeof(*dset32));
+ dset64 = malloc(sizeof(*dset64));
+ dset128 = malloc(sizeof(*dset128));
aset32 = HDcalloc(F89_XDIM * F89_YDIM32, sizeof(float));
aset64 = HDcalloc(F89_XDIM * F89_YDIM64, sizeof(double));
@@ -10284,16 +10398,16 @@ gent_floatsattrs(void)
val32bits = (float)F89_YDIM32;
for (i = 0; i < dims[0]; i++) {
- dset32[i][0] = val32bits;
- aset32[i * dims[1]] = dset32[i][0];
+ dset32->arr[i][0] = val32bits;
+ aset32[i * dims[1]] = dset32->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset32[i][j] = (float)(j * dims[0] + i) / (float)F89_YDIM32;
- aset32[i * dims[1] + j] = dset32[i][j];
+ dset32->arr[i][j] = (float)(j * dims[0] + i) / (float)F89_YDIM32;
+ aset32[i * dims[1] + j] = dset32->arr[i][j];
}
val32bits -= (float)1;
}
- H5Dwrite(dataset, H5T_IEEE_F32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32[0]);
+ H5Dwrite(dataset, H5T_IEEE_F32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32);
/* Attribute of 32 bits float */
adims[0] = F89_XDIM * F89_YDIM32;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10312,16 +10426,16 @@ gent_floatsattrs(void)
val64bits = (double)F89_YDIM64;
for (i = 0; i < dims[0]; i++) {
- dset64[i][0] = val64bits;
- aset64[i * dims[1]] = dset64[i][0];
+ dset64->arr[i][0] = val64bits;
+ aset64[i * dims[1]] = dset64->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset64[i][j] = (double)(j * dims[0] + i) / (double)F89_YDIM64;
- aset64[i * dims[1] + j] = dset64[i][j];
+ dset64->arr[i][j] = (double)(j * dims[0] + i) / (double)F89_YDIM64;
+ aset64[i * dims[1] + j] = dset64->arr[i][j];
}
val64bits -= (double)1;
}
- H5Dwrite(dataset, H5T_IEEE_F64LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64[0]);
+ H5Dwrite(dataset, H5T_IEEE_F64LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset64);
/* Attribute of 64 bits double */
adims[0] = F89_XDIM * F89_YDIM64;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10340,16 +10454,16 @@ gent_floatsattrs(void)
val128bits = (long double)F89_YDIM128;
for (i = 0; i < dims[0]; i++) {
- dset128[i][0] = val128bits;
- aset128[i * dims[1]] = dset128[i][0];
+ dset128->arr[i][0] = val128bits;
+ aset128[i * dims[1]] = dset128->arr[i][0];
for (j = 1; j < dims[1]; j++) {
- dset128[i][j] = (long double)(j * dims[0] + i) / (long double)F89_YDIM128;
- aset128[i * dims[1] + j] = dset128[i][j];
+ dset128->arr[i][j] = (long double)(j * dims[0] + i) / (long double)F89_YDIM128;
+ aset128[i * dims[1] + j] = dset128->arr[i][j];
}
val128bits -= (long double)1;
}
- H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset128[0]);
+ H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset128);
/* Attribute of 128 bits long double */
adims[0] = F89_XDIM * F89_YDIM128;
aspace = H5Screate_simple(1, adims, NULL);
@@ -10541,13 +10655,17 @@ gent_bitnopaquefields(void)
static void
gent_intsfourdims(void)
{
- hid_t fid, dataset, space;
- hsize_t dims[F81_RANK];
- uint32_t dset1[F81_ZDIM][F81_YDIM][F81_XDIM][F81_WDIM];
+ hid_t fid, dataset, space;
+ hsize_t dims[F81_RANK];
+ struct {
+ uint32_t arr[F81_ZDIM][F81_YDIM][F81_XDIM][F81_WDIM];
+ } * dset1;
unsigned int i, j, k, l;
fid = H5Fcreate(FILE81, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ dset1 = malloc(sizeof(*dset1));
+
/* Dataset of 32 bits unsigned int */
dims[0] = F81_ZDIM;
dims[1] = F81_YDIM;
@@ -10560,7 +10678,7 @@ gent_intsfourdims(void)
for (j = 0; j < F81_YDIM; j++)
for (k = 0; k < F81_XDIM; k++)
for (l = 0; l < F81_WDIM; l++)
- dset1[i][j][k][l] =
+ dset1->arr[i][j][k][l] =
i * F81_YDIM * F81_XDIM * F81_WDIM + j * F81_XDIM * F81_WDIM + k * F81_WDIM + l;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
@@ -10568,6 +10686,7 @@ gent_intsfourdims(void)
H5Dclose(dataset);
H5Fclose(fid);
+ free(dset1);
}
/*-------------------------------------------------------------------------
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index effe393..7389951 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -1180,7 +1180,7 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5
# test for named data types
TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5
TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5
-# test for unamed type
+# test for unnamed type
TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5
# test complicated compound datatype
TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5
diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in
index 6689749..eaf91fd 100644
--- a/tools/test/h5dump/testh5dumppbits.sh.in
+++ b/tools/test/h5dump/testh5dumppbits.sh.in
@@ -516,7 +516,7 @@ TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack
# Limits:
# Maximum number of packed bits is 8 (for now).
# Maximum integer size is 64 (for now).
-# Maximun Offset is 63 (Maximum size - 1).
+# Maximum Offset is 63 (Maximum size - 1).
# Maximum Offset+Length is 64 (Maximum size).
# Tests:
# Normal operation on both signed and unsigned int datasets.
diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c
index 09cca45..ccb64b5 100644
--- a/tools/test/h5format_convert/h5fc_gentest.c
+++ b/tools/test/h5format_convert/h5fc_gentest.c
@@ -381,7 +381,7 @@ error:
/*
* Function: gen_err_level()
*
- * Generate a file to test the situtation described in HDFFV-9434:
+ * Generate a file to test the situation described in HDFFV-9434:
* Exceed the limit of v1-btree level
*
* Create a file with H5Pset_istore_k(fcpl, 1).
diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in
index 762f43d..df083d1 100644
--- a/tools/test/h5format_convert/testh5fc.sh.in
+++ b/tools/test/h5format_convert/testh5fc.sh.in
@@ -313,7 +313,7 @@ TOOLTEST_MASK_OUT() {
$RM $actual $actual_err $actual_sav $actual_err_sav
fi
}
-# Same as TOOLTEST_OUT except only compares error outout
+# Same as TOOLTEST_OUT except only compares error output
TOOLTEST_ERR() {
# Prepare expected and actual output
expect="$TESTDIR/$1"
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index e49125b..7dbf762 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -46,11 +46,9 @@ main(void)
int rowo4i = 11, colo4i = 21, plno4i = 51;
int rowi4i = 1, coli4i = 2, plni4i = 5;
-#ifdef H5_SIZEOF_LONG_LONG
long long row4i64[3], col4i64[4], pln4i64[5];
long long rowo4i64 = (long long)11, colo4i64 = (long long)21, plno4i64 = (long long)51;
long long rowi4i64 = (long long)1, coli4i64 = (long long)2, plni4i64 = (long long)5;
-#endif
short b16i3[5][3][4];
short row4i16[3], col4i16[4], pln4i16[5];
@@ -101,11 +99,9 @@ main(void)
col4i[0] = colo4i;
pln4i[0] = plno4i;
-#ifdef H5_SIZEOF_LONG_LONG
row4i64[0] = rowo4i64;
col4i64[0] = colo4i64;
pln4i64[0] = plno4i64;
-#endif
row4i16[0] = rowo4i16;
col4i16[0] = colo4i16;
@@ -116,33 +112,27 @@ main(void)
pln4i8[0] = plno4i8;
for (i = 1; i < nrow; i++) {
- row4[i] = row4[i - 1] + rowi4;
- row8[i] = row8[i - 1] + rowi8;
- row4i[i] = row4i[i - 1] + rowi4i;
-#ifdef H5_SIZEOF_LONG_LONG
+ row4[i] = row4[i - 1] + rowi4;
+ row8[i] = row8[i - 1] + rowi8;
+ row4i[i] = row4i[i - 1] + rowi4i;
row4i64[i] = row4i64[i - 1] + rowi4i64;
-#endif
row4i16[i] = (short)(row4i16[i - 1] + rowi4i16);
row4i8[i] = (char)(row4i8[i - 1] + rowi4i8);
}
for (j = 1; j < ncol; j++) {
- col4[j] = col4[j - 1] + coli4;
- col8[j] = col8[j - 1] + coli8;
- col4i[j] = col4i[j - 1] + coli4i;
-#ifdef H5_SIZEOF_LONG_LONG
+ col4[j] = col4[j - 1] + coli4;
+ col8[j] = col8[j - 1] + coli8;
+ col4i[j] = col4i[j - 1] + coli4i;
col4i64[j] = col4i64[j - 1] + coli4i64;
-#endif
col4i16[j] = (short)(col4i16[j - 1] + coli4i16);
col4i8[j] = (char)(col4i8[j - 1] + coli4i8);
}
for (k = 1; k < npln; k++) {
- pln4[k] = pln4[k - 1] + plni4;
- pln8[k] = pln8[k - 1] + plni8;
- pln4i[k] = pln4i[k - 1] + plni4i;
-#ifdef H5_SIZEOF_LONG_LONG
+ pln4[k] = pln4[k - 1] + plni4;
+ pln8[k] = pln8[k - 1] + plni8;
+ pln4i[k] = pln4i[k - 1] + plni4i;
pln4i64[k] = pln4i64[k - 1] + plni4i64;
-#endif
pln4i16[k] = (short)(pln4i16[k - 1] + plni4i16);
pln4i8[k] = (char)(pln4i8[k - 1] + plni4i8);
}
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index fd21d6c..4e67e98 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -15,7 +15,7 @@
#include "h5tools.h"
#include "h5tools_utils.h"
-void parse_command_line(int argc, const char *argv[]);
+void parse_command_line(int argc, const char *const *argv);
/* Name of tool */
#define PROGRAM_NAME "getub"
@@ -52,7 +52,7 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
void
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
int opt;
@@ -77,7 +77,7 @@ parse_command_line(int argc, const char *argv[])
} /* end parse_command_line() */
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
int fd = H5I_INVALID_HID;
unsigned size;
@@ -91,7 +91,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- parse_command_line(argc, argv);
+ parse_command_line(argc, (const char *const *)argv);
if (NULL == nbytes) {
/* missing arg */
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index e6769ec..f264d9b 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -56,7 +56,7 @@ usage(const char *prog)
*/
static void
-parse_command_line(int argc, const char *argv[])
+parse_command_line(int argc, const char *const *argv)
{
int opt;
@@ -98,7 +98,7 @@ leave(int ret)
*-------------------------------------------------------------------------
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
char * ifname;
hid_t ifile = H5I_INVALID_HID;
@@ -113,7 +113,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- parse_command_line(argc, argv);
+ parse_command_line(argc, (const char *const *)argv);
/* enable error reporting if command line option */
h5tools_error_report();
diff --git a/tools/test/h5jam/testh5jam.sh.in b/tools/test/h5jam/testh5jam.sh.in
index caa3416..191fef0 100644
--- a/tools/test/h5jam/testh5jam.sh.in
+++ b/tools/test/h5jam/testh5jam.sh.in
@@ -345,7 +345,7 @@ CHECK_NOUB() {
# JAMTEST user_block file.h5 [--clobber] [ofile.h5]
#
# Test the 'jam' tool:
-# 1. figure out the input and output, and the comparision
+# 1. figure out the input and output, and the comparison
# that will be done.
# 2. call 'jam' with the appropriate arguments
# 3. check the user block is correct in the output (Check_UB)
diff --git a/tools/test/h5ls/h5ls_plugin.sh.in b/tools/test/h5ls/h5ls_plugin.sh.in
index 29e982d..0077b07 100644
--- a/tools/test/h5ls/h5ls_plugin.sh.in
+++ b/tools/test/h5ls/h5ls_plugin.sh.in
@@ -166,7 +166,7 @@ VERIFY() {
# the `nerrors' global variable and (if $verbose is set) display up to $NLINS
# lines of the actual output from the tool test. The actual output is not
# removed if $HDF5_NOCLEANUP has a non-zero value.
-# Arguemnts:
+# Arguments:
# $1 -- actual output filename to use
# $2 and on -- argument for the h5ls tool
TOOLTEST() {
diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in
index ee0dad7..36583da 100644
--- a/tools/test/h5ls/testh5ls.sh.in
+++ b/tools/test/h5ls/testh5ls.sh.in
@@ -164,7 +164,7 @@ $SRC_H5LS_TESTFILES/tdset_idx.ls
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
@@ -230,7 +230,7 @@ TESTING() {
# the `nerrors' global variable and (if $verbose is set) display up to $NLINS
# lines of the actual output from the tool test. The actual output is not
# removed if $HDF5_NOCLEANUP has a non-zero value.
-# Arguemnts:
+# Arguments:
# $1 -- actual output filename to use
# $2 and on -- argument for the h5ls tool
TOOLTEST() {
diff --git a/tools/test/h5ls/testh5lsvds.sh.in b/tools/test/h5ls/testh5lsvds.sh.in
index 4814f85..ab2d137 100644
--- a/tools/test/h5ls/testh5lsvds.sh.in
+++ b/tools/test/h5ls/testh5lsvds.sh.in
@@ -103,7 +103,7 @@ $SRC_H5LS_TESTFILES/vds/tvds-5.ls
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
- echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Serial Exit Code is not passed back to shell correctly."
echo "***Warning*** Exit code checking is skipped."
h5haveexitcode=no
fi
@@ -169,7 +169,7 @@ TESTING() {
# the `nerrors' global variable and (if $verbose is set) display up to $NLINS
# lines of the actual output from the tool test. The actual output is not
# removed if $HDF5_NOCLEANUP has a non-zero value.
-# Arguemnts:
+# Arguments:
# $1 -- actual output filename to use
# $2 and on -- argument for the h5ls tool
TOOLTEST() {
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index 037287d..09648ff 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -1541,10 +1541,10 @@
ADD_H5_TEST (bug1814 "TEST" ${FILE_REF})
# test attribute with various references (bug1797 / HDFFV-5932)
-# the references in attribute of compund or vlen datatype
+# the references in attribute of compound or vlen datatype
ADD_H5_TEST (HDFFV-5932 "TEST" ${FILE_ATTR_REF})
-# Add test for memory leak in attirbute. This test is verified by CTEST.
+# Add test for memory leak in attribute. This test is verified by CTEST.
# 1. leak from vlen string
# 2. leak from compound type without reference member
# (HDFFV-7840, )
@@ -1552,12 +1552,12 @@
ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5)
# test CVE-2018-17432 fix
- set (arg h5repack_CVE-2018-17432.h5 h5repack__CVE-2018-17432_out.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6)
+ set (arg h5repack_CVE-2018-17432.h5 --low=1 --high=2 -f GZIP=8 -l dset1:CHUNK=5x6)
set (TESTTYPE "TEST")
ADD_H5_FILTER_TEST (HDFFV-10590 "" ${TESTTYPE} 1 ${arg})
# test CVE-2018-14460 fix
- set (arg h5repack_CVE-2018-14460.h5 h5repack_CVE-2018-14460_out.h5)
+ set (arg h5repack_CVE-2018-14460.h5)
set (TESTTYPE "TEST")
ADD_H5_FILTER_TEST (HDFFV-11223 "" ${TESTTYPE} 1 ${arg})
diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake
index e26941b..f8ac10b 100644
--- a/tools/test/h5repack/CMakeVFDTests.cmake
+++ b/tools/test/h5repack/CMakeVFDTests.cmake
@@ -15,20 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################
-
-set (VFD_LIST
- sec2
- stdio
- core
- core_paged
- split
- multi
- family
-)
-
-if (H5_HAVE_DIRECT)
- set (VFD_LIST ${VFD_LIST} direct)
-endif ()
+H5_CREATE_VFD_DIR()
##############################################################################
##############################################################################
@@ -38,7 +25,6 @@ endif ()
macro (ADD_VFD_TEST vfdname resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
add_test (
NAME H5REPACK-${vfdname}-h5repacktest-clear-objects
COMMAND ${CMAKE_COMMAND} -E remove
diff --git a/tools/test/h5repack/dynlib_rpk.c b/tools/test/h5repack/dynlib_rpk.c
index b228344..bef032a 100644
--- a/tools/test/h5repack/dynlib_rpk.c
+++ b/tools/test/h5repack/dynlib_rpk.c
@@ -83,7 +83,7 @@ H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_
add_on = (int)cd_values[0];
if (flags & H5Z_FLAG_REVERSE) { /*read*/
- /* Substract the "add on" value to all the data values */
+ /* Subtract the "add on" value to all the data values */
while (buf_left > 0) {
*int_ptr++ -= add_on;
buf_left -= sizeof(int);
diff --git a/tools/test/h5repack/dynlib_vrpk.c b/tools/test/h5repack/dynlib_vrpk.c
index 5eac4f2..a45de65 100644
--- a/tools/test/h5repack/dynlib_vrpk.c
+++ b/tools/test/h5repack/dynlib_vrpk.c
@@ -91,7 +91,7 @@ H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_
add_on = (int)cd_values[0];
if (flags & H5Z_FLAG_REVERSE) { /*read*/
- /* Substract the "add on" value to all the data values */
+ /* Subtract the "add on" value to all the data values */
while (buf_left > 0) {
*int_ptr++ -= add_on;
buf_left -= sizeof(int);
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index 3756a95..a241ea8 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -525,7 +525,7 @@ VERIFY_LAYOUT_ALL()
#---------------------------------
# check the layout from a dataset
- # check if the other layouts still exsit
+ # check if the other layouts still exist
VERIFY "layouts"
(
cd $TESTDIR
@@ -885,13 +885,24 @@ TOOLTEST_FAIL()
(
cd $TESTDIR
$ENVCMD $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
- ) >$actual
+ ) >&$actual
RET=$?
- if [ $RET == 0 ] ; then
+
+ # Normally h5repack of files tested with this function are expected
+ # to return not 0, but if the command results in "Segmentation fault"
+ # or "core dumped" it is a failure regardless of the return value.
+ failure=`grep -e 'Segmentation fault' -e 'core dumped' $actual`
+ if [ "$failure" != "" ]; then
nerrors="`expr $nerrors + 1`"
echo " FAILED"
+ echo " $failure"
else
- echo " PASSED"
+ if [ $RET == 0 ] ; then
+ nerrors="`expr $nerrors + 1`"
+ echo " FAILED"
+ else
+ echo " PASSED"
+ fi
fi
rm -f $outfile
}
@@ -1702,10 +1713,10 @@ TOOLTEST1 family tfamily%05d.h5
TOOLTEST bug1814 h5repack_refs.h5
# test attribute with various references (bug1797 / HDFFV-5932)
-# the references in attribute of compund or vlen datatype
+# the references in attribute of compound or vlen datatype
TOOLTEST HDFFV-5932 h5repack_attr_refs.h5
-# Add test for memory leak in attirbute. This test is verified by CTEST.
+# Add test for memory leak in attribute. This test is verified by CTEST.
# 1. leak from vlen string
# 2. leak from compound type without reference member
# (HDFFV-7840, )
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index 576b1c7..c025891 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -27,9 +27,9 @@
* There is no restriction on the name, number, or structure of datasets and
* groups in HDF5 file.
*
- * The inluded datatypes should be more than adequate to verify the correctness
+ * The included datatypes should be more than adequate to verify the correctness
* of the behavior -- if one type can be consolidated from external storage,
- * then thay all can.
+ * then they all can.
*/
#include "hdf5.h"
@@ -307,7 +307,7 @@ generate_f32le(hbool_t external)
/* Generate values */
for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) {
for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) {
- wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1));
+ wdata[k] = n * 801.1F * ((k % 5 == 1) ? (-1) : (1));
}
}
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index b62fa53..8b114e4 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -272,98 +272,100 @@ main(void)
GOERROR;
PASSED();
- TESTING(" files with file space info setting-- options -S and -P are set & -L");
- ++j; /* #3 */
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- fname = H5REPACK_FSPACE_FNAMES[j];
- if (h5repack_init(&pack_options, 0, TRUE) < 0)
- GOERROR;
- pack_options.fs_strategy = H5F_FSPACE_STRATEGY_PAGE; /* "PAGE" specified via -S */
- pack_options.fs_persist = TRUE;
- if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ if (h5_using_default_driver(NULL)) {
+ TESTING(" files with file space info setting-- options -S and -P are set & -L");
+ ++j; /* #3 */
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ fname = H5REPACK_FSPACE_FNAMES[j];
+ if (h5repack_init(&pack_options, 0, TRUE) < 0)
+ GOERROR;
+ pack_options.fs_strategy = H5F_FSPACE_STRATEGY_PAGE; /* "PAGE" specified via -S */
+ pack_options.fs_persist = TRUE;
+ if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
- TESTING(" files with file space info setting-- options -P and -T are set & -L");
- ++j; /* #4 */
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- fname = H5REPACK_FSPACE_FNAMES[j];
- if (h5repack_init(&pack_options, 0, TRUE) < 0)
- GOERROR;
- pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */
- pack_options.fs_threshold = 2;
- if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ TESTING(" files with file space info setting-- options -P and -T are set & -L");
+ ++j; /* #4 */
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ fname = H5REPACK_FSPACE_FNAMES[j];
+ if (h5repack_init(&pack_options, 0, TRUE) < 0)
+ GOERROR;
+ pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */
+ pack_options.fs_threshold = 2;
+ if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
- TESTING(" files with file space info setting-- options -S and -G are set & -L");
- ++j; /* #5 */
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- fname = H5REPACK_FSPACE_FNAMES[j];
- if (h5repack_init(&pack_options, 0, TRUE) < 0)
- GOERROR;
- pack_options.fs_strategy = H5F_FSPACE_STRATEGY_PAGE;
- pack_options.fs_pagesize = 8192;
- if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ TESTING(" files with file space info setting-- options -S and -G are set & -L");
+ ++j; /* #5 */
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ fname = H5REPACK_FSPACE_FNAMES[j];
+ if (h5repack_init(&pack_options, 0, TRUE) < 0)
+ GOERROR;
+ pack_options.fs_strategy = H5F_FSPACE_STRATEGY_PAGE;
+ pack_options.fs_pagesize = 8192;
+ if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
- TESTING(" files with file space info setting-- options -S, -P, -T, -G are set");
- ++j; /* #6 */
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- fname = H5REPACK_FSPACE_FNAMES[j];
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- pack_options.fs_strategy = H5F_FSPACE_STRATEGY_NONE;
- pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */
- pack_options.fs_threshold = 1;
- pack_options.fs_pagesize = 8192;
- if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ TESTING(" files with file space info setting-- options -S, -P, -T, -G are set");
+ ++j; /* #6 */
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ fname = H5REPACK_FSPACE_FNAMES[j];
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ pack_options.fs_strategy = H5F_FSPACE_STRATEGY_NONE;
+ pack_options.fs_persist = -1; /* "FALSE" is set via -P 0 */
+ pack_options.fs_threshold = 1;
+ pack_options.fs_pagesize = 8192;
+ if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
- TESTING(" files with file space info setting-- options -S, -T, -G are set & -L");
- ++j; /* #7 */
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- fname = H5REPACK_FSPACE_FNAMES[j];
- if (h5repack_init(&pack_options, 0, TRUE) < 0)
- GOERROR;
- pack_options.fs_strategy = H5F_FSPACE_STRATEGY_AGGR;
- pack_options.fs_threshold = 1;
- pack_options.fs_pagesize = 4096;
- if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ TESTING(" files with file space info setting-- options -S, -T, -G are set & -L");
+ ++j; /* #7 */
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ fname = H5REPACK_FSPACE_FNAMES[j];
+ if (h5repack_init(&pack_options, 0, TRUE) < 0)
+ GOERROR;
+ pack_options.fs_strategy = H5F_FSPACE_STRATEGY_AGGR;
+ pack_options.fs_threshold = 1;
+ pack_options.fs_pagesize = 4096;
+ if (h5repack(fname, FSPACE_OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(fname, FSPACE_OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(fname, FSPACE_OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
+ }
/*-------------------------------------------------------------------------
* file with fill values
@@ -389,20 +391,22 @@ main(void)
* file with all kinds of dataset datatypes
*-------------------------------------------------------------------------
*/
- TESTING(" copy of datasets (all datatypes)");
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_cmp_pl(FNAME1, pack_options.fin_fapl, FNAME1OUT, pack_options.fout_fapl) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ if (!h5_using_parallel_driver(NULL)) {
+ TESTING(" copy of datasets (all datatypes)");
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_cmp_pl(FNAME1, pack_options.fin_fapl, FNAME1OUT, pack_options.fout_fapl) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
+ }
/*-------------------------------------------------------------------------
* file with attributes
@@ -624,7 +628,7 @@ main(void)
SKIPPED();
#endif
- TESTING(" addding shuffle filter");
+ TESTING(" adding shuffle filter");
/*-------------------------------------------------------------------------
* test an individual object option
@@ -653,7 +657,7 @@ main(void)
*-------------------------------------------------------------------------
*/
- TESTING(" addding shuffle filter to all");
+ TESTING(" adding shuffle filter to all");
if (h5repack_init(&pack_options, 0, FALSE) < 0)
GOERROR;
@@ -1487,49 +1491,53 @@ main(void)
GOERROR;
PASSED();
- /*-------------------------------------------------------------------------
- * test file with userblock
- *-------------------------------------------------------------------------
- */
- TESTING(" file with userblock");
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- if (h5repack(FNAME16, FNAME16OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(FNAME16, FNAME16OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(FNAME16, FNAME16OUT, &pack_options) <= 0)
- GOERROR;
- if (verify_userblock(FNAME16OUT) < 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ if (h5_using_default_driver(NULL)) {
+ /*-------------------------------------------------------------------------
+ * test file with userblock
+ *-------------------------------------------------------------------------
+ */
+ TESTING(" file with userblock");
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ if (h5repack(FNAME16, FNAME16OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(FNAME16, FNAME16OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(FNAME16, FNAME16OUT, &pack_options) <= 0)
+ GOERROR;
+ if (verify_userblock(FNAME16OUT) < 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
+ }
/*-------------------------------------------------------------------------
* test --latest options
*-------------------------------------------------------------------------
*/
- TESTING(" latest file format options");
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- pack_options.latest = 1;
- pack_options.grp_compact = 10;
- pack_options.grp_indexed = 5;
- pack_options.msg_size[0] = 10;
- pack_options.msg_size[1] = 20;
- pack_options.msg_size[2] = 30;
- pack_options.msg_size[3] = 40;
- pack_options.msg_size[4] = 50;
- if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ if (!h5_using_parallel_driver(NULL)) {
+ TESTING(" latest file format options");
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ pack_options.latest = 1;
+ pack_options.grp_compact = 10;
+ pack_options.grp_indexed = 5;
+ pack_options.msg_size[0] = 10;
+ pack_options.msg_size[1] = 20;
+ pack_options.msg_size[2] = 30;
+ pack_options.msg_size[3] = 40;
+ pack_options.msg_size[4] = 50;
+ if (h5repack(FNAME1, FNAME1OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
+ }
/*-------------------------------------------------------------------------
* test several global filters
@@ -1560,49 +1568,51 @@ main(void)
SKIPPED();
#endif
- /*-------------------------------------------------------------------------
- * test file with userblock
- *-------------------------------------------------------------------------
- */
- TESTING(" file with added userblock");
+ if (h5_using_default_driver(NULL)) {
+ /*-------------------------------------------------------------------------
+ * test file with userblock
+ *-------------------------------------------------------------------------
+ */
+ TESTING(" file with added userblock");
#ifdef H5_HAVE_FILTER_DEFLATE
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
- /* add the options for a user block size and user block filename */
- pack_options.ublock_size = USERBLOCK_SIZE;
- pack_options.ublock_filename = FNAME_UB;
+ /* add the options for a user block size and user block filename */
+ pack_options.ublock_size = USERBLOCK_SIZE;
+ pack_options.ublock_filename = FNAME_UB;
- if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0)
- GOERROR;
- if (verify_userblock(FNAME8OUT) < 0)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
+ if (h5repack(FNAME8, FNAME8OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0)
+ GOERROR;
+ if (verify_userblock(FNAME8OUT) < 0)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
- PASSED();
+ PASSED();
#else
- SKIPPED();
+ SKIPPED();
#endif
+ }
/*-------------------------------------------------------------------------
- * test file with aligment
+ * test file with alignment
*-------------------------------------------------------------------------
*/
- TESTING(" file with aligment");
+ TESTING(" file with alignment");
#ifdef H5_HAVE_FILTER_DEFLATE
if (h5repack_init(&pack_options, 0, FALSE) < 0)
GOERROR;
- /* add the options for aligment */
+ /* add the options for alignment */
pack_options.alignment = 1;
pack_options.threshold = 1;
@@ -1613,7 +1623,7 @@ main(void)
if (h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0)
GOERROR;
- /* verify aligment */
+ /* verify alignment */
{
hsize_t threshold;
hsize_t alignment;
@@ -1664,48 +1674,50 @@ main(void)
PASSED();
- /*-------------------------------------------------------------------------
- * test --metadata_block_size option
- * Also verify that output file using the metadata_block_size option is
- * larger than the output file one not using it.
- * FNAME4 is used because it is the same as the test file used for the
- * shell script version of this test (h5repack.sh).
- *-------------------------------------------------------------------------
- */
- TESTING(" metadata block size option");
- /* First run without metadata option. No need to verify the correctness */
- /* since this has been verified by earlier tests. Just record the file */
- /* size of the output file. */
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0)
- GOERROR;
- if (HDstat(FNAME4OUT, &file_stat) < 0)
- GOERROR;
- fsize1 = file_stat.st_size;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
+ if (h5_using_default_driver(NULL)) {
+ /*-------------------------------------------------------------------------
+ * test --metadata_block_size option
+ * Also verify that output file using the metadata_block_size option is
+ * larger than the output file one not using it.
+ * FNAME4 is used because it is the same as the test file used for the
+ * shell script version of this test (h5repack.sh).
+ *-------------------------------------------------------------------------
+ */
+ TESTING(" metadata block size option");
+ /* First run without metadata option. No need to verify the correctness */
+ /* since this has been verified by earlier tests. Just record the file */
+ /* size of the output file. */
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0)
+ GOERROR;
+ if (HDstat(FNAME4OUT, &file_stat) < 0)
+ GOERROR;
+ fsize1 = file_stat.st_size;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
- /* run it again with metadata option */
- if (h5repack_init(&pack_options, 0, FALSE) < 0)
- GOERROR;
- pack_options.meta_block_size = 8192;
- if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0)
- GOERROR;
- if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0)
- GOERROR;
- if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0)
- GOERROR;
- /* record the file size of the output file */
- if (HDstat(FNAME4OUT, &file_stat) < 0)
- GOERROR;
- fsize2 = file_stat.st_size;
- /* verify second file size is larger than the first one */
- if (fsize2 <= fsize1)
- GOERROR;
- if (h5repack_end(&pack_options) < 0)
- GOERROR;
- PASSED();
+ /* run it again with metadata option */
+ if (h5repack_init(&pack_options, 0, FALSE) < 0)
+ GOERROR;
+ pack_options.meta_block_size = 8192;
+ if (h5repack(FNAME4, FNAME4OUT, &pack_options) < 0)
+ GOERROR;
+ if (h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0)
+ GOERROR;
+ if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0)
+ GOERROR;
+ /* record the file size of the output file */
+ if (HDstat(FNAME4OUT, &file_stat) < 0)
+ GOERROR;
+ fsize2 = file_stat.st_size;
+ /* verify second file size is larger than the first one */
+ if (fsize2 <= fsize1)
+ GOERROR;
+ if (h5repack_end(&pack_options) < 0)
+ GOERROR;
+ PASSED();
+ }
/*-------------------------------------------------------------------------
* clean temporary test files
@@ -1725,7 +1737,10 @@ main(void)
return 0;
error:
+ h5tools_close();
+
puts("***** H5REPACK TESTS FAILED *****");
+
return 1;
}
@@ -1760,12 +1775,14 @@ make_testfiles(void)
* create another file for general copy test (all datatypes)
*-------------------------------------------------------------------------
*/
- if ((fid = H5Fcreate(FNAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- return -1;
- if (make_all_objects(fid) < 0)
- goto out;
- if (H5Fclose(fid) < 0)
- return -1;
+ if (!h5_using_parallel_driver(NULL)) {
+ if ((fid = H5Fcreate(FNAME1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ if (make_all_objects(fid) < 0)
+ goto out;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ }
/*-------------------------------------------------------------------------
* create a file for attributes copy test
@@ -1934,19 +1951,21 @@ make_testfiles(void)
if (H5Fclose(fid) < 0)
return -1;
- /*-------------------------------------------------------------------------
- * create a file with userblock
- *-------------------------------------------------------------------------
- */
- if (make_userblock() < 0)
- goto out;
+ if (h5_using_default_driver(NULL)) {
+ /*-------------------------------------------------------------------------
+ * create a file with userblock
+ *-------------------------------------------------------------------------
+ */
+ if (make_userblock() < 0)
+ goto out;
- /*-------------------------------------------------------------------------
- * create a userblock file
- *-------------------------------------------------------------------------
- */
- if (make_userblock_file() < 0)
- goto out;
+ /*-------------------------------------------------------------------------
+ * create a userblock file
+ *-------------------------------------------------------------------------
+ */
+ if (make_userblock_file() < 0)
+ goto out;
+ }
/*-------------------------------------------------------------------------
* create a file with named datatypes
@@ -1959,30 +1978,32 @@ make_testfiles(void)
if (H5Fclose(fid) < 0)
return -1;
- /*-------------------------------------------------------------------------
- * create obj and region reference type datasets (bug1814)
- * add attribute with int type (bug1726)
- * add attribute with obj and region reference type (bug1726)
- *-------------------------------------------------------------------------
- */
- if ((fid = H5Fcreate(FNAME_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- return -1;
- /* create reference type datasets */
- if (make_references(fid) < 0)
- goto out;
- if (H5Fclose(fid) < 0)
- return -1;
+ if (!h5_using_parallel_driver(NULL)) {
+ /*-------------------------------------------------------------------------
+ * create obj and region reference type datasets (bug1814)
+ * add attribute with int type (bug1726)
+ * add attribute with obj and region reference type (bug1726)
+ *-------------------------------------------------------------------------
+ */
+ if ((fid = H5Fcreate(FNAME_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ /* create reference type datasets */
+ if (make_references(fid) < 0)
+ goto out;
+ if (H5Fclose(fid) < 0)
+ return -1;
- /*-------------------------------------------------------------------------
- * create a file with obj and region references in attribute of compound and
- * vlen datatype
- *-------------------------------------------------------------------------*/
- if ((fid = H5Fcreate(FNAME_ATTR_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- return -1;
- if (make_complex_attr_references(fid) < 0)
- goto out;
- if (H5Fclose(fid) < 0)
- return -1;
+ /*-------------------------------------------------------------------------
+ * create a file with obj and region references in attribute of compound and
+ * vlen datatype
+ *-------------------------------------------------------------------------*/
+ if ((fid = H5Fcreate(FNAME_ATTR_REF, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
+ if (make_complex_attr_references(fid) < 0)
+ goto out;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ }
/*-------------------------------------------------------------------------
* create 8 files with combinations ???
@@ -2018,111 +2039,113 @@ make_testfiles(void)
if (H5Fclose(fid) < 0)
return -1;
- /*
- * #2 -- h5repack_page_persist.h5
- * Setting:
- * strategy=PAGE, persist=TRUE, threshold=1
- * inpage=512
- * latest format
- */
- /* Create file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- return -1;
- if (H5Pset_file_space_page_size(fcpl, (hsize_t)512) < 0)
- return -1;
- if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0)
- return -1;
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- return -1;
- if (H5Fclose(fid) < 0)
- return -1;
- if (H5Pclose(fcpl) < 0)
- return -1;
-
- /*
- * #3 -- h5repack_fsm_aggr_persist.h5
- * Setting:
- * strategy=FSM_AGGR, persist=TRUE, threshold=1
- * default: inpage=4096
- */
- /* Create file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- return -1;
- if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
- return -1;
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
- return -1;
- if (H5Fclose(fid) < 0)
- return -1;
- if (H5Pclose(fcpl) < 0)
- return -1;
-
- /*
- * #4 -- h5repack_page_threshold.h5
- * Setting:
- * strategy=PAGE, persist=FALSE, threshold=3
- * inpage=8192
- * latest format
- */
-
- /* Create file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- return -1;
- if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)3) < 0)
- return -1;
- if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0)
- return -1;
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- return -1;
- if (H5Fclose(fid) < 0)
- return -1;
- if (H5Pclose(fcpl) < 0)
- return -1;
-
- /*
- * #5 -- h5repack_fsm_aggr_threshold.h5
- * Setting:
- * strategy=FSM_AGGR, persist=FALSE, threshold=3
- * inpage=4096
- */
+ if (h5_using_default_driver(NULL)) {
+ /*
+ * #2 -- h5repack_page_persist.h5
+ * Setting:
+ * strategy=PAGE, persist=TRUE, threshold=1
+ * inpage=512
+ * latest format
+ */
+ /* Create file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ return -1;
+ if (H5Pset_file_space_page_size(fcpl, (hsize_t)512) < 0)
+ return -1;
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0)
+ return -1;
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ return -1;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ if (H5Pclose(fcpl) < 0)
+ return -1;
+
+ /*
+ * #3 -- h5repack_fsm_aggr_persist.h5
+ * Setting:
+ * strategy=FSM_AGGR, persist=TRUE, threshold=1
+ * default: inpage=4096
+ */
+ /* Create file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ return -1;
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
+ return -1;
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
+ return -1;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ if (H5Pclose(fcpl) < 0)
+ return -1;
+
+ /*
+ * #4 -- h5repack_page_threshold.h5
+ * Setting:
+ * strategy=PAGE, persist=FALSE, threshold=3
+ * inpage=8192
+ * latest format
+ */
- /* Create file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- return -1;
- if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)3) < 0)
- return -1;
- if (H5Pset_file_space_page_size(fcpl, (hsize_t)FS_PAGESIZE_DEF) < 0)
- return -1;
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
- return -1;
- if (H5Fclose(fid) < 0)
- return -1;
- if (H5Pclose(fcpl) < 0)
- return -1;
+ /* Create file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ return -1;
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)3) < 0)
+ return -1;
+ if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0)
+ return -1;
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ return -1;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ if (H5Pclose(fcpl) < 0)
+ return -1;
+
+ /*
+ * #5 -- h5repack_fsm_aggr_threshold.h5
+ * Setting:
+ * strategy=FSM_AGGR, persist=FALSE, threshold=3
+ * inpage=4096
+ */
- /*
- * #6 -- h5repack_aggr.h5
- * Setting:
- * strategy=AGGR, persist=FALSE, threshold=1
- * latest format
- */
+ /* Create file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ return -1;
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)3) < 0)
+ return -1;
+ if (H5Pset_file_space_page_size(fcpl, (hsize_t)FS_PAGESIZE_DEF) < 0)
+ return -1;
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0)
+ return -1;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ if (H5Pclose(fcpl) < 0)
+ return -1;
+
+ /*
+ * #6 -- h5repack_aggr.h5
+ * Setting:
+ * strategy=AGGR, persist=FALSE, threshold=1
+ * latest format
+ */
- /* Create file creation property list */
- if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- return -1;
- if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_AGGR, FALSE, (hsize_t)1) < 0)
- return -1;
- HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
- if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- return -1;
- if (H5Fclose(fid) < 0)
- return -1;
- if (H5Pclose(fcpl) < 0)
- return -1;
+ /* Create file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ return -1;
+ if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_AGGR, FALSE, (hsize_t)1) < 0)
+ return -1;
+ HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES));
+ if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ return -1;
+ if (H5Fclose(fid) < 0)
+ return -1;
+ if (H5Pclose(fcpl) < 0)
+ return -1;
+ }
/*
* #7 -- h5repack_none.h5
@@ -2432,14 +2455,15 @@ make_szip(hid_t loc_id)
unsigned szip_pixels_per_block = 8;
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
int szip_can_encode = 0;
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2463,7 +2487,7 @@ make_szip(hid_t loc_id)
/* set szip data */
if (H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block) < 0)
goto error;
- if (make_dset(loc_id, "dset_szip", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_szip", sid, dcpl, buf) < 0)
goto error;
}
else
@@ -2506,15 +2530,16 @@ make_deflate(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
hobj_ref_t bufref[1]; /* reference */
hsize_t dims1r[1] = {1};
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2534,7 +2559,7 @@ make_deflate(hid_t loc_id)
/* set deflate data */
if (H5Pset_deflate(dcpl, 9) < 0)
goto error;
- if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf) < 0)
goto error;
/* create a reference to the dataset, test second seeep of file for references */
@@ -2585,13 +2610,14 @@ make_shuffle(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2611,7 +2637,7 @@ make_shuffle(hid_t loc_id)
/* set the shuffle filter */
if (H5Pset_shuffle(dcpl) < 0)
goto error;
- if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -2654,13 +2680,14 @@ make_fletcher32(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2683,7 +2710,7 @@ make_fletcher32(hid_t loc_id)
/* set the checksum filter */
if (H5Pset_fletcher32(dcpl) < 0)
goto error;
- if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -2726,15 +2753,17 @@ make_nbit(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hid_t dtid = H5I_INVALID_HID;
hid_t dsid = H5I_INVALID_HID;
+ hid_t dxpl = H5P_DEFAULT;
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2746,6 +2775,16 @@ make_nbit(hid_t loc_id)
if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto error;
+#ifdef H5_HAVE_PARALLEL
+ /* Set up collective writes for parallel driver */
+ if (h5_using_parallel_driver(NULL)) {
+ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+ if (H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE) < 0)
+ goto error;
+ }
+#endif
+
dtid = H5Tcopy(H5T_NATIVE_INT);
if (H5Tset_precision(dtid, (H5Tget_precision(dtid) - 1)) < 0)
goto error;
@@ -2757,7 +2796,7 @@ make_nbit(hid_t loc_id)
goto error;
if ((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, dxpl, buf) < 0)
goto error;
H5Dclose(dsid);
@@ -2765,7 +2804,7 @@ make_nbit(hid_t loc_id)
goto error;
if ((dsid = H5Dcreate2(loc_id, "dset_int31", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, dxpl, buf) < 0)
goto error;
H5Dclose(dsid);
@@ -2773,6 +2812,8 @@ make_nbit(hid_t loc_id)
* close
*-------------------------------------------------------------------------
*/
+ if (dxpl != H5P_DEFAULT && H5Pclose(dxpl) < 0)
+ goto error;
if (H5Sclose(sid) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
@@ -2788,6 +2829,7 @@ error:
H5E_BEGIN_TRY
{
H5Tclose(dtid);
+ H5Pclose(dxpl);
H5Pclose(dcpl);
H5Sclose(sid);
H5Dclose(dsid);
@@ -2813,15 +2855,17 @@ make_scaleoffset(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hid_t dtid = H5I_INVALID_HID;
hid_t dsid = H5I_INVALID_HID;
+ hid_t dxpl = H5P_DEFAULT;
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2833,6 +2877,16 @@ make_scaleoffset(hid_t loc_id)
if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto error;
+#ifdef H5_HAVE_PARALLEL
+ /* Set up collective writes for parallel driver */
+ if (h5_using_parallel_driver(NULL)) {
+ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+ if (H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE) < 0)
+ goto error;
+ }
+#endif
+
dtid = H5Tcopy(H5T_NATIVE_INT);
/* remove the filters from the dcpl */
@@ -2842,20 +2896,22 @@ make_scaleoffset(hid_t loc_id)
goto error;
if ((dsid = H5Dcreate2(loc_id, "dset_scaleoffset", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, dxpl, buf) < 0)
goto error;
H5Dclose(dsid);
if ((dsid = H5Dcreate2(loc_id, "dset_none", dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, dxpl, buf) < 0)
goto error;
H5Tclose(dtid);
H5Dclose(dsid);
/*-------------------------------------------------------------------------
- * close space and dcpl
+ * close space, dxpl and dcpl
*-------------------------------------------------------------------------
*/
+ if (dxpl != H5P_DEFAULT && H5Pclose(dxpl) < 0)
+ goto error;
if (H5Sclose(sid) < 0)
goto error;
if (H5Pclose(dcpl) < 0)
@@ -2868,6 +2924,7 @@ make_scaleoffset(hid_t loc_id)
error:
H5E_BEGIN_TRY
{
+ H5Pclose(dxpl);
H5Dclose(dsid);
H5Tclose(dtid);
H5Pclose(dcpl);
@@ -2894,22 +2951,24 @@ make_all_filters(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hid_t dtid = H5I_INVALID_HID;
hid_t dsid = H5I_INVALID_HID;
+ hid_t dxpl = H5P_DEFAULT;
#if defined(H5_HAVE_FILTER_SZIP)
unsigned szip_options_mask = H5_SZIP_ALLOW_K13_OPTION_MASK | H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block = 8;
#endif /* H5_HAVE_FILTER_SZIP */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
#if defined(H5_HAVE_FILTER_SZIP)
int szip_can_encode = 0;
#endif
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/* create a space */
if ((sid = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -2921,6 +2980,16 @@ make_all_filters(hid_t loc_id)
if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto error;
+#ifdef H5_HAVE_PARALLEL
+ /* Set up collective writes for parallel driver */
+ if (h5_using_parallel_driver(NULL)) {
+ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+ if (H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE) < 0)
+ goto error;
+ }
+#endif
+
/* set the shuffle filter */
if (H5Pset_shuffle(dcpl) < 0)
goto error;
@@ -2949,7 +3018,7 @@ make_all_filters(hid_t loc_id)
goto error;
#endif
- if (make_dset(loc_id, "dset_all", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_all", sid, dcpl, buf) < 0)
goto error;
/* remove the filters from the dcpl */
@@ -2958,7 +3027,7 @@ make_all_filters(hid_t loc_id)
/* set the checksum filter */
if (H5Pset_fletcher32(dcpl) < 0)
goto error;
- if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_fletcher32", sid, dcpl, buf) < 0)
goto error;
/* Make sure encoding is enabled */
@@ -2970,7 +3039,7 @@ make_all_filters(hid_t loc_id)
/* set szip data */
if (H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block) < 0)
goto error;
- if (make_dset(loc_id, "dset_szip", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_szip", sid, dcpl, buf) < 0)
goto error;
}
else {
@@ -2984,7 +3053,7 @@ make_all_filters(hid_t loc_id)
/* set the shuffle filter */
if (H5Pset_shuffle(dcpl) < 0)
goto error;
- if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_shuffle", sid, dcpl, buf) < 0)
goto error;
#if defined(H5_HAVE_FILTER_DEFLATE)
@@ -2994,7 +3063,7 @@ make_all_filters(hid_t loc_id)
/* set deflate data */
if (H5Pset_deflate(dcpl, 1) < 0)
goto error;
- if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_deflate", sid, dcpl, buf) < 0)
goto error;
#endif
@@ -3010,7 +3079,7 @@ make_all_filters(hid_t loc_id)
goto error;
if ((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, dxpl, buf) < 0)
goto error;
/* close */
@@ -3021,6 +3090,8 @@ make_all_filters(hid_t loc_id)
if (H5Sclose(sid) < 0)
goto error;
+ if (dxpl != H5P_DEFAULT && H5Pclose(dxpl) < 0)
+ goto error;
if (H5Pclose(dcpl) < 0)
goto error;
@@ -3033,6 +3104,7 @@ error:
{
H5Tclose(dtid);
H5Dclose(dsid);
+ H5Pclose(dxpl);
H5Pclose(dcpl);
H5Sclose(sid);
}
@@ -3152,15 +3224,16 @@ make_layout(hid_t loc_id)
hid_t sid = H5I_INVALID_HID; /* dataspace ID */
hsize_t dims[RANK] = {DIM1, DIM2};
hsize_t chunk_dims[RANK] = {CDIM1, CDIM2};
- int ** buf = NULL;
int i;
char name[16];
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, DIM1, DIM2);
+ struct {
+ int arr[DIM1][DIM2];
+ } *buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
- H5TEST_FILL_2D_ARRAY(buf, int, DIM1, DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf, int);
/*-------------------------------------------------------------------------
* make several dataset with no filters
@@ -3168,7 +3241,7 @@ make_layout(hid_t loc_id)
*/
for (i = 0; i < 4; i++) {
HDsprintf(name, "dset%d", i + 1);
- if (write_dset(loc_id, RANK, dims, name, H5T_NATIVE_INT, buf[0]) < 0)
+ if (write_dset(loc_id, RANK, dims, name, H5T_NATIVE_INT, buf) < 0)
goto error;
}
@@ -3189,7 +3262,7 @@ make_layout(hid_t loc_id)
*/
if (H5Pset_layout(dcpl, H5D_COMPACT) < 0)
goto error;
- if (make_dset(loc_id, "dset_compact", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_compact", sid, dcpl, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -3198,7 +3271,7 @@ make_layout(hid_t loc_id)
*/
if (H5Pset_layout(dcpl, H5D_CONTIGUOUS) < 0)
goto error;
- if (make_dset(loc_id, "dset_contiguous", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_contiguous", sid, dcpl, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -3207,7 +3280,7 @@ make_layout(hid_t loc_id)
*/
if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0)
goto error;
- if (make_dset(loc_id, "dset_chunk", sid, dcpl, buf[0]) < 0)
+ if (make_dset(loc_id, "dset_chunk", sid, dcpl, buf) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -3264,13 +3337,13 @@ make_layout2(hid_t loc_id)
hsize_t s_dims[RANK] = {S_DIM1, S_DIM2}; /* Dataspace (< 1 k) */
hsize_t chunk_dims[RANK] = {S_DIM1 / 2, S_DIM2 / 2}; /* Dimension sizes for chunks */
- int **s_buf = NULL; /* Temporary buffer */
-
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(s_buf, int, S_DIM1, S_DIM2);
+ struct {
+ int arr[S_DIM1][S_DIM2];
+ } *s_buf = malloc(sizeof(*s_buf));
if (NULL == s_buf)
goto error;
- H5TEST_FILL_2D_ARRAY(s_buf, int, S_DIM1, S_DIM2);
+ H5TEST_FILL_2D_HEAP_ARRAY(s_buf, int);
/* Create dataspaces */
if ((s_sid = H5Screate_simple(RANK, s_dims, NULL)) < 0)
@@ -3281,7 +3354,7 @@ make_layout2(hid_t loc_id)
goto error;
if (H5Pset_layout(contig_dcpl, H5D_CONTIGUOUS) < 0)
goto error;
- if (make_dset(loc_id, CONTIG_S, s_sid, contig_dcpl, s_buf[0]) < 0)
+ if (make_dset(loc_id, CONTIG_S, s_sid, contig_dcpl, s_buf) < 0)
goto error;
/* Create chunked datasets */
@@ -3289,7 +3362,7 @@ make_layout2(hid_t loc_id)
goto error;
if (H5Pset_chunk(chunked_dcpl, RANK, chunk_dims) < 0)
goto error;
- if (make_dset(loc_id, CHUNKED_S_FIX, s_sid, chunked_dcpl, s_buf[0]) < 0)
+ if (make_dset(loc_id, CHUNKED_S_FIX, s_sid, chunked_dcpl, s_buf) < 0)
goto error;
ret_value = 0;
@@ -3343,19 +3416,21 @@ make_layout3(hid_t loc_id)
hsize_t chunk_dims1[RANK] = {DIM1_L3 * 2, 5};
hsize_t chunk_dims2[RANK] = {SDIM1_L3 + 2, SDIM2_L3 / 2};
hsize_t chunk_dims3[RANK] = {SDIM1_L3 - 2, SDIM2_L3 / 2};
- int ** buf1 = NULL;
- int ** buf2 = NULL;
- /* Create and fill arrays */
- H5TEST_ALLOCATE_2D_ARRAY(buf1, int, DIM1_L3, DIM2_L3);
- if (NULL == buf1)
- goto error;
- H5TEST_FILL_2D_ARRAY(buf1, int, DIM1_L3, DIM2_L3);
+ /* Create arrays */
+ struct {
+ int arr[DIM1_L3][DIM2_L3];
+ } *buf1 = malloc(sizeof(*buf1));
+ struct {
+ int arr[SDIM1_L3][SDIM2_L3];
+ } *buf2 = malloc(sizeof(*buf2));
- H5TEST_ALLOCATE_2D_ARRAY(buf2, int, SDIM1_L3, SDIM2_L3);
- if (NULL == buf2)
+ if (NULL == buf1 || NULL == buf2)
goto error;
- H5TEST_FILL_2D_ARRAY(buf2, int, SDIM1_L3, SDIM2_L3);
+
+ /* Fill arrays */
+ H5TEST_FILL_2D_HEAP_ARRAY(buf1, int);
+ H5TEST_FILL_2D_HEAP_ARRAY(buf2, int);
/*-------------------------------------------------------------------------
* make chunked dataset with
@@ -3373,7 +3448,7 @@ make_layout3(hid_t loc_id)
if (H5Pset_chunk(dcpl1, RANK, chunk_dims1) < 0)
goto error;
- if (make_dset(loc_id, "chunk_unlimit1", sid1, dcpl1, buf1[0]) < 0)
+ if (make_dset(loc_id, "chunk_unlimit1", sid1, dcpl1, buf1) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -3394,7 +3469,7 @@ make_layout3(hid_t loc_id)
if (H5Pset_chunk(dcpl2, RANK, chunk_dims2) < 0)
goto error;
- if (make_dset(loc_id, "chunk_unlimit2", sid2, dcpl2, buf2[0]) < 0)
+ if (make_dset(loc_id, "chunk_unlimit2", sid2, dcpl2, buf2) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -3411,7 +3486,7 @@ make_layout3(hid_t loc_id)
if (H5Pset_chunk(dcpl3, RANK, chunk_dims3) < 0)
goto error;
- if (make_dset(loc_id, "chunk_unlimit3", sid2, dcpl3, buf2[0]) < 0)
+ if (make_dset(loc_id, "chunk_unlimit3", sid2, dcpl3, buf2) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -5802,11 +5877,25 @@ out:
static int
make_dset(hid_t loc_id, const char *name, hid_t sid, hid_t dcpl, void *buf)
{
- hid_t did = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t dxpl_id = H5P_DEFAULT;
if ((did = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
return -1;
- if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+
+#ifdef H5_HAVE_PARALLEL
+ /* Set up collective writes for parallel driver */
+ if (h5_using_parallel_driver(NULL)) {
+ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto out;
+ if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0)
+ goto out;
+ }
+#endif
+
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0)
+ goto out;
+ if (dxpl_id != H5P_DEFAULT && H5Pclose(dxpl_id) < 0)
goto out;
if (H5Dclose(did) < 0)
return -1;
@@ -5835,17 +5924,30 @@ out:
static int
write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t tid, void *buf)
{
- hid_t did = H5I_INVALID_HID;
- hid_t sid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t dxpl_id = H5P_DEFAULT;
if ((sid = H5Screate_simple(rank, dims, NULL)) < 0)
return -1;
if ((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (buf) {
- if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+#ifdef H5_HAVE_PARALLEL
+ /* Set up collective writes for parallel driver */
+ if (h5_using_parallel_driver(NULL)) {
+ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto out;
+ if (H5Pset_dxpl_mpio(dxpl_id, H5FD_MPIO_COLLECTIVE) < 0)
+ goto out;
+ }
+#endif
+
+ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0)
goto out;
}
+ if (dxpl_id != H5P_DEFAULT && H5Pclose(dxpl_id) < 0)
+ goto out;
if (H5Dclose(did) < 0)
goto out;
if (H5Sclose(sid) < 0)
@@ -5856,6 +5958,7 @@ write_dset(hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t t
out:
H5E_BEGIN_TRY
{
+ H5Pclose(dxpl_id);
H5Dclose(did);
H5Sclose(sid);
}
@@ -6244,7 +6347,7 @@ gen_refered_objs(hid_t loc_id)
goto out;
}
- /* create normal dataset which is refered */
+ /* create normal dataset which is referred */
did2 = H5Dcreate2(loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did2 < 0) {
HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__);
@@ -6284,7 +6387,7 @@ out:
* Generate object references to objects (dataset,group and named datatype)
*
* Note:
- * copied from h5copygentest.c and upate to create named datatype
+ * copied from h5copygentest.c and update to create named datatype
*
* Programmer: Jonathan Kim (March 18, 2010)
*------------------------------------------------------------------------*/
diff --git a/tools/test/h5repack/testfiles/README b/tools/test/h5repack/testfiles/README
index 4096dee..4cb66f4 100644
--- a/tools/test/h5repack/testfiles/README
+++ b/tools/test/h5repack/testfiles/README
@@ -1,5 +1,5 @@
h5repack_nested_8bit_enum_deflated.h5:
h5repack_nested_8bit_enum.h5:
- enuberated 8bit type nested in compount type. Original file provided
+ enuberated 8bit type nested in compound type. Original file provided
by a user (HDFFV-8667) as a test file. Used h5copy to extract only the
Compound type dataset. The non-deflated version is produced by h5repack.
diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt
index cb10d22..bff70af 100644
--- a/tools/test/h5repack/testfiles/h5repack-help.txt
+++ b/tools/test/h5repack/testfiles/h5repack-help.txt
@@ -1,13 +1,15 @@
usage: h5repack [OPTIONS] file1 file2
file1 Input HDF5 File
file2 Output HDF5 File
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
OPTIONS
-h, --help Print a usage message and exit
- -v, --verbose Verbose mode, print object information
+ -v N, --verbose=N Verbose mode, print object information.
+ N - is an integer greater than 1, 2 displays read/write timing
-V, --version Print version number and exit
-n, --native Use a native HDF5 type when repacking
- --enable-error-stack Prints messages from the HDF5 error stack as they
- occur
--src-vol-value Value (ID) of the VOL connector to use for opening the
input HDF5 file specified
--src-vol-name Name of the VOL connector to use for opening the input
@@ -20,6 +22,18 @@ usage: h5repack [OPTIONS] file1 file2
HDF5 file specified
--dst-vol-info VOL-specific info to pass to the VOL connector used for
opening the output HDF5 file specified
+ --src-vfd-value Value (ID) of the VFL driver to use for opening the
+ input HDF5 file specified
+ --src-vfd-name Name of the VFL driver to use for opening the input
+ HDF5 file specified
+ --src-vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the input HDF5 file specified
+ --dst-vfd-value Value (ID) of the VFL driver to use for opening the
+ output HDF5 file specified
+ --dst-vfd-name Name of the VFL driver to use for opening the output
+ HDF5 file specified
+ --dst-vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the output HDF5 file specified
-L, --latest Use latest version of file format
This option will take precedence over the options
--low and --high
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
index eeb0f2d..0992a0c 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
@@ -11,7 +11,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -33,7 +33,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -55,7 +55,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -77,7 +77,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -99,7 +99,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -121,7 +121,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
@@ -143,7 +143,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 13 0 }
+ PARAMS { 9 1 13 2 }
}
}
FILLVALUE {
diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl
index 2ba7772..1f65f0d 100644
--- a/tools/test/h5stat/testfiles/h5stat_help1.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl
@@ -1,5 +1,8 @@
Usage: h5stat [OPTIONS] file
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur
+ Optional value 2 also prints file open errors
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
@@ -22,7 +25,6 @@ Usage: h5stat [OPTIONS] file
than 0. The default threshold is 10.
-s, --freespace Print free space information
-S, --summary Print summary of file space information
- --enable-error-stack Prints messages from the HDF5 error stack as they occur
--s3-cred=<cred> Access file on S3, using provided credential
<cred> :: (region,id,key)
If <cred> == "(,,)", no authentication is used.
diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl
index 2ba7772..1f65f0d 100644
--- a/tools/test/h5stat/testfiles/h5stat_help2.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl
@@ -1,5 +1,8 @@
Usage: h5stat [OPTIONS] file
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur
+ Optional value 2 also prints file open errors
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
@@ -22,7 +25,6 @@ Usage: h5stat [OPTIONS] file
than 0. The default threshold is 10.
-s, --freespace Print free space information
-S, --summary Print summary of file space information
- --enable-error-stack Prints messages from the HDF5 error stack as they occur
--s3-cred=<cred> Access file on S3, using provided credential
<cred> :: (region,id,key)
If <cred> == "(,,)", no authentication is used.
diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
index 2ba7772..1f65f0d 100644
--- a/tools/test/h5stat/testfiles/h5stat_nofile.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
@@ -1,5 +1,8 @@
Usage: h5stat [OPTIONS] file
+ ERROR
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur
+ Optional value 2 also prints file open errors
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
@@ -22,7 +25,6 @@ Usage: h5stat [OPTIONS] file
than 0. The default threshold is 10.
-s, --freespace Print free space information
-S, --summary Print summary of file space information
- --enable-error-stack Prints messages from the HDF5 error stack as they occur
--s3-cred=<cred> Access file on S3, using provided credential
<cred> :: (region,id,key)
If <cred> == "(,,)", no authentication is used.
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
index 647f06a..1b4e504 100644
--- a/tools/test/h5stat/testh5stat.sh.in
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -13,7 +13,7 @@
#
# Tests for the h5stat tool
#
-# Modifcations:
+# Modifications:
# Vailin Choi; July 2013
# Add tests for -l, -m, -a options
#
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 53fbc42..97feabd 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -16,7 +16,7 @@
/* The HDF5 test files */
const char *FILENAME[] = {
"h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */
- "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */
+ "h5clear_log_v3.h5", /* 1 -- log file with superblock version 3 */
"h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */
"h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */
};
@@ -56,24 +56,26 @@ const char *FILENAME_ENHANCE[] = {
static int
gen_cache_image_file(const char *fname)
{
- hid_t fid = H5I_INVALID_HID; /* File ID */
- hid_t did = -1, sid = H5I_INVALID_HID; /* Dataset ID, dataspace ID */
- hid_t fapl = H5I_INVALID_HID; /* File access property list */
- hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
- hsize_t dims[2]; /* Dimension sizes */
- hsize_t chunks[2]; /* Chunked dimension sizes */
- int i, j; /* Local index variables */
- int ** buf = NULL; /* Buffer for data to write */
- H5AC_cache_image_config_t cache_image_config = /* Cache image input configuration */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = -1, sid = H5I_INVALID_HID; /* Dataset ID, dataspace ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hsize_t dims[2]; /* Dimension sizes */
+ hsize_t chunks[2]; /* Chunked dimension sizes */
+ int i, j; /* Local index variables */
+ struct {
+ int arr[50][100];
+ } * buf; /* Buffer for data to write */
+ H5AC_cache_image_config_t cache_image_config = /* Cache image input configuration */
{H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE, H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE};
/* Create and fill array */
- H5TEST_ALLOCATE_2D_ARRAY(buf, int, 50, 100);
+ buf = malloc(sizeof(*buf));
if (NULL == buf)
goto error;
for (i = 0; i < 50; i++)
for (j = 0; j < 100; j++)
- buf[i][j] = i * j;
+ buf->arr[i][j] = i * j;
/* Create a copy of file access property list */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -108,7 +110,7 @@ gen_cache_image_file(const char *fname)
goto error;
/* Write to the dataset */
- if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
/* Closing */
@@ -426,7 +428,7 @@ main(void)
if ((my_fapl = H5Pcopy(fapl2)) < 0)
goto error;
/* Create the file */
- HDsprintf(fname, "%s%s", new_format ? "latest_" : "", FILENAME[0]);
+ HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[0]);
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT,
my_fapl)) < 0)
goto error;
@@ -451,7 +453,7 @@ main(void)
goto error;
/* Create the file */
- HDsprintf(fname, "%s%s", new_format ? "latest_" : "", FILENAME[1]);
+ HDsnprintf(fname, sizeof(fname), "%s%s", new_format ? "latest_" : "", FILENAME[1]);
if ((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT,
my_fapl)) < 0)
goto error;
diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c
index 332e49c..248fd92 100644
--- a/tools/test/misc/h5perf_gentest.c
+++ b/tools/test/misc/h5perf_gentest.c
@@ -255,9 +255,9 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz
buf_vlen_s = (char **)calloc(dim0, sizeof(char *));
buf_str = malloc(dim0 * sizeof(*buf_str));
- /* allocate array of doulbe pointers */
+ /* allocate array of double pointers */
buf_double2d = (double **)calloc(dims2d[0], sizeof(double *));
- /* allocate a contigous chunk of memory for the data */
+ /* allocate a contiguous chunk of memory for the data */
buf_double2d[0] = (double *)calloc(dims2d[0] * dims2d[1], sizeof(double));
/* assign memory city to pointer array */
for (i = 1; i < dims2d[0]; i++)
@@ -396,7 +396,7 @@ create_perf_test_file(const char *fname, int ngrps, int ndsets, int nattrs, hsiz
H5Dclose(did);
/* 6 add compound data */
- HDsprintf(name, "%05d compund data", j);
+ HDsprintf(name, "%05d compound data", j);
did = H5Dcreate(gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
H5Dwrite(did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
if (!j)
diff --git a/tools/test/misc/testfiles/h5mkgrp_help.txt b/tools/test/misc/testfiles/h5mkgrp_help.txt
index 9525230..5d81b34 100644
--- a/tools/test/misc/testfiles/h5mkgrp_help.txt
+++ b/tools/test/misc/testfiles/h5mkgrp_help.txt
@@ -11,4 +11,10 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index ad9bf09..832447e 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -81,7 +81,7 @@ counter(unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
static void
cleanup(void)
{
- if (!getenv("HDF5_NOCLEANUP")) {
+ if (!getenv(HDF5_NOCLEANUP)) {
remove(FILENAME);
}
}
@@ -98,7 +98,9 @@ create_dset1(hid_t file)
hid_t dcpl = H5I_INVALID_HID;
hsize_t dims[RANK] = {DSET1_DIM1, DSET1_DIM2};
hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2};
- int ** data = NULL; /* data for writing */
+ struct {
+ int arr[DSET1_DIM1][DSET1_DIM2];
+ } *data = malloc(sizeof(*data));
/* Create the data space. */
if ((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -122,9 +124,8 @@ create_dset1(hid_t file)
0)
goto error;
- /* Create & fill array */
- H5TEST_ALLOCATE_2D_ARRAY(data, int, DSET1_DIM1, DSET1_DIM2);
- H5TEST_FILL_2D_ARRAY(data, int, DSET1_DIM1, DSET1_DIM2);
+ /* Fill array */
+ H5TEST_FILL_2D_HEAP_ARRAY(data, int);
/* Write data to dataset */
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
@@ -162,7 +163,9 @@ create_dset2(hid_t file)
hid_t dcpl = H5I_INVALID_HID;
hsize_t dims[RANK] = {DSET2_DIM1, DSET2_DIM2};
hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2};
- int ** data = NULL; /* data for writing */
+ struct {
+ int arr[DSET2_DIM1][DSET2_DIM2];
+ } *data = malloc(sizeof(*data));
/* Create the data space. */
if ((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0)
@@ -185,9 +188,8 @@ create_dset2(hid_t file)
0)
goto error;
- /* Create & fill array */
- H5TEST_ALLOCATE_2D_ARRAY(data, int, DSET2_DIM1, DSET2_DIM2);
- H5TEST_FILL_2D_ARRAY(data, int, DSET2_DIM1, DSET2_DIM2);
+ /* Fill array */
+ H5TEST_FILL_2D_HEAP_ARRAY(data, int);
/* Write data to dataset */
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c
index 371c4f9..1d7756b 100644
--- a/tools/test/perform/direct_write_perf.c
+++ b/tools/test/perform/direct_write_perf.c
@@ -625,7 +625,7 @@ test_unix_write(void)
TEST_ERROR;
}
else if (op_size == 0) {
- printf(" unable to write sufficent data to file because %s \n", strerror(errno));
+ printf(" unable to write sufficient data to file because %s \n", strerror(errno));
TEST_ERROR;
}
}
@@ -655,7 +655,7 @@ main(void)
hid_t fapl = H5P_DEFAULT;
int i;
- sprintf(filename, "%s.h5", FILENAME[0]);
+ snprintf(filename, sizeof(filename), "%s.h5", FILENAME[0]);
create_file(fapl);
test_direct_write_uncompressed_data(fapl);
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index 64192ba..c974928 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -119,7 +119,7 @@ usage(const char *prog)
static void
cleanup(void)
{
- if (!getenv("HDF5_NOCLEANUP")) {
+ if (!getenv(HDF5_NOCLEANUP)) {
remove(FILE_NAME_1);
}
}
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index d8ed9ec..ad76711 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -304,7 +304,7 @@ create_dsets(hid_t file)
* Create a dataset using the default dataset creation properties.
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
goto error;
@@ -366,14 +366,14 @@ create_attrs_1(void)
* Create all(user specifies the number) attributes for each dataset
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
open_t.start = retrieve_time();
if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for (j = 0; j < NUM_ATTRS; j++) {
- HDsprintf(attr_name, "all attrs for each dset %d", j);
+ HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -468,7 +468,7 @@ create_attrs_2(void)
* Create all(user specifies the number) attributes for each new dataset
*/
for (i = 0; i < NUM_DSETS; i++) {
- HDsprintf(dset_name, "dataset %d", i);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", i);
create_t.start = retrieve_time();
if ((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -476,7 +476,7 @@ create_attrs_2(void)
perf(&create_t, create_t.start, retrieve_time());
for (j = 0; j < NUM_ATTRS; j++) {
- HDsprintf(attr_name, "all attrs for each dset %d", j);
+ HDsnprintf(attr_name, sizeof(attr_name), "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
@@ -579,14 +579,14 @@ create_attrs_3(void)
for (i = 0; i < loop_num; i++) {
for (j = 0; j < NUM_DSETS; j++) {
- HDsprintf(dset_name, "dataset %d", j);
+ HDsnprintf(dset_name, sizeof(dset_name), "dataset %d", j);
open_t.start = retrieve_time();
if ((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for (k = 0; k < BATCH_ATTRS; k++) {
- HDsprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ HDsnprintf(attr_name, sizeof(attr_name), "some attrs for each dset %d %d", i, k);
attr_t.start = retrieve_time();
if ((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index 032bfba..a074d2c 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -92,7 +92,7 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o
sp = 1;
}
else {
- register char *cp; /* pointer into current token */
+ char *cp; /* pointer into current token */
/* short command line option */
opt_opt = argv[H5_optind][sp];
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index f1fb946..e64a765 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -461,7 +461,8 @@ struct h5_long_options {
*/
};
-extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
+extern int H5_get_option(int argc, const char *const *argv, const char *opt,
+ const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c
index 7c22b53..353dad3 100644
--- a/tools/test/perform/sio_standalone.c
+++ b/tools/test/perform/sio_standalone.c
@@ -92,7 +92,7 @@ get_option(int argc, const char **argv, const char *opts, const struct h5_long_o
sp = 1;
}
else {
- register char *cp; /* pointer into current token */
+ char *cp; /* pointer into current token */
/* short command line option */
opt_opt = argv[H5_optind][sp];
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index 99cca75..57180e5 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -476,7 +476,8 @@ struct h5_long_options {
*/
};
-extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt);
+extern int H5_get_option(int argc, const char *const *argv, const char *opt,
+ const struct h5_long_options *l_opt);
extern int nCols; /*max number of columns for outputting */
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index 123fb98..87a7122 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -103,7 +103,7 @@ error(const char *fmt, ...)
static void
cleanup(void)
{
- if (!HDgetenv("HDF5_NOCLEANUP"))
+ if (!HDgetenv(HDF5_NOCLEANUP))
HDunlink(filename);
HDfree(filename);
}
@@ -267,7 +267,7 @@ usage(void)
HDfprintf(stdout, " data you want [default: 0]");
HDfprintf(stdout, " -s S, --file-size=S Maximum size of uncompressed file [default: 64M]\n");
HDfprintf(stdout, " -B S, --max-buffer_size=S Maximum size of buffer [default: 1M]\n");
- HDfprintf(stdout, " -b S, --min-buffer_size=S Minumum size of buffer [default: 128K]\n");
+ HDfprintf(stdout, " -b S, --min-buffer_size=S Minimum size of buffer [default: 128K]\n");
HDfprintf(stdout, " -p D, --prefix=D The directory prefix to place the file\n");
HDfprintf(stdout, " -r, --random-test Use random data to write to the file\n");
HDfprintf(stdout, " [default: no]\n");
@@ -336,8 +336,8 @@ parse_size_directive(const char *size)
static void
fill_with_random_data(Bytef *src, uLongf src_len)
{
- register unsigned u;
- h5_stat_t stat_buf;
+ unsigned u;
+ h5_stat_t stat_buf;
if (HDstat("/dev/urandom", &stat_buf) == 0) {
uLongf len = src_len;
@@ -386,7 +386,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long
Bytef * src;
for (src_len = min_buf_size; src_len <= max_buf_size; src_len <<= 1) {
- register unsigned long i, iters;
+ unsigned long i, iters;
iters = file_size / src_len;
src = (Bytef *)HDcalloc(1, sizeof(Bytef) * src_len);
@@ -489,7 +489,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long
* Modifications:
*/
int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
{
unsigned long min_buf_size = 128 * ONE_KB, max_buf_size = ONE_MB;
unsigned long file_size = 64 * ONE_MB;
@@ -500,7 +500,7 @@ main(int argc, const char *argv[])
/* Initialize h5tools lib */
h5tools_init();
- while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) {
+ while ((opt = H5_get_option(argc, (const char *const *)argv, s_opts, l_opts)) > 0) {
switch ((char)opt) {
case '0':
case '1':
@@ -551,7 +551,7 @@ main(int argc, const char *argv[])
}
if (min_buf_size > max_buf_size)
- error("minmum buffer size (%d) exceeds maximum buffer size (%d)", min_buf_size, max_buf_size);
+ error("minimum buffer size (%d) exceeds maximum buffer size (%d)", min_buf_size, max_buf_size);
HDfprintf(stdout, "Filesize: %ld\n", file_size);
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index 5b11223..e20df73 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls
index 0926c4c..6ed1aab 100644
--- a/tools/testfiles/help-1.ls
+++ b/tools/testfiles/help-1.ls
@@ -52,6 +52,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls
index 0926c4c..6ed1aab 100644
--- a/tools/testfiles/help-2.ls
+++ b/tools/testfiles/help-2.ls
@@ -52,6 +52,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls
index 0926c4c..6ed1aab 100644
--- a/tools/testfiles/help-3.ls
+++ b/tools/testfiles/help-3.ls
@@ -52,6 +52,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/pbits/tnofilename-with-packed-bits.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsIncomplete.ddl b/tools/testfiles/pbits/tpbitsIncomplete.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsIncomplete.ddl
+++ b/tools/testfiles/pbits/tpbitsIncomplete.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthExceeded.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsLengthPositive.ddl b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/pbits/tpbitsLengthPositive.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsMaxExceeded.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetExceeded.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
index 5b11223..e20df73 100644
--- a/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/pbits/tpbitsOffsetNegative.ddl
@@ -2,6 +2,10 @@ usage: h5dump [OPTIONS] files
OPTIONS
-h, --help Print a usage message and exit
-V, --version Print version number and exit
+--------------- Error Options ---------------
+ --enable-error-stack Prints messages from the HDF5 error stack as they occur.
+ Optional value 2 also prints file open errors.
+ Default setting disables any error reporting.
--------------- File Options ---------------
-n, --contents Print a list of the file contents and exit
Optional value 1 also prints attributes.
@@ -28,6 +32,12 @@ usage: h5dump [OPTIONS] files
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
--------------- Object Options ---------------
-a P, --attribute=P Print the specified attribute
If an attribute name contains a slash (/), escape the
@@ -60,8 +70,6 @@ usage: h5dump [OPTIONS] files
-m T, --format=T Set the floating point output format
-q Q, --sort_by=Q Sort groups and attributes by index Q
-z Z, --sort_order=Z Sort groups and attributes by order Z
- --enable-error-stack Prints messages from the HDF5 error stack as they occur.
- Optional value 2 also prints file open errors.
--no-compact-subset Disable compact form of subsetting and allow the use
of "[" in dataset names.
-w N, --width=N Set the number of columns of output. A value of 0 (zero)
diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls
index 0926c4c..6ed1aab 100644
--- a/tools/testfiles/textlinksrc-nodangle-1.ls
+++ b/tools/testfiles/textlinksrc-nodangle-1.ls
@@ -52,6 +52,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a
diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls
index 0926c4c..6ed1aab 100644
--- a/tools/testfiles/tgroup-1.ls
+++ b/tools/testfiles/tgroup-1.ls
@@ -52,6 +52,12 @@ usage: h5ls [OPTIONS] file[/OBJECT] [file[/[OBJECT]...]
HDF5 file specified
--vol-info VOL-specific info to pass to the VOL connector used for
opening the HDF5 file specified
+ --vfd-value Value (ID) of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-name Name of the VFL driver to use for opening the
+ HDF5 file specified
+ --vfd-info VFD-specific info to pass to the VFL driver used for
+ opening the HDF5 file specified
file/OBJECT
Each object consists of an HDF5 file name optionally followed by a