summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-08-25 22:35:34 (GMT)
committerGitHub <noreply@github.com>2021-08-25 22:35:34 (GMT)
commit8f3878de399538d5848f8ba0b98aefe0c77c8a9a (patch)
tree113e1362eb1ef3fd0e25315961ad0858d77d5c76 /tools
parentf415d6f839f35d595b77483e0788e76c652b7520 (diff)
downloadhdf5-8f3878de399538d5848f8ba0b98aefe0c77c8a9a.zip
hdf5-8f3878de399538d5848f8ba0b98aefe0c77c8a9a.tar.gz
hdf5-8f3878de399538d5848f8ba0b98aefe0c77c8a9a.tar.bz2
1.10 Merge of tools perform reorg and command line args (#960)
* Merge of tools perform reorg and command line args Also sync tools change with 1.12 * Add missing file
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5diff_array.c8
-rw-r--r--tools/lib/io_timer.h4
-rw-r--r--tools/src/CMakeLists.txt5
-rw-r--r--tools/src/Makefile.am2
-rw-r--r--tools/src/h5dump/h5dump.c78
-rw-r--r--tools/src/h5format_convert/h5format_convert.c23
-rw-r--r--tools/src/h5import/h5import.c162
-rw-r--r--tools/src/h5jam/h5jam.c12
-rw-r--r--tools/src/h5jam/h5unjam.c10
-rw-r--r--tools/src/h5perf/CMakeLists.txt103
-rw-r--r--tools/src/h5perf/Makefile.am63
-rw-r--r--tools/src/h5perf/perf.c (renamed from tools/test/perform/perf.c)359
-rw-r--r--tools/src/h5perf/pio_engine.c (renamed from tools/test/perform/pio_engine.c)2
-rw-r--r--tools/src/h5perf/pio_perf.c (renamed from tools/test/perform/pio_perf.c)251
-rw-r--r--tools/src/h5perf/pio_perf.h (renamed from tools/test/perform/pio_perf.h)11
-rw-r--r--tools/src/h5perf/sio_engine.c (renamed from tools/test/perform/sio_engine.c)2
-rw-r--r--tools/src/h5perf/sio_perf.c (renamed from tools/test/perform/sio_perf.c)138
-rw-r--r--tools/src/h5perf/sio_perf.h (renamed from tools/test/perform/sio_perf.h)2
-rw-r--r--tools/src/h5repack/h5repack_main.c6
-rw-r--r--tools/src/h5stat/h5stat.c83
-rw-r--r--tools/src/misc/CMakeLists.txt2
-rw-r--r--tools/src/misc/h5clear.c39
-rw-r--r--tools/test/h5dump/h5dumpgentest.c4
-rw-r--r--tools/test/h5jam/getub.c2
-rw-r--r--tools/test/h5jam/h5jamgentest.c378
-rw-r--r--tools/test/h5repack/h5repacktst.c4
-rw-r--r--tools/test/h5stat/CMakeTests.cmake2
-rw-r--r--tools/test/h5stat/h5stat_gentest.c145
-rw-r--r--tools/test/h5stat/testh5stat.sh.in2
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake4
-rw-r--r--tools/test/misc/testh5clear.sh.in4
-rw-r--r--tools/test/perform/CMakeLists.txt81
-rw-r--r--tools/test/perform/Makefile.am23
-rw-r--r--tools/test/perform/chunk.c2
-rw-r--r--tools/test/perform/chunk_cache.c6
-rw-r--r--tools/test/perform/direct_write_perf.c5
-rw-r--r--tools/test/perform/iopipe.c2
-rw-r--r--tools/test/perform/overhead.c6
-rw-r--r--tools/test/perform/pio_standalone.c135
-rw-r--r--tools/test/perform/pio_standalone.h16
-rw-r--r--tools/test/perform/sio_standalone.h16
-rw-r--r--tools/test/perform/zip_perf.c53
42 files changed, 1183 insertions, 1072 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index c79dd7e..657bf3c 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -104,9 +104,9 @@ static hbool_t not_comparable;
per = -1; \
not_comparable = FALSE; \
both_zero = FALSE; \
- if (H5_DBL_ABS_EQUAL(0, (double)A) && H5_DBL_ABS_EQUAL(0, (double)B)) \
+ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \
both_zero = TRUE; \
- if (!H5_DBL_ABS_EQUAL(0, (double)A)) \
+ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \
per = (double)ABS((double)((B) - (A)) / (double)(A)); \
else \
not_comparable = TRUE; \
@@ -117,9 +117,9 @@ static hbool_t not_comparable;
per = -1; \
not_comparable = FALSE; \
both_zero = FALSE; \
- if (H5_DBL_ABS_EQUAL(0, (double)A) && H5_DBL_ABS_EQUAL(0, (double)B)) \
+ if (H5_DBL_ABS_EQUAL(0, (double)(A)) && H5_DBL_ABS_EQUAL(0, (double)(B))) \
both_zero = TRUE; \
- if (!H5_DBL_ABS_EQUAL(0, (double)A)) \
+ if (!H5_DBL_ABS_EQUAL(0, (double)(A))) \
per = ABS((double)((TYPE)((B) - (A))) / (double)(A)); \
else \
not_comparable = TRUE; \
diff --git a/tools/lib/io_timer.h b/tools/lib/io_timer.h
index 0976804..02951e1b 100644
--- a/tools/lib/io_timer.h
+++ b/tools/lib/io_timer.h
@@ -25,9 +25,9 @@
#include <time.h>
#endif
-#ifdef H5_HAVE_WIN32_API
+#ifdef H5_HAVE_WINSOCK2_H
#include <winsock2.h>
-#endif /* H5_HAVE_WINSOCK2_H */
+#endif
/* The different types of timers we can have */
typedef enum timer_type_ {
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
index 8c3e361..e291f61 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
@@ -13,7 +13,7 @@ add_subdirectory (misc)
#-- Add the h5import and test executables
add_subdirectory (h5import)
-#-- h5Repack executables
+#-- h5repack executables
add_subdirectory (h5repack)
#-- Add the h5dump and test executables
@@ -30,3 +30,6 @@ add_subdirectory (h5dump)
#-- Add the h5format_convert and test executables
add_subdirectory (h5format_convert)
+
+#-- h5perf executables
+add_subdirectory (h5perf)
diff --git a/tools/src/Makefile.am b/tools/src/Makefile.am
index 397bd31..5af7d06 100644
--- a/tools/src/Makefile.am
+++ b/tools/src/Makefile.am
@@ -23,6 +23,6 @@ CONFIG=ordered
# All subdirectories
SUBDIRS=h5diff h5ls h5dump misc h5import h5repack h5jam h5copy \
- h5format_convert h5stat
+ h5format_convert h5stat h5perf
include $(top_srcdir)/config/conclude.am
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index bdd1a41..67ae7f7 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -79,124 +79,46 @@ struct handler_t {
/* "xxx" "yyy" into "xxxyyy". */
static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:";
static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'},
- {"attribut", require_arg, 'a'},
- {"attribu", require_arg, 'a'},
- {"attrib", require_arg, 'a'},
- {"attri", require_arg, 'a'},
- {"attr", require_arg, 'a'},
- {"att", require_arg, 'a'},
- {"at", require_arg, 'a'},
{"binary", optional_arg, 'b'},
{"count", require_arg, 'c'},
- {"coun", require_arg, 'c'},
- {"cou", require_arg, 'c'},
- {"co", require_arg, 'c'},
{"dataset", require_arg, 'd'},
- {"datase", require_arg, 'd'},
- {"datas", require_arg, 'd'},
{"escape", no_arg, 'e'},
{"filedriver", require_arg, 'f'},
- {"filedrive", require_arg, 'f'},
- {"filedriv", require_arg, 'f'},
- {"filedri", require_arg, 'f'},
- {"filedr", require_arg, 'f'},
- {"filed", require_arg, 'f'},
- {"file", require_arg, 'f'},
- {"fil", require_arg, 'f'},
- {"fi", require_arg, 'f'},
{"group", require_arg, 'g'},
- {"grou", require_arg, 'g'},
- {"gro", require_arg, 'g'},
- {"gr", require_arg, 'g'},
{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
{"object-ids", no_arg, 'i'},
- {"object-id", no_arg, 'i'},
- {"object-i", no_arg, 'i'},
- {"object", no_arg, 'i'},
- {"objec", no_arg, 'i'},
- {"obje", no_arg, 'i'},
- {"obj", no_arg, 'i'},
- {"ob", no_arg, 'i'},
{"block", require_arg, 'k'},
- {"bloc", require_arg, 'k'},
- {"blo", require_arg, 'k'},
- {"bl", require_arg, 'k'},
{"soft-link", require_arg, 'l'},
- {"soft-lin", require_arg, 'l'},
- {"soft-li", require_arg, 'l'},
- {"soft-l", require_arg, 'l'},
- {"soft", require_arg, 'l'},
- {"sof", require_arg, 'l'},
{"format", require_arg, 'm'},
{"contents", optional_arg, 'n'},
{"output", optional_arg, 'o'},
- {"outpu", optional_arg, 'o'},
- {"outp", optional_arg, 'o'},
- {"out", optional_arg, 'o'},
- {"ou", optional_arg, 'o'},
{"properties", no_arg, 'p'},
{"sort_by", require_arg, 'q'},
{"string", no_arg, 'r'},
- {"strin", no_arg, 'r'},
{"start", require_arg, 's'},
- {"star", require_arg, 's'},
- {"sta", require_arg, 's'},
{"datatype", require_arg, 't'},
- {"datatyp", require_arg, 't'},
- {"dataty", require_arg, 't'},
- {"datat", require_arg, 't'},
{"use-dtd", no_arg, 'u'},
- {"use-dt", no_arg, 'u'},
- {"use-d", no_arg, 'u'},
- {"use-", no_arg, 'u'},
- {"use", no_arg, 'u'},
- {"us", no_arg, 'u'},
- {"u", no_arg, 'u'},
{"vds-view-first-missing", no_arg, 'v'},
{"width", require_arg, 'w'},
- {"widt", require_arg, 'w'},
- {"wid", require_arg, 'w'},
- {"wi", require_arg, 'w'},
{"xml", no_arg, 'x'},
- {"xm", no_arg, 'x'},
{"noindex", no_arg, 'y'},
{"sort_order", require_arg, 'z'},
{"onlyattr", optional_arg, 'A'},
{"superblock", no_arg, 'B'},
{"boot-block", no_arg, 'B'},
- {"boot-bloc", no_arg, 'B'},
- {"boot-blo", no_arg, 'B'},
- {"boot-bl", no_arg, 'B'},
- {"boot-b", no_arg, 'B'},
- {"boot", no_arg, 'B'},
- {"boo", no_arg, 'B'},
- {"bo", no_arg, 'B'},
{"no-compact-subset", no_arg, 'C'},
{"xml-dtd", require_arg, 'D'},
- {"xml-dt", require_arg, 'D'},
- {"xml-d", require_arg, 'D'},
{"enable-error-stack", optional_arg, 'E'},
{"form", require_arg, 'F'},
{"vds-gap-size", require_arg, 'G'},
{"header", no_arg, 'H'},
- {"heade", no_arg, 'H'},
- {"head", no_arg, 'H'},
- {"hea", no_arg, 'H'},
{"packed-bits", require_arg, 'M'},
{"any_path", require_arg, 'N'},
{"ddl", optional_arg, 'O'},
{"region", no_arg, 'R'},
{"stride", require_arg, 'S'},
- {"strid", require_arg, 'S'},
{"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
{"xml-ns", require_arg, 'X'},
- {"xml-n", require_arg, 'X'},
{"s3-cred", require_arg, '$'},
{"hdfs-attrs", require_arg, '#'},
{NULL, 0, '\0'}};
diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c
index a23a6d8..3923344 100644
--- a/tools/src/h5format_convert/h5format_convert.c
+++ b/tools/src/h5format_convert/h5format_convert.c
@@ -39,26 +39,9 @@ static int verbose_g = 0;
* parameters.
*/
static const char * s_opts = "hVvd:n";
-static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"version", no_arg, 'V'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"verbose", no_arg, 'v'},
- {"verbos", no_arg, 'v'},
- {"verbo", no_arg, 'v'},
- {"verb", no_arg, 'v'},
- {"dname", require_arg, 'd'},
- {"dnam", require_arg, 'd'},
- {"dna", require_arg, 'd'},
- {"dn", require_arg, 'd'},
- {"noop", no_arg, 'n'},
- {"noo", no_arg, 'n'},
- {"no", no_arg, 'n'},
- {"enable-error-stack", no_arg, 'E'},
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"version", no_arg, 'V'},
+ {"verbose", no_arg, 'v'}, {"dname", require_arg, 'd'},
+ {"noop", no_arg, 'n'}, {"enable-error-stack", no_arg, 'E'},
{NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 2a65591..04e1c35 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in)
case 0: /* TEXTIN */
in08 = (H5DT_INT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hd", &temp16) != 1) {
+ if (HDfscanf(strm, "%hd", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hd", in16) != 1) {
+ if (HDfscanf(strm, "%hd", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%d", in32) != 1) {
+ if (HDfscanf(strm, "%d", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -595,7 +595,7 @@ readIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 0: /* TEXTIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -664,7 +664,7 @@ readUIntegerData(FILE *strm, struct Input *in)
case 6: /* TEXTUIN */
in08 = (H5DT_UINT8 *)in->data;
for (i = 0; i < len; i++, in08++) {
- if (fscanf(strm, "%hu", &temp16) != 1) {
+ if (HDfscanf(strm, "%hu", &temp16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -693,7 +693,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in16++) {
- if (fscanf(strm, "%hu", in16) != 1) {
+ if (HDfscanf(strm, "%hu", in16) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -729,7 +729,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in32++) {
- if (fscanf(strm, "%u", in32) != 1) {
+ if (HDfscanf(strm, "%u", in32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -766,7 +766,7 @@ readUIntegerData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 6: /* TEXTUIN */
for (i = 0; i < len; i++, in64++) {
- if (fscanf(strm, "%s", buffer) < 1) {
+ if (HDfscanf(strm, "%s", buffer) < 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -832,7 +832,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -845,7 +845,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp32++) {
- if (fscanf(strm, "%f", fp32) != 1) {
+ if (HDfscanf(strm, "%f", fp32) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -884,7 +884,7 @@ readFloatData(FILE *strm, struct Input *in)
switch (in->inputClass) {
case 1: /* TEXTFP */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -897,7 +897,7 @@ readFloatData(FILE *strm, struct Input *in)
case 2: /*TEXTFPE */
for (i = 0; i < len; i++, fp64++) {
- if (fscanf(strm, "%lf", fp64) != 1) {
+ if (HDfscanf(strm, "%lf", fp64) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -1469,16 +1469,16 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
if ((scanret == 1) && !HDstrcmp("HDF5", key)) {
#ifdef H5DEBUGIMPORT
int pndx;
HDprintf("\nh5dump file\n");
#endif
in->h5dumpInput = 1;
- scanret = fscanf(strm, "%254s", temp); /* filename */
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
- scanret = fscanf(strm, "%254s", key); /* DATASET */
+ scanret = HDfscanf(strm, "%254s", temp); /* filename */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", key); /* DATASET */
while (scanret == 1) {
if (!HDstrcmp("DATASET", key)) { /* PATH */
#ifdef H5DEBUGIMPORT
@@ -1488,7 +1488,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1500,7 +1500,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
in->configOptionVector[PATH] = 1;
- scanret = fscanf(strm, "%254s", temp); /* start bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* start bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASET %s found\n", temp);
#endif
@@ -1514,7 +1514,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1550,20 +1550,20 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATATYPE STRING %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* string properties */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
while (get_next_prop) {
if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1582,8 +1582,8 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
}
- else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
- if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
+ else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1591,8 +1591,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CSET", key)) { /* CSET */
- if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */
+ else if (!HDstrcmp("CSET", key)) { /* CSET */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1600,8 +1600,8 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp);
#endif
}
- else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
- if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
+ else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1609,7 +1609,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp);
#endif
} /* if(!HDstrcmp("CSET", key)) */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1628,7 +1628,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1644,14 +1644,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1662,7 +1662,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1672,7 +1672,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1716,7 +1716,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1728,7 +1728,7 @@ processConfigurationFile(char *infile, struct Input *in)
(hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) {
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1742,7 +1742,7 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE process max dim values\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1762,7 +1762,7 @@ processConfigurationFile(char *infile, struct Input *in)
char *more = temp;
in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10);
}
- if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1793,7 +1793,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
- scanret = fscanf(strm, "%254s", temp); /* end bracket */
+ scanret = HDfscanf(strm, "%254s", temp); /* end bracket */
#ifdef H5DEBUGIMPORT
HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp);
#endif
@@ -1808,14 +1808,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1827,7 +1827,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n");
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1838,7 +1838,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -1848,7 +1848,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1880,7 +1880,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5b, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1888,7 +1888,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp);
#endif
if (!HDstrcmp("SIZE", temp)) { /* SIZE */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1897,7 +1897,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
}
while (HDstrcmp("}", temp) != 0) {
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1912,14 +1912,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -1930,28 +1930,28 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION found\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp);
#endif
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -1959,7 +1959,7 @@ processConfigurationFile(char *infile, struct Input *in)
HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival);
#endif
in->compressionParam = ival;
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1981,7 +1981,7 @@ processConfigurationFile(char *infile, struct Input *in)
#endif
in->configOptionVector[COMPRESS] = 0;
}
- if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -1995,14 +1995,14 @@ processConfigurationFile(char *infile, struct Input *in)
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET key\n");
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */
(void)HDfprintf(stderr, err20, infile);
goto error;
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump SUBSET %s found\n", temp);
#endif
- if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2012,7 +2012,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_prop) {
if (!HDstrcmp("COUNT", temp)) { /* COUNT */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2023,7 +2023,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2033,7 +2033,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2068,7 +2068,7 @@ processConfigurationFile(char *infile, struct Input *in)
} /* if(!HDstrcmp("COUNT", temp)) COUNT */
if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */
int icount = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* start paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2079,7 +2079,7 @@ processConfigurationFile(char *infile, struct Input *in)
int get_next_dim = 1;
int i = 0;
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */
(void)HDfprintf(stderr, err16c, infile);
goto error;
}
@@ -2089,7 +2089,7 @@ processConfigurationFile(char *infile, struct Input *in)
while (get_next_dim) {
char *more = temp;
temp_dims[icount] = HDstrtoull(more, &more, 10);
- if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
+ if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */
(void)HDfprintf(stderr, err6b, infile);
goto error;
}
@@ -2122,7 +2122,7 @@ processConfigurationFile(char *infile, struct Input *in)
in->configOptionVector[DIM] = 1;
} /* if(!HDstrcmp("(", key)) start paren */
} /* if(!HDstrcmp("BLOCK", temp)) BLOCK */
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2141,7 +2141,7 @@ processConfigurationFile(char *infile, struct Input *in)
scanret = 0;
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
#ifdef H5DEBUGIMPORT
HDprintf("h5dump path");
@@ -2182,7 +2182,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err3a, infile);
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2199,7 +2199,7 @@ processConfigurationFile(char *infile, struct Input *in)
goto error;
}
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err18);
goto error;
}
@@ -2226,7 +2226,7 @@ processConfigurationFile(char *infile, struct Input *in)
(void)HDfprintf(stderr, err5a, infile);
goto error;
}
- if (fscanf(strm, "%254d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%254d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err19);
goto error;
}
@@ -2423,7 +2423,7 @@ processConfigurationFile(char *infile, struct Input *in)
default:
break;
}
- scanret = fscanf(strm, "%254s", key);
+ scanret = HDfscanf(strm, "%254s", key);
}
/*
@@ -2602,7 +2602,7 @@ getOutputClass(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output class.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for output size.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3502,7 +3502,7 @@ getInputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for input byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3524,7 +3524,7 @@ getRank(struct Input *in, FILE *strm)
const char *err1 = "Unable to get integer value.\n";
const char *err2 = "Invalid value for rank.\n";
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3553,7 +3553,7 @@ getDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfDimension[i++] = ullval;
if (in->rank != i) {
@@ -3579,7 +3579,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%llu", (&ullval)) == 1)
+ while (HDfscanf(strm, "%llu", (&ullval)) == 1)
in->sizeOfChunk[i++] = ullval;
if (in->rank != i) {
@@ -3612,7 +3612,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm)
return (-1);
}
- while (fscanf(strm, "%lld", (&llval)) == 1) {
+ while (HDfscanf(strm, "%lld", (&llval)) == 1) {
if (llval == -1)
in->maxsizeOfDimension[i++] = H5S_UNLIMITED;
else
@@ -3642,7 +3642,7 @@ getOutputArchitecture(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output architecture.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3675,7 +3675,7 @@ getOutputByteOrder(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for output byte-order.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3708,7 +3708,7 @@ getCompressionType(struct Input *in, FILE *strm)
const char *err1 = "Unable to get 'string' value.\n";
const char *err2 = "Invalid value for compression.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3750,7 +3750,7 @@ getCompressionParameter(struct Input *in, FILE *strm)
switch (in->compressionType) {
case 0: /* GZIP */
- if (fscanf(strm, "%d", (&ival)) != 1) {
+ if (HDfscanf(strm, "%d", (&ival)) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
@@ -3774,7 +3774,7 @@ getExternalFilename(struct Input *in, FILE *strm)
char temp[255];
const char *err1 = "Unable to get 'string' value.\n";
- if (fscanf(strm, "%254s", temp) != 1) {
+ if (HDfscanf(strm, "%254s", temp) != 1) {
(void)HDfprintf(stderr, "%s", err1);
return (-1);
}
diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c
index 8bf53d0..b5df5c6 100644
--- a/tools/src/h5jam/h5jam.c
+++ b/tools/src/h5jam/h5jam.c
@@ -34,14 +34,10 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other.
*/
-static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */
-static struct h5_long_options l_opts[] = {
- {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
- {"u", require_arg, 'u'}, /* user block file */
- {"o", require_arg, 'o'}, /* output file */
- {"clobber", no_arg, 'c'}, /* clobber existing UB */
- {"clobbe", no_arg, 'c'}, {"clobb", no_arg, 'c'}, {"clob", no_arg, 'c'},
- {"clo", no_arg, 'c'}, {"cl", no_arg, 'c'}, {NULL, 0, '\0'}};
+static const char * s_opts = "hi:u:o:c:V";
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require_arg, 'i'},
+ {"u", require_arg, 'u'}, {"o", require_arg, 'o'},
+ {"clobber", no_arg, 'c'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c
index 2cf7702..fc675ba 100644
--- a/tools/src/h5jam/h5unjam.c
+++ b/tools/src/h5jam/h5unjam.c
@@ -36,13 +36,9 @@ char *ub_file = NULL;
* adding more, make sure that they don't clash with each other.
*/
static const char * s_opts = "hu:i:o:d:V";
-static struct h5_long_options l_opts[] = {
- {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */
- {"u", require_arg, 'u'}, /* user block file */
- {"o", require_arg, 'o'}, /* output file */
- {"delete", no_arg, 'd'}, /* delete ub */
- {"delet", no_arg, 'd'}, {"dele", no_arg, 'd'}, {"del", no_arg, 'd'},
- {"de", no_arg, 'd'}, {NULL, 0, '\0'}};
+static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"i", require_arg, 'i'},
+ {"u", require_arg, 'u'}, {"o", require_arg, 'o'},
+ {"delete", no_arg, 'd'}, {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
diff --git a/tools/src/h5perf/CMakeLists.txt b/tools/src/h5perf/CMakeLists.txt
new file mode 100644
index 0000000..36b0b2f
--- /dev/null
+++ b/tools/src/h5perf/CMakeLists.txt
@@ -0,0 +1,103 @@
+cmake_minimum_required (VERSION 3.12)
+project (HDF5_TOOLS_SRC_H5PERF C)
+
+# --------------------------------------------------------------------
+# Add the executables
+# --------------------------------------------------------------------
+#-- Adding test for h5perf_serial
+set (h5perf_serial_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_engine.c
+)
+add_executable (h5perf_serial ${h5perf_serial_SOURCES})
+target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial STATIC)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5perf_serial SHARED)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
+set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
+set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5perf_serial")
+
+set (H5_DEP_EXECUTABLES h5perf_serial)
+
+#-----------------------------------------------------------------------------
+# Add Target to clang-format
+#-----------------------------------------------------------------------------
+if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_h5perf_serial_FORMAT h5perf_serial)
+endif ()
+
+if (H5_HAVE_PARALLEL)
+ if (UNIX)
+ #-- Adding test for perf - only on unix systems
+ set (perf_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/perf.c
+ )
+ add_executable (perf ${perf_SOURCES})
+ target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf STATIC)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ else ()
+ TARGET_C_PROPERTIES (perf SHARED)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ endif ()
+ set_target_properties (perf PROPERTIES FOLDER perform)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};perf")
+
+ set (H5_DEP_EXECUTABLES perf)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_perf_FORMAT perf)
+ endif ()
+ endif ()
+
+ #-- Adding test for h5perf
+ set (h5perf_SOURCES
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_engine.c
+ )
+ add_executable (h5perf ${h5perf_SOURCES})
+ target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf STATIC)
+ target_link_libraries (h5perf PRIVATE ${LINK_LIBS} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ else ()
+ TARGET_C_PROPERTIES (h5perf SHARED)
+ target_link_libraries (h5perf PRIVATE ${LINK_LIBS} ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
+ endif ()
+ set_target_properties (h5perf PROPERTIES FOLDER perform)
+ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5perf")
+
+ set (H5_DEP_EXECUTABLES h5perf)
+
+ #-----------------------------------------------------------------------------
+ # Add Target to clang-format
+ #-----------------------------------------------------------------------------
+ if (HDF5_ENABLE_FORMATTERS)
+ clang_format (HDF5_TOOLS_SRC_H5PERF_h5perf_FORMAT h5perf)
+ endif ()
+endif ()
+
+#-----------------------------------------------------------------------------
+# Rules for Installation of tools using make Install target
+#-----------------------------------------------------------------------------
+if (HDF5_EXPORTED_TARGETS)
+ foreach (exec ${H5_DEP_EXECUTABLES})
+ INSTALL_PROGRAM_PDB (${exec} ${HDF5_INSTALL_BIN_DIR} toolsapplications)
+ endforeach ()
+
+ install (
+ TARGETS
+ ${H5_DEP_EXECUTABLES}
+ EXPORT
+ ${HDF5_EXPORTED_TARGETS}
+ RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications
+ )
+endif ()
diff --git a/tools/src/h5perf/Makefile.am b/tools/src/h5perf/Makefile.am
new file mode 100644
index 0000000..e8a9fdd
--- /dev/null
+++ b/tools/src/h5perf/Makefile.am
@@ -0,0 +1,63 @@
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://www.hdfgroup.org/licenses.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+##
+## Makefile.am
+## Run automake to generate a Makefile.in from this file.
+##
+#
+# HDF5 Library Performance Makefile(.in)
+#
+
+include $(top_srcdir)/config/commence.am
+
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib
+
+# bin_PROGRAMS will be installed.
+if BUILD_PARALLEL_CONDITIONAL
+ bin_PROGRAMS=h5perf_serial perf h5perf
+else
+ bin_PROGRAMS=h5perf_serial
+endif
+
+# Add h5perf and h5perf_serial specific linker flags here
+h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+
+# Some programs are not built or run by default, but can be built by hand or by
+# specifying --enable-build-all at configure time.
+# Also, some of these programs should only be built in parallel.
+# Currently there is no such program.
+if BUILD_PARALLEL_CONDITIONAL
+ PARA_BUILD_ALL=
+endif
+if BUILD_ALL_CONDITIONAL
+ BUILD_ALL_PROGS=$(PARA_BUILD_ALL)
+endif
+
+# Define programs that will be run in 'make check'
+# List them in the order they should be run.
+# Parallel test programs.
+if BUILD_PARALLEL_CONDITIONAL
+ TEST_PROG_PARA=h5perf perf
+endif
+
+h5perf_SOURCES=pio_perf.c pio_engine.c
+h5perf_serial_SOURCES=sio_perf.c sio_engine.c
+
+# All of the programs depend on the main hdf5 library, and some of them
+# depend on test or tools library.
+LDADD=$(LIBHDF5)
+h5perf_LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+perf_LDADD=$(LIBHDF5)
+
+include $(top_srcdir)/config/conclude.am
diff --git a/tools/test/perform/perf.c b/tools/src/h5perf/perf.c
index a06fb77..e8c03d8 100644
--- a/tools/test/perform/perf.c
+++ b/tools/src/h5perf/perf.c
@@ -22,19 +22,16 @@
#include "hdf5.h"
#include "H5private.h"
-#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
+#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef H5_HAVE_UNISTD_H
-#include <sys/types.h>
-#include <unistd.h>
+#include <time.h>
#endif
#ifdef H5_HAVE_SYS_STAT_H
@@ -50,6 +47,14 @@
#include <time.h>
#endif
+#ifdef H5_HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef H5_HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <mpi.h>
#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */
#include <mpio.h>
@@ -109,6 +114,15 @@ static int parse_args(int argc, char **argv);
extern char *optarg;
#endif
+#ifndef HDF5_PARAPREFIX
+#define HDF5_PARAPREFIX ""
+#endif
+char * paraprefix = NULL; /* for command line option para-prefix */
+MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
+
+static char *h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname,
+ size_t size, hbool_t nest_printf, hbool_t subst_for_superblock);
+
int
main(int argc, char **argv)
{
@@ -136,12 +150,11 @@ main(int argc, char **argv)
if (mynod == 0)
printf("# Using hdf5-io calls.\n");
- /* kindof a weird hack- if the location of the pvfstab file was
- * specified on the command line, then spit out this location into
- * the appropriate environment variable: */
-
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
+#ifdef H5_HAVE_UNISTD_H
+ /* Kind of a weird hack- if the location of the pvfstab file was
+ * specified on the command line, then spit out this location into
+ * the appropriate environment variable.
+ */
if (opt_pvfstab_set) {
if ((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0) {
perror("setenv");
@@ -208,7 +221,7 @@ main(int argc, char **argv)
}
}
- h5_fixname_no_suffix(FILENAME[0], acc_tpl, filename, sizeof filename);
+ h5_fixname_real(FILENAME[0], acc_tpl, NULL, filename, sizeof filename, FALSE, FALSE);
/* create the parallel file */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
@@ -372,9 +385,8 @@ main(int argc, char **argv)
die_jar_jar_die:
-#if H5_HAVE_SETENV
- /* no setenv or unsetenv */
- /* clear the environment variable if it was set earlier */
+#ifdef H5_HAVE_UNISTD
+ /* Clear the environment variable if it was set earlier */
if (opt_pvfstab_set) {
unsetenv("PVFSTAB_FILE");
}
@@ -454,6 +466,323 @@ parse_args(int argc, char **argv)
return (0);
}
+/*-------------------------------------------------------------------------
+ * Function: getenv_all
+ *
+ * Purpose: Used to get the environment that the root MPI task has.
+ * name specifies which environment variable to look for
+ * val is the string to which the value of that environment
+ * variable will be copied.
+ *
+ * NOTE: The pointer returned by this function is only
+ * valid until the next call to getenv_all and the data
+ * stored there must be copied somewhere else before any
+ * further calls to getenv_all take place.
+ *
+ * Return: pointer to a string containing the value of the environment variable
+ * NULL if the varialbe doesn't exist in task 'root's environment.
+ *
+ * Programmer: Leon Arber
+ * 4/4/05
+ *
+ * Modifications:
+ * Use original getenv if MPI is not initialized. This happens
+ * one uses the PHDF5 library to build a serial nature code.
+ * Albert 2006/04/07
+ *
+ *-------------------------------------------------------------------------
+ */
+char *
+getenv_all(MPI_Comm comm, int root, const char *name)
+{
+ int mpi_size, mpi_rank, mpi_initialized, mpi_finalized;
+ int len;
+ static char *env = NULL;
+
+ HDassert(name);
+
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
+
+ if (mpi_initialized && !mpi_finalized) {
+ MPI_Comm_rank(comm, &mpi_rank);
+ MPI_Comm_size(comm, &mpi_size);
+ HDassert(root < mpi_size);
+
+ /* The root task does the getenv call
+ * and sends the result to the other tasks */
+ if (mpi_rank == root) {
+ env = HDgetenv(name);
+ if (env) {
+ len = (int)HDstrlen(env);
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ }
+ else {
+ /* len -1 indicates that the variable was not in the environment */
+ len = -1;
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ }
+ }
+ else {
+ MPI_Bcast(&len, 1, MPI_INT, root, comm);
+ if (len >= 0) {
+ if (env == NULL)
+ env = (char *)HDmalloc((size_t)len + 1);
+ else if (HDstrlen(env) < (size_t)len)
+ env = (char *)HDrealloc(env, (size_t)len + 1);
+
+ MPI_Bcast(env, len, MPI_CHAR, root, comm);
+ env[len] = '\0';
+ }
+ else {
+ if (env)
+ HDfree(env);
+ env = NULL;
+ }
+ }
+#ifndef NDEBUG
+ MPI_Barrier(comm);
+#endif
+ }
+ else {
+ /* use original getenv */
+ if (env)
+ HDfree(env);
+ env = HDgetenv(name);
+ } /* end if */
+
+ return env;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: h5_fixname_real
+ *
+ * Purpose: Create a file name from a file base name like `test' and
+ * return it through the FULLNAME (at most SIZE characters
+ * counting the null terminator). The full name is created by
+ * prepending the contents of HDF5_PREFIX (separated from the
+ * base name by a slash) and appending a file extension based on
+ * the driver supplied, resulting in something like
+ * `ufs:/u/matzke/test.h5'.
+ *
+ * Return: Success: The FULLNAME pointer.
+ *
+ * Failure: NULL if BASENAME or FULLNAME is the null
+ * pointer or if FULLNAME isn't large enough for
+ * the result.
+ *
+ * Programmer: Robb Matzke
+ * Thursday, November 19, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+static char *
+h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix, char *fullname, size_t size,
+ hbool_t nest_printf, hbool_t subst_for_superblock)
+{
+ const char *prefix = NULL;
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
+ char * ptr, last = '\0';
+ const char *suffix = _suffix;
+ size_t i, j;
+ hid_t driver = -1;
+ int isppdriver = 0; /* if the driver is MPI parallel */
+
+ if (!base_name || !fullname || size < 1)
+ return NULL;
+
+ HDmemset(fullname, 0, size);
+
+ /* figure out the suffix */
+ if (H5P_DEFAULT != fapl) {
+ if ((driver = H5Pget_driver(fapl)) < 0)
+ return NULL;
+
+ if (suffix) {
+ if (H5FD_FAMILY == driver) {
+ if (subst_for_superblock)
+ suffix = "00000.h5";
+ else
+ suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
+ }
+ else if (H5FD_MULTI == driver) {
+
+ /* Get the environment variable, if it exists, in case
+ * we are using the split driver since both of those
+ * use the multi VFD under the hood.
+ */
+ env = HDgetenv("HDF5_DRIVER");
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if (!env)
+ env = HDF5_DRIVER;
+#endif
+ if (env && !HDstrcmp(env, "split")) {
+ /* split VFD */
+ if (subst_for_superblock)
+ suffix = "-m.h5";
+ else
+ suffix = NULL;
+ }
+ else {
+ /* multi VFD */
+ if (subst_for_superblock)
+ suffix = "-s.h5";
+ else
+ suffix = NULL;
+ }
+ }
+ }
+ }
+
+ /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX
+ * could be of value -1 if it is not defined.
+ */
+ isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver);
+
+ /* Check what prefix to use for test files. Process HDF5_PARAPREFIX and
+ * HDF5_PREFIX.
+ * Use different ones depending on parallel or serial driver used.
+ * (The #ifdef is needed to prevent compile failure in case MPI is not
+ * configured.)
+ */
+ if (isppdriver) {
+ /*
+ * For parallel:
+ * First use command line option, then the environment
+ * variable, then try the constant
+ */
+ static int explained = 0;
+
+ prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX"));
+
+ if (!prefix && !explained) {
+ /* print hint by process 0 once. */
+ int mpi_rank;
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ if (mpi_rank == 0)
+ HDprintf("*** Hint ***\n"
+ "You can use environment variable HDF5_PARAPREFIX to "
+ "run parallel test files in a\n"
+ "different directory or to add file type prefix. e.g.,\n"
+ " HDF5_PARAPREFIX=pfs:/PFS/user/me\n"
+ " export HDF5_PARAPREFIX\n"
+ "*** End of Hint ***\n");
+
+ explained = TRUE;
+#ifdef HDF5_PARAPREFIX
+ prefix = HDF5_PARAPREFIX;
+#endif /* HDF5_PARAPREFIX */
+ }
+ }
+ else {
+ /*
+ * For serial:
+ * First use the environment variable, then try the constant
+ */
+ prefix = HDgetenv("HDF5_PREFIX");
+
+#ifdef HDF5_PREFIX
+ if (!prefix)
+ prefix = HDF5_PREFIX;
+#endif /* HDF5_PREFIX */
+ }
+
+ /* Prepend the prefix value to the base name */
+ if (prefix && *prefix) {
+ if (isppdriver) {
+ /* This is a parallel system */
+ char *subdir;
+
+ if (!HDstrcmp(prefix, HDF5_PARAPREFIX)) {
+ /*
+ * If the prefix specifies the HDF5_PARAPREFIX directory, then
+ * default to using the "/tmp/$USER" or "/tmp/$LOGIN"
+ * directory instead.
+ */
+ char *user, *login;
+
+ user = HDgetenv("USER");
+ login = HDgetenv("LOGIN");
+ subdir = (user ? user : login);
+
+ if (subdir) {
+ for (i = 0; i < size && prefix[i]; i++)
+ fullname[i] = prefix[i];
+
+ fullname[i++] = '/';
+
+ for (j = 0; i < size && subdir[j]; ++i, ++j)
+ fullname[i] = subdir[j];
+ }
+ }
+
+ if (!fullname[0]) {
+ /* We didn't append the prefix yet */
+ HDstrncpy(fullname, prefix, size);
+ fullname[size - 1] = '\0';
+ }
+
+ if (HDstrlen(fullname) + HDstrlen(base_name) + 1 < size) {
+ /*
+ * Append the base_name with a slash first. Multiple
+ * slashes are handled below.
+ */
+ h5_stat_t buf;
+
+ if (HDstat(fullname, &buf) < 0)
+ /* The directory doesn't exist just yet */
+ if (HDmkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST)
+ /*
+ * We couldn't make the "/tmp/${USER,LOGIN}"
+ * subdirectory. Default to PREFIX's original
+ * prefix value.
+ */
+ HDstrcpy(fullname, prefix);
+
+ HDstrcat(fullname, "/");
+ HDstrcat(fullname, base_name);
+ }
+ else {
+ /* Buffer is too small */
+ return NULL;
+ }
+ }
+ else {
+ if (HDsnprintf(fullname, size, "%s/%s", prefix, base_name) == (int)size)
+ /* Buffer is too small */
+ return NULL;
+ }
+ }
+ else if (HDstrlen(base_name) >= size) {
+ /* Buffer is too small */
+ return NULL;
+ }
+ else {
+ HDstrcpy(fullname, base_name);
+ }
+
+ /* Append a suffix */
+ if (suffix) {
+ if (HDstrlen(fullname) + HDstrlen(suffix) >= size)
+ return NULL;
+
+ HDstrcat(fullname, suffix);
+ }
+
+ /* Remove any double slashes in the filename */
+ for (ptr = fullname, i = j = 0; ptr && i < size; i++, ptr++) {
+ if (*ptr != '/' || last != '/')
+ fullname[j++] = *ptr;
+
+ last = *ptr;
+ }
+
+ return fullname;
+}
/*
* Local variables:
diff --git a/tools/test/perform/pio_engine.c b/tools/src/h5perf/pio_engine.c
index cac36d7..65194b0 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/src/h5perf/pio_engine.c
@@ -16,10 +16,12 @@
#include "hdf5.h"
+#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/pio_perf.c b/tools/src/h5perf/pio_perf.c
index d38c574..41245d9 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/src/h5perf/pio_perf.c
@@ -113,6 +113,12 @@ int pio_debug_level = 0; /* The debug level:
/* local variables */
static const char *progname = "h5perf";
+#ifndef HDF5_PARAPREFIX
+#define HDF5_PARAPREFIX ""
+#endif
+char * paraprefix = NULL; /* for command line option para-prefix */
+MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
+
/*
* Command-line options: The user can specify short or long-named
* parameters. The long-named ones can be partially spelled. When
@@ -124,145 +130,29 @@ static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:";
#endif /* 1 */
static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
{"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
- { "binar", no_arg, 'b' },
- { "bina", no_arg, 'b' },
- { "bin", no_arg, 'b' },
- { "bi", no_arg, 'b' },
#endif /* 0 */
{"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
{"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
{"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
{"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
{"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
{"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
{"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
{"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
{"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
{"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
{"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
{"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
{"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
{"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
{"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
{"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
{"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
{NULL, 0, '\0'}};
struct options {
@@ -850,6 +740,135 @@ output_all_info(minmax *mm, int count, int indent_level)
}
/*
+ * Function: h5_set_info_object
+ * Purpose: Process environment variables setting to set up MPI Info
+ * object.
+ * Return: 0 if all is fine; otherwise non-zero.
+ * Programmer: Albert Cheng, 2002/05/21.
+ * Modifications:
+ * Bill Wendling, 2002/05/31
+ * Modified so that the HDF5_MPI_INFO environment variable can
+ * be a semicolon separated list of "key=value" pairings. Most
+ * of the code is to remove any whitespaces which might be
+ * surrounding the "key=value" pairs.
+ */
+int
+h5_set_info_object(void)
+{
+ char *envp; /* environment pointer */
+ int ret_value = 0;
+
+ /* handle any MPI INFO hints via $HDF5_MPI_INFO */
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
+ char *next, *valp;
+
+ valp = envp = next = HDstrdup(envp);
+
+ if (!valp)
+ return 0;
+
+ /* create an INFO object if not created yet */
+ if (h5_io_info_g == MPI_INFO_NULL)
+ MPI_Info_create(&h5_io_info_g);
+
+ do {
+ size_t len;
+ char * key_val, *endp, *namep;
+
+ if (*valp == ';')
+ valp++;
+
+ /* copy key/value pair into temporary buffer */
+ len = strcspn(valp, ";");
+ next = &valp[len];
+ key_val = (char *)HDcalloc(1, len + 1);
+
+ /* increment the next pointer past the terminating semicolon */
+ if (*next == ';')
+ ++next;
+
+ namep = HDstrncpy(key_val, valp, len);
+
+ /* pass up any beginning whitespaces */
+ while (*namep && (*namep == ' ' || *namep == '\t'))
+ namep++;
+
+ if (!*namep)
+ continue; /* was all white space, so move to next k/v pair */
+
+ /* eat up any ending white spaces */
+ endp = &namep[HDstrlen(namep) - 1];
+
+ while (endp && (*endp == ' ' || *endp == '\t'))
+ *endp-- = '\0';
+
+ /* find the '=' */
+ valp = HDstrchr(namep, '=');
+
+ if (valp != NULL) { /* it's a valid key/value pairing */
+ char *tmp_val = valp + 1;
+
+ /* change '=' to \0, move valp down one */
+ *valp-- = '\0';
+
+ /* eat up ending whitespace on the "key" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp-- = '\0';
+
+ valp = tmp_val;
+
+ /* eat up beginning whitespace on the "value" part */
+ while (*valp == ' ' || *valp == '\t')
+ *valp++ = '\0';
+
+ /* actually set the darned thing */
+ if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
+ HDprintf("MPI_Info_set failed\n");
+ ret_value = -1;
+ }
+ }
+
+ valp = next;
+ HDfree(key_val);
+ } while (next && *next);
+
+ HDfree(envp);
+ }
+
+ return ret_value;
+}
+
+/*
+ * Function: h5_dump_info_object
+ * Purpose: Display content of an MPI Info object
+ * Return: void
+ * Programmer: Albert Cheng 2002/05/21
+ * Modifications:
+ */
+void
+h5_dump_info_object(MPI_Info info)
+{
+ char key[MPI_MAX_INFO_KEY + 1];
+ char value[MPI_MAX_INFO_VAL + 1];
+ int flag;
+ int i, nkeys;
+
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
+ if (info == MPI_INFO_NULL) {
+ HDprintf("object is MPI_INFO_NULL\n");
+ }
+ else {
+ MPI_Info_get_nkeys(info, &nkeys);
+ HDprintf("object has %d items\n", nkeys);
+ for (i = 0; i < nkeys; i++) {
+ MPI_Info_get_nthkey(info, i, key);
+ MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
+ HDprintf("%s=%s\n", key, value);
+ }
+ }
+}
+
+/*
* Function: get_minmax
* Purpose: Gather all the min, max and total of val.
* Return: Nothing
diff --git a/tools/test/perform/pio_perf.h b/tools/src/h5perf/pio_perf.h
index 24621da..8924c20 100644
--- a/tools/test/perform/pio_perf.h
+++ b/tools/src/h5perf/pio_perf.h
@@ -15,7 +15,7 @@
#ifndef STANDALONE
#include "io_timer.h"
-#include "h5test.h"
+#include "H5private.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
@@ -23,6 +23,15 @@
#include "pio_standalone.h"
#endif
+#ifdef H5_HAVE_PARALLEL
+extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
+#endif
+
+#ifdef H5_HAVE_PARALLEL
+int h5_set_info_object(void);
+void h5_dump_info_object(MPI_Info info);
+#endif
+
/* setup the dataset no fill option if this is v1.5 or more */
#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
#define H5_HAVE_NOFILL 1
diff --git a/tools/test/perform/sio_engine.c b/tools/src/h5perf/sio_engine.c
index 1af2318..dc2c68e 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -16,10 +16,12 @@
#include "hdf5.h"
+#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/sio_perf.c b/tools/src/h5perf/sio_perf.c
index 51a7825..1b200b0 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/src/h5perf/sio_perf.c
@@ -65,7 +65,7 @@
#define SIO_HDF5 0x4
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes, t) (H5_DBL_ABS_EQUAL(t, 0.0) ? 0.0 : ((((double)bytes) / (double)ONE_MB) / (t)))
+#define MB_PER_SEC(bytes, t) (H5_DBL_ABS_EQUAL(t, 0.0) ? 0.0 : ((((double)(bytes)) / (double)ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -99,168 +99,32 @@ static const char *progname = "h5perf_serial";
*/
static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'},
- {"alig", require_arg, 'a'},
- {"ali", require_arg, 'a'},
- {"al", require_arg, 'a'},
{"api", require_arg, 'A'},
- {"ap", require_arg, 'A'},
#if 0
/* a sighting of the elusive binary option */
{ "binary", no_arg, 'b' },
- { "binar", no_arg, 'b' },
- { "bina", no_arg, 'b' },
- { "bin", no_arg, 'b' },
- { "bi", no_arg, 'b' },
#endif /* 0 */
{"block-size", require_arg, 'B'},
- {"block-siz", require_arg, 'B'},
- {"block-si", require_arg, 'B'},
- {"block-s", require_arg, 'B'},
- {"block-", require_arg, 'B'},
- {"block", require_arg, 'B'},
- {"bloc", require_arg, 'B'},
- {"blo", require_arg, 'B'},
- {"bl", require_arg, 'B'},
{"chunk", no_arg, 'c'},
- {"chun", no_arg, 'c'},
- {"chu", no_arg, 'c'},
- {"ch", no_arg, 'c'},
{"collective", no_arg, 'C'},
- {"collectiv", no_arg, 'C'},
- {"collecti", no_arg, 'C'},
- {"collect", no_arg, 'C'},
- {"collec", no_arg, 'C'},
- {"colle", no_arg, 'C'},
- {"coll", no_arg, 'C'},
- {"col", no_arg, 'C'},
- {"co", no_arg, 'C'},
{"debug", require_arg, 'D'},
- {"debu", require_arg, 'D'},
- {"deb", require_arg, 'D'},
- {"de", require_arg, 'D'},
{"file-driver", require_arg, 'v'},
- {"file-drive", require_arg, 'v'},
- {"file-driv", require_arg, 'v'},
- {"file-dri", require_arg, 'v'},
- {"file-dr", require_arg, 'v'},
- {"file-d", require_arg, 'v'},
- {"file-", require_arg, 'v'},
- {"file", require_arg, 'v'},
- {"fil", require_arg, 'v'},
- {"fi", require_arg, 'v'},
{"geometry", no_arg, 'g'},
- {"geometr", no_arg, 'g'},
- {"geomet", no_arg, 'g'},
- {"geome", no_arg, 'g'},
- {"geom", no_arg, 'g'},
- {"geo", no_arg, 'g'},
- {"ge", no_arg, 'g'},
{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
{"interleaved", require_arg, 'I'},
- {"interleave", require_arg, 'I'},
- {"interleav", require_arg, 'I'},
- {"interlea", require_arg, 'I'},
- {"interle", require_arg, 'I'},
- {"interl", require_arg, 'I'},
- {"inter", require_arg, 'I'},
- {"inte", require_arg, 'I'},
- {"int", require_arg, 'I'},
- {"in", require_arg, 'I'},
{"max-num-processes", require_arg, 'P'},
- {"max-num-processe", require_arg, 'P'},
- {"max-num-process", require_arg, 'P'},
- {"max-num-proces", require_arg, 'P'},
- {"max-num-proce", require_arg, 'P'},
- {"max-num-proc", require_arg, 'P'},
- {"max-num-pro", require_arg, 'P'},
- {"max-num-pr", require_arg, 'P'},
- {"max-num-p", require_arg, 'P'},
{"min-num-processes", require_arg, 'p'},
- {"min-num-processe", require_arg, 'p'},
- {"min-num-process", require_arg, 'p'},
- {"min-num-proces", require_arg, 'p'},
- {"min-num-proce", require_arg, 'p'},
- {"min-num-proc", require_arg, 'p'},
- {"min-num-pro", require_arg, 'p'},
- {"min-num-pr", require_arg, 'p'},
- {"min-num-p", require_arg, 'p'},
{"max-xfer-size", require_arg, 'X'},
- {"max-xfer-siz", require_arg, 'X'},
- {"max-xfer-si", require_arg, 'X'},
- {"max-xfer-s", require_arg, 'X'},
- {"max-xfer", require_arg, 'X'},
- {"max-xfe", require_arg, 'X'},
- {"max-xf", require_arg, 'X'},
- {"max-x", require_arg, 'X'},
{"min-xfer-size", require_arg, 'x'},
- {"min-xfer-siz", require_arg, 'x'},
- {"min-xfer-si", require_arg, 'x'},
- {"min-xfer-s", require_arg, 'x'},
- {"min-xfer", require_arg, 'x'},
- {"min-xfe", require_arg, 'x'},
- {"min-xf", require_arg, 'x'},
- {"min-x", require_arg, 'x'},
{"num-bytes", require_arg, 'e'},
- {"num-byte", require_arg, 'e'},
- {"num-byt", require_arg, 'e'},
- {"num-by", require_arg, 'e'},
- {"num-b", require_arg, 'e'},
{"num-dsets", require_arg, 'd'},
- {"num-dset", require_arg, 'd'},
- {"num-dse", require_arg, 'd'},
- {"num-ds", require_arg, 'd'},
- {"num-d", require_arg, 'd'},
{"num-files", require_arg, 'F'},
- {"num-file", require_arg, 'F'},
- {"num-fil", require_arg, 'F'},
- {"num-fi", require_arg, 'F'},
- {"num-f", require_arg, 'F'},
{"num-iterations", require_arg, 'i'},
- {"num-iteration", require_arg, 'i'},
- {"num-iteratio", require_arg, 'i'},
- {"num-iterati", require_arg, 'i'},
- {"num-iterat", require_arg, 'i'},
- {"num-itera", require_arg, 'i'},
- {"num-iter", require_arg, 'i'},
- {"num-ite", require_arg, 'i'},
- {"num-it", require_arg, 'i'},
- {"num-i", require_arg, 'i'},
{"order", require_arg, 'r'},
- {"orde", require_arg, 'r'},
- {"ord", require_arg, 'r'},
- {"or", require_arg, 'r'},
{"output", require_arg, 'o'},
- {"outpu", require_arg, 'o'},
- {"outp", require_arg, 'o'},
- {"out", require_arg, 'o'},
- {"ou", require_arg, 'o'},
{"extendable", no_arg, 't'},
- {"extendabl", no_arg, 't'},
- {"extendab", no_arg, 't'},
- {"extenda", no_arg, 't'},
- {"extend", no_arg, 't'},
- {"exten", no_arg, 't'},
- {"exte", no_arg, 't'},
- {"ext", no_arg, 't'},
- {"ex", no_arg, 't'},
{"threshold", require_arg, 'T'},
- {"threshol", require_arg, 'T'},
- {"thresho", require_arg, 'T'},
- {"thresh", require_arg, 'T'},
- {"thres", require_arg, 'T'},
- {"thre", require_arg, 'T'},
- {"thr", require_arg, 'T'},
- {"th", require_arg, 'T'},
{"write-only", require_arg, 'w'},
- {"write-onl", require_arg, 'w'},
- {"write-on", require_arg, 'w'},
- {"write-o", require_arg, 'w'},
- {"write", require_arg, 'w'},
- {"writ", require_arg, 'w'},
- {"wri", require_arg, 'w'},
- {"wr", require_arg, 'w'},
{NULL, 0, '\0'}};
struct options {
diff --git a/tools/test/perform/sio_perf.h b/tools/src/h5perf/sio_perf.h
index 6242782..d998377 100644
--- a/tools/test/perform/sio_perf.h
+++ b/tools/src/h5perf/sio_perf.h
@@ -15,7 +15,7 @@
#ifndef STANDALONE
#include "io_timer.h"
-#include "h5test.h"
+#include "H5private.h"
#include "h5tools.h"
#include "h5tools_utils.h"
#else
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index 13184a5..e4fa10d 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -337,7 +337,7 @@ read_info(const char *filename, pack_opt_t *options)
/* cycle until end of file reached */
while (1) {
- if (EOF == fscanf(fp, "%9s", stype))
+ if (EOF == HDfscanf(fp, "%9s", stype))
break;
/* Info indicator must be for layout or filter */
@@ -352,7 +352,7 @@ read_info(const char *filename, pack_opt_t *options)
i = 0;
c = '0';
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
@@ -364,7 +364,7 @@ read_info(const char *filename, pack_opt_t *options)
c = '0';
/* go until end */
while (c != ' ') {
- if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
+ if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) {
error_msg("fscanf error\n");
h5tools_setstatus(EXIT_FAILURE);
ret_value = EXIT_FAILURE;
diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c
index a30aee5..6e54c78 100644
--- a/tools/src/h5stat/h5stat.c
+++ b/tools/src/h5stat/h5stat.c
@@ -172,102 +172,19 @@ struct handler_t {
static const char *s_opts = "Aa:Ddm:EFfhGgl: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'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
{"filemetadata", no_arg, 'F'},
- {"filemetadat", no_arg, 'F'},
- {"filemetada", no_arg, 'F'},
- {"filemetad", no_arg, 'F'},
- {"filemeta", no_arg, 'F'},
- {"filemet", no_arg, 'F'},
- {"fileme", no_arg, 'F'},
- {"filem", no_arg, 'F'},
- {"file", no_arg, 'f'},
- {"fil", no_arg, 'f'},
- {"fi", no_arg, 'f'},
{"groupmetadata", no_arg, 'G'},
- {"groupmetadat", no_arg, 'G'},
- {"groupmetada", no_arg, 'G'},
- {"groupmetad", no_arg, 'G'},
- {"groupmeta", no_arg, 'G'},
- {"groupmet", no_arg, 'G'},
- {"groupme", no_arg, 'G'},
- {"groupm", no_arg, 'G'},
- {"group", no_arg, 'g'},
- {"grou", no_arg, 'g'},
- {"gro", no_arg, 'g'},
- {"gr", no_arg, 'g'},
{"links", require_arg, 'l'},
- {"link", require_arg, 'l'},
- {"lin", require_arg, 'l'},
- {"li", require_arg, 'l'},
{"dsetmetadata", no_arg, 'D'},
- {"dsetmetadat", no_arg, 'D'},
- {"dsetmetada", no_arg, 'D'},
- {"dsetmetad", no_arg, 'D'},
- {"dsetmeta", no_arg, 'D'},
- {"dsetmet", no_arg, 'D'},
- {"dsetme", no_arg, 'D'},
- {"dsetm", no_arg, 'D'},
- {"dset", no_arg, 'd'},
- {"dse", no_arg, 'd'},
- {"ds", no_arg, 'd'},
{"dims", require_arg, 'm'},
- {"dim", require_arg, 'm'},
- {"di", require_arg, 'm'},
{"dtypemetadata", no_arg, 'T'},
- {"dtypemetadat", no_arg, 'T'},
- {"dtypemetada", no_arg, 'T'},
- {"dtypemetad", no_arg, 'T'},
- {"dtypemeta", no_arg, 'T'},
- {"dtypemet", no_arg, 'T'},
- {"dtypeme", no_arg, 'T'},
- {"dtypem", no_arg, 'T'},
- {"dtype", no_arg, 'T'},
- {"dtyp", no_arg, 'T'},
- {"dty", no_arg, 'T'},
- {"dt", no_arg, 'T'},
{"object", require_arg, 'O'},
- {"objec", require_arg, 'O'},
- {"obje", require_arg, 'O'},
- {"obj", require_arg, 'O'},
- {"ob", require_arg, 'O'},
{"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"ver", no_arg, 'V'},
- {"ve", no_arg, 'V'},
{"attribute", no_arg, 'A'},
- {"attribut", no_arg, 'A'},
- {"attribu", no_arg, 'A'},
- {"attrib", no_arg, 'A'},
- {"attri", no_arg, 'A'},
- {"attr", no_arg, 'A'},
- {"att", no_arg, 'A'},
- {"at", no_arg, 'A'},
{"enable-error-stack", no_arg, 'E'},
{"numattrs", require_arg, 'a'},
- {"numattr", require_arg, 'a'},
- {"numatt", require_arg, 'a'},
- {"numat", require_arg, 'a'},
- {"numa", require_arg, 'a'},
- {"num", require_arg, 'a'},
- {"nu", require_arg, 'a'},
{"freespace", no_arg, 's'},
- {"freespac", no_arg, 's'},
- {"freespa", no_arg, 's'},
- {"freesp", no_arg, 's'},
- {"frees", no_arg, 's'},
- {"free", no_arg, 's'},
- {"fre", no_arg, 's'},
- {"fr", no_arg, 's'},
{"summary", no_arg, 'S'},
- {"summar", no_arg, 'S'},
- {"summa", no_arg, 'S'},
- {"summ", no_arg, 'S'},
- {"sum", no_arg, 'S'},
- {"su", no_arg, 'S'},
{"s3-cred", require_arg, 'w'},
{"hdfs-attrs", require_arg, 'H'},
{NULL, 0, '\0'}};
diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt
index ea30c98..8b6b9bb 100644
--- a/tools/src/misc/CMakeLists.txt
+++ b/tools/src/misc/CMakeLists.txt
@@ -42,7 +42,7 @@ if (NOT ONLY_SHARED_LIBS)
h5debug
h5repart
h5mkgrp
- h5clear
+ h5clear
)
endif ()
if (BUILD_SHARED_LIBS)
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index 524ad03..face2f0 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -32,7 +32,7 @@
#define H5F_ACS_SKIP_EOF_CHECK_NAME "skip_eof_check"
/* Default increment is 1 megabytes for the --increment option */
-#define DEFAULT_INCREMENT 1024 * 1024
+#define DEFAULT_INCREMENT (1024 * 1024)
static char * fname_g = NULL;
static hbool_t clear_status_flags = FALSE;
@@ -45,39 +45,10 @@ static hsize_t increment = DEFAULT_INCREMENT;
* Command-line options: only publicize long options
*/
static const char * s_opts = "hVsmzi*";
-static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
- {"hel", no_arg, 'h'},
- {"he", no_arg, 'h'},
- {"version", no_arg, 'V'},
- {"version", no_arg, 'V'},
- {"versio", no_arg, 'V'},
- {"versi", no_arg, 'V'},
- {"vers", no_arg, 'V'},
- {"status", no_arg, 's'},
- {"statu", no_arg, 's'},
- {"stat", no_arg, 's'},
- {"sta", no_arg, 's'},
- {"st", no_arg, 's'},
- {"image", no_arg, 'm'},
- {"imag", no_arg, 'm'},
- {"ima", no_arg, 'm'},
- {"im", no_arg, 'm'},
- {"filesize", no_arg, 'z'},
- {"filesiz", no_arg, 'z'},
- {"filesi", no_arg, 'z'},
- {"files", no_arg, 'z'},
- {"file", no_arg, 'z'},
- {"fil", no_arg, 'z'},
- {"fi", no_arg, 'z'},
- {"increment", optional_arg, 'i'},
- {"incremen", optional_arg, 'i'},
- {"increme", optional_arg, 'i'},
- {"increm", optional_arg, 'i'},
- {"incre", optional_arg, 'i'},
- {"incr", optional_arg, 'i'},
- {"inc", optional_arg, 'i'},
- {"in", optional_arg, 'i'},
- {NULL, 0, '\0'}};
+static struct h5_long_options l_opts[] = {
+ {"help", no_arg, 'h'}, {"version", no_arg, 'V'}, {"status", no_arg, 's'},
+ {"image", no_arg, 'm'}, {"filesize", no_arg, 'z'}, {"increment", optional_arg, 'i'},
+ {NULL, 0, '\0'}};
/*-------------------------------------------------------------------------
* Function: usage
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 7894a4b..4b423c4 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -198,8 +198,8 @@ const H5L_class_t UD_link_class[1] = {{
#define DIM1 20
#define DIM2 10
-#define CDIM1 DIM1 / 2
-#define CDIM2 DIM2 / 2
+#define CDIM1 (DIM1 / 2)
+#define CDIM2 (DIM2 / 2)
#define RANK 2
/* Dataspace of 0 dimension size */
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index eae7f15..fd21d6c 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -109,7 +109,7 @@ main(int argc, const char *argv[])
filename = HDstrdup(argv[H5_optind]);
size = 0;
- if (EOF == (res = sscanf(nbytes, "%u", &size))) {
+ if (EOF == (res = HDsscanf(nbytes, "%u", &size))) {
/* fail */
error_msg("missing file name\n");
usage(h5tools_getprogname());
diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c
index 2674c67..5632cc0 100644
--- a/tools/test/h5jam/h5jamgentest.c
+++ b/tools/test/h5jam/h5jamgentest.c
@@ -55,7 +55,7 @@ UD_traverse(const char H5_ATTR_UNUSED *link_name, hid_t H5_ATTR_UNUSED cur_group
const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t H5_ATTR_UNUSED lapl_id,
hid_t H5_ATTR_UNUSED dxpl_id)
{
- return -1;
+ return H5I_INVALID_HID;
}
#define MY_LINKCLASS 187
@@ -87,196 +87,311 @@ g1.2.1 : slink
g2 : dset2.1 dset2.2 udlink
*/
-static void
+static herr_t
gent_ub(const char *filename, size_t ub_size, size_t ub_fill)
{
- hid_t fid, group, attr, dataset, space;
- hid_t create_plist;
+ hid_t fid = H5I_INVALID_HID;
+ hid_t group = H5I_INVALID_HID;
+ hid_t attr = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t create_plist = H5I_INVALID_HID;
hsize_t dims[2];
int data[2][2], dset1[10][10], dset2[20];
char buf[BUF_SIZE];
int i, j;
size_t u;
float dset2_1[10], dset2_2[3][5];
- int fd;
- char * bp;
+ int fd = -1;
if (ub_size > 0) {
- create_plist = H5Pcreate(H5P_FILE_CREATE);
- H5Pset_userblock(create_plist, (hsize_t)ub_size);
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT);
+ if ((create_plist = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ goto error;
+ if (H5Pset_userblock(create_plist, (hsize_t)ub_size) < 0)
+ goto error;
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT)) < 0)
+ goto error;
}
else {
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
}
- /* create groups */
- group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ /* Create groups */
+ if ((group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
+ if ((group = H5Gcreate2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
- /* root attributes */
- group = H5Gopen2(fid, "/", H5P_DEFAULT);
+ /* Root attributes */
+ if ((group = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0)
+ goto error;
dims[0] = 10;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "abcdefghi");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
-
- dims[0] = 2;
- dims[1] = 2;
- space = H5Screate_simple(2, dims, NULL);
- attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "abcdefghi") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
+
+ dims[0] = 2;
+ dims[1] = 2;
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(group, "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
data[0][0] = 0;
data[0][1] = 1;
data[1][0] = 2;
data[1][1] = 3;
- H5Awrite(attr, H5T_NATIVE_INT, data);
- H5Sclose(space);
- H5Aclose(attr);
+ if (H5Awrite(attr, H5T_NATIVE_INT, data) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
- H5Gclose(group);
+ if (H5Gclose(group) < 0)
+ goto error;
- group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT);
+ if ((group = H5Gopen2(fid, "/g1/g1.1", H5P_DEFAULT)) < 0)
+ goto error;
- /* dset1.1.1 */
+ /* Dataset 1.1.1 */
dims[0] = 10;
dims[1] = 10;
- space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 10; i++)
for (j = 0; j < 10; j++)
dset1[i][j] = j * i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
- H5Sclose(space);
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
- /* attributes of dset1.1.1 */
+ /* Attributes of dset1.1.1 */
dims[0] = 27;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "1st attribute of dset1.1.1");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "1st attribute of dset1.1.1") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
dims[0] = 27;
- space = H5Screate_simple(1, dims, NULL);
- attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "2nd attribute of dset1.1.1");
- H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
- H5Sclose(space);
- H5Aclose(attr);
-
- H5Dclose(dataset);
-
- /* dset1.1.2 */
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if (HDsprintf(buf, "2nd attribute of dset1.1.1") < 0)
+ goto error;
+ if (H5Awrite(attr, H5T_NATIVE_SCHAR, buf) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Aclose(attr) < 0)
+ goto error;
+
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ /* Dataset 1.1.2 */
dims[0] = 20;
- space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 20; i++)
dset2[i] = i;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
- H5Sclose(space);
- H5Dclose(dataset);
-
- H5Gclose(group);
-
- /* external link */
- H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT);
-
- /* soft link */
- group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT);
- H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT);
- H5Gclose(group);
-
- group = H5Gopen2(fid, "/g2", H5P_DEFAULT);
-
- /* dset2.1 */
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ /* External link */
+ if (H5Lcreate_external("somefile", "somepath", fid, "/g1/g1.2/extlink", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ goto error;
+
+ /* Soft link */
+ if ((group = H5Gopen2(fid, "/g1/g1.2/g1.2.1", H5P_DEFAULT)) < 0)
+ goto error;
+ if (H5Lcreate_soft("somevalue", group, "slink", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ goto error;
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ if ((group = H5Gopen2(fid, "/g2", H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Dataset 2.1 */
dims[0] = 10;
- space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 10; i++)
dset2_1[i] = (float)((float)i * 0.1F + 1.0F);
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
- H5Sclose(space);
- H5Dclose(dataset);
-
- /* dset2.2 */
+ if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ /* Dataset 2.2 */
dims[0] = 3;
dims[1] = 5;
- space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+ if ((dataset =
+ H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
for (i = 0; i < 3; i++)
for (j = 0; j < 5; j++)
dset2_2[i][j] = (float)(((float)i + 1.0F) * (float)j * 0.1F);
- H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
- H5Sclose(space);
- H5Dclose(dataset);
-
- H5Gclose(group);
-
- /* user-defined link */
- H5Lregister(UD_link_class);
- H5Lcreate_ud(fid, "/g2/udlink", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT);
-
- H5Fclose(fid);
+ if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2) < 0)
+ goto error;
+ if (H5Sclose(space) < 0)
+ goto error;
+ if (H5Dclose(dataset) < 0)
+ goto error;
+
+ if (H5Gclose(group) < 0)
+ goto error;
+
+ /* User-defined link */
+ if (H5Lregister(UD_link_class) < 0)
+ goto error;
+ if (H5Lcreate_ud(fid, "/g2/udlink", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) <
+ 0)
+ goto error;
+
+ /* MUST close the file ID before the user block code or you risk tripping
+ * over file locking issues.
+ */
+ if (H5Fclose(fid) < 0)
+ goto error;
/* If a user block is being used, write to it here */
if (ub_size > 0) {
- HDassert(ub_size <= BUF_SIZE);
+ char *bp;
+
+ if (ub_size > BUF_SIZE)
+ goto error;
- fd = HDopen(filename, O_RDWR);
- HDassert(fd >= 0);
+ if ((fd = HDopen(filename, O_RDWR)) < 0)
+ goto error;
- /* fill buf with pattern */
+ /* Fill buf with pattern */
HDmemset(buf, '\0', ub_size);
bp = buf;
for (u = 0; u < ub_fill; u++)
*bp++ = pattern[u % 10];
- (void)HDwrite(fd, buf, ub_size);
+ if (HDwrite(fd, buf, ub_size) < 0)
+ goto error;
+ if (HDclose(fd) < 0)
+ goto error;
+ }
+
+ return SUCCEED;
+
+error:
+ if (fd >= 0)
HDclose(fd);
+
+ H5E_BEGIN_TRY
+ {
+ H5Fclose(fid);
+ H5Gclose(group);
+ H5Aclose(attr);
+ H5Dclose(dataset);
+ H5Sclose(space);
+ H5Pclose(create_plist);
}
+ H5E_END_TRY;
+
+ return FAIL;
}
-static void
+/* Creates a simple (i.e., not HDF5) text file and fills it with a pattern */
+static herr_t
create_textfile(const char *name, size_t size)
{
- char * buf;
- int fd;
+ char * buf = NULL;
+ int fd = -1;
size_t i;
- char * bp;
+ char * bp = NULL;
- fd = HDcreat(name, 0777);
- HDassert(fd >= 0);
- buf = (char *)HDcalloc(size, (size_t)1);
- HDassert(buf);
+ if ((fd = HDcreat(name, 0777)) < 0)
+ goto error;
+ if (NULL == (buf = (char *)HDcalloc(size, 1)))
+ goto error;
- /* fill buf with pattern */
+ /* Fill buf with pattern */
bp = buf;
for (i = 0; i < size; i++)
*bp++ = pattern[i % 10];
- (void)HDwrite(fd, buf, size);
+ if (HDwrite(fd, buf, size) < 0)
+ goto error;
HDfree(buf);
-
HDclose(fd);
+
+ return SUCCEED;
+
+error:
+ HDfree(buf);
+ if (fd >= 0)
+ HDclose(fd);
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
@@ -287,14 +402,25 @@ create_textfile(const char *name, size_t size)
int
main(void)
{
- create_textfile(UBTXT2, (size_t)10);
- create_textfile(UBTXT3, (size_t)511);
- create_textfile(UBTXT4, (size_t)512);
- create_textfile(UBTXT5, (size_t)513);
-
- gent_ub(FILE7, (size_t)0, (size_t)0);
- gent_ub(FILE8, (size_t)512, HDstrlen(pattern));
- gent_ub(FILE9, (size_t)1024, (size_t)513);
-
- return 0;
+ if (create_textfile(UBTXT2, 10) < 0)
+ goto error;
+ if (create_textfile(UBTXT3, 511) < 0)
+ goto error;
+ if (create_textfile(UBTXT4, 512) < 0)
+ goto error;
+ if (create_textfile(UBTXT5, 513) < 0)
+ goto error;
+
+ if (gent_ub(FILE7, 0, 0) < 0)
+ goto error;
+ if (gent_ub(FILE8, 512, HDstrlen(pattern)) < 0)
+ goto error;
+ if (gent_ub(FILE9, 1024, 513) < 0)
+ goto error;
+
+ return EXIT_SUCCESS;
+
+error:
+ HDfprintf(stderr, "h5jam test generator FAILED\n");
+ return EXIT_FAILURE;
}
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index 4f1343e..34d0b53 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -111,8 +111,8 @@ const char *H5REPACK_FILENAMES[] = {"h5repack_big_out", NULL};
#define DIM1 40
#define DIM2 20
-#define CDIM1 DIM1 / 2
-#define CDIM2 DIM2 / 2
+#define CDIM1 (DIM1 / 2)
+#define CDIM2 (DIM2 / 2)
#define RANK 2
/* Size of userblock (for userblock test) */
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index 79de6b9..d4238b5 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -207,7 +207,7 @@
# -d --di=15
ADD_H5_ERR_TEST (h5stat_err1_dims 1 -d --dims=-1 h5stat_threshold.h5)
ADD_H5_TEST (h5stat_dims1 0 -gd -m 5 h5stat_threshold.h5)
- ADD_H5_TEST (h5stat_dims2 0 -d --di=15 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_dims2 0 -d --dims=15 h5stat_threshold.h5)
#
# Tests for -a option on h5stat_threshold.h5
# -a -2 (incorrect threshold value)
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index a9813e7..c775d6a 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -51,7 +51,7 @@
* Generate HDF5 file with latest format with
* NUM_GRPS groups and NUM_ATTRS attributes for the dataset
*/
-static void
+static herr_t
gen_newgrat_file(const char *fname)
{
hid_t fcpl = H5I_INVALID_HID; /* File creation property */
@@ -117,6 +117,21 @@ gen_newgrat_file(const char *fname)
} /* end for */
/* Close dataset, dataspace, datatype, file */
+ if (H5Pclose(fapl) < 0)
+ goto error;
+ if (H5Pclose(fcpl) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Tclose(tid) < 0)
+ goto error;
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -130,6 +145,8 @@ error:
H5Fclose(fid);
}
H5E_END_TRY;
+
+ return FAIL;
} /* gen_newgrat_file() */
/*
@@ -139,7 +156,7 @@ error:
* datasets. -a N (--numattrs=N): Set the threshold for the # of attributes when printing information for
* small # of attributes.
*/
-static void
+static herr_t
gen_threshold_file(const char *fname)
{
hid_t fid = H5I_INVALID_HID; /* File ID */
@@ -302,6 +319,23 @@ gen_threshold_file(const char *fname)
goto error;
}
+ if (H5Gclose(gid) < 0)
+ goto error;
+ if (H5Sclose(sid0) < 0)
+ goto error;
+ if (H5Sclose(sid1) < 0)
+ goto error;
+ if (H5Sclose(sid2) < 0)
+ goto error;
+ if (H5Sclose(sid3) < 0)
+ goto error;
+ if (H5Sclose(sid4) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -317,6 +351,8 @@ error:
}
H5E_END_TRY;
+ return FAIL;
+
} /* gen_threshold_file() */
/*
@@ -327,18 +363,21 @@ error:
* one dataset: fixed dimension, chunked layout, w/ filters
*
*/
-static void
+static herr_t
gen_idx_file(const char *fname)
{
- hid_t fapl = H5I_INVALID_HID; /* file access property id */
- hid_t fid = H5I_INVALID_HID; /* file id */
- hid_t sid = H5I_INVALID_HID; /* space id */
- hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
- hid_t did = -1, did2 = H5I_INVALID_HID; /* dataset id */
- hsize_t dims[1] = {10}; /* dataset dimension */
- hsize_t c_dims[1] = {2}; /* chunk dimension */
- int i; /* local index variable */
- int buf[10]; /* data buffer */
+ hid_t fapl = H5I_INVALID_HID; /* file access property id */
+ hid_t fid = H5I_INVALID_HID; /* file id */
+ hid_t sid = H5I_INVALID_HID; /* space id */
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property id */
+ hid_t did = H5I_INVALID_HID; /* dataset id */
+#if defined(H5_HAVE_FILTER_DEFLATE)
+ hid_t did2 = H5I_INVALID_HID; /* dataset id (compressed) */
+#endif
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
/* Get a copy of the file access property */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -390,6 +429,19 @@ gen_idx_file(const char *fname)
#endif
/* closing: dataspace, dataset, file */
+ if (H5Pclose(fapl) < 0)
+ goto error;
+ if (H5Pclose(dcpl) < 0)
+ goto error;
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return SUCCEED;
+
error:
H5E_BEGIN_TRY
{
@@ -404,6 +456,8 @@ error:
}
H5E_END_TRY;
+ return FAIL;
+
} /* gen_idx_file() */
/*
@@ -419,20 +473,21 @@ error:
* H5O_refcount_decode in the jira issue.
*
*/
-static void
+static herr_t
gen_err_refcount(const char *fname)
{
- hid_t fid = H5I_INVALID_HID; /* File identifier */
- hid_t sid = H5I_INVALID_HID; /* Dataspace message */
- hid_t did = H5I_INVALID_HID; /* Dataset identifier */
- hid_t gid = H5I_INVALID_HID; /* Group identifier */
- hid_t aid1 = -1, aid2 = H5I_INVALID_HID; /* Attribute identifier */
- hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
- int i, n; /* Local index variables */
- int buf[10]; /* Data buffer */
- hsize_t dims[1]; /* Dimension size */
- int fd = -1; /* File descriptor */
- unsigned short val = 22; /* The refcount message ID */
+ hid_t fid = H5I_INVALID_HID; /* File identifier */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace message */
+ hid_t did = H5I_INVALID_HID; /* Dataset identifier */
+ hid_t gid = H5I_INVALID_HID; /* Group identifier */
+ hid_t aid1 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t aid2 = H5I_INVALID_HID; /* Attribute identifier */
+ hid_t tid = H5I_INVALID_HID; /* Datatype identifier */
+ int i, n; /* Local index variables */
+ int buf[10]; /* Data buffer */
+ hsize_t dims[1]; /* Dimension size */
+ int fd = -1; /* File descriptor */
+ unsigned short val = 22; /* The refcount message ID */
/* Initialize data buffer */
n = 0;
@@ -485,6 +540,10 @@ gen_err_refcount(const char *fname)
goto error;
if (H5Tclose(tid) < 0)
goto error;
+
+ /* Be sure to close this before opening the file again via open(), below,
+ * or you'll possibly trip over the file locking.
+ */
if (H5Fclose(fid) < 0)
goto error;
@@ -495,11 +554,16 @@ gen_err_refcount(const char *fname)
with the committed datatype */
/* 24: the offset in the object header containing the version of the
attribute message */
- if ((fd = HDopen(fname, O_RDWR, 0633)) >= 0) {
- HDlseek(fd, 4520 + 24, SEEK_SET);
- (void)HDwrite(fd, &val, 2);
- HDclose(fd);
- }
+ if ((fd = HDopen(fname, O_RDWR, 0633)) < 0)
+ goto error;
+ if (HDlseek(fd, 4520 + 24, SEEK_SET) < 0)
+ goto error;
+ if (HDwrite(fd, &val, 2) < 0)
+ goto error;
+ if (HDclose(fd) < 0)
+ goto error;
+
+ return SUCCEED;
error:
H5E_BEGIN_TRY
@@ -513,6 +577,11 @@ error:
H5Fclose(fid);
}
H5E_END_TRY;
+
+ if (fd >= 0)
+ HDclose(fd);
+
+ return FAIL;
} /* gen_err_refcount() */
/*
@@ -542,14 +611,22 @@ error:
int
main(void)
{
- gen_newgrat_file(NEWGRAT_FILE);
- gen_threshold_file(THRESHOLD_FILE);
+ if (gen_newgrat_file(NEWGRAT_FILE) < 0)
+ goto error;
+ if (gen_threshold_file(THRESHOLD_FILE) < 0)
+ goto error;
/* Generate an HDF file to test for datasets with Fixed Array indexing */
- gen_idx_file(IDX_FILE);
+ if (gen_idx_file(IDX_FILE) < 0)
+ goto error;
/* Generate a file with a refcount message ID */
- gen_err_refcount(ERR_REFCOUNT_FILE);
+ if (gen_err_refcount(ERR_REFCOUNT_FILE) < 0)
+ goto error;
+
+ return EXIT_SUCCESS;
- return 0;
+error:
+ HDfprintf(stderr, "h5stat test generator FAILED\n");
+ return EXIT_FAILURE;
}
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
index 470c381..647f06a 100644
--- a/tools/test/h5stat/testh5stat.sh.in
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -304,7 +304,7 @@ TOOLTEST h5stat_links5.ddl -g -l 40000 h5stat_newgrat.h5
# -d --di=15
TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5
TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5
-TOOLTEST h5stat_dims2.ddl -d --di=15 h5stat_threshold.h5
+TOOLTEST h5stat_dims2.ddl -d --dims=15 h5stat_threshold.h5
#
# Tests for -a option on h5stat_threshold.h5
# -a -2 (incorrect threshold value)
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index ec24a61..198a363 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -397,7 +397,7 @@
#
# The following are tests to verify the expected exit code from h5clear:
# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code)
-# "h5clear --vers" (valid option, version #, succeed exit code)
+# "h5clear --version" (valid option, version #, succeed exit code)
# "h5clear -k" (invalid 1 option, no file, fail exit code)
# "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code)
# "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code)
@@ -408,7 +408,7 @@
# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
# "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code)
ADD_H5_RETTEST (h5clr_mdc_image "false" "-m" h5clear_mdc_image.h5)
- ADD_H5_RETTEST (h5clr_vers "false" "--vers")
+ ADD_H5_RETTEST (h5clr_vers "false" "--version")
ADD_H5_RETTEST (h5clr_k "true" "-k")
ADD_H5_RETTEST (h5clr_k_junk "true" "-k" junk.h5)
ADD_H5_RETTEST (h5clr_l_sec2 "true" "-l" h5clear_sec2_v2.h5)
diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in
index c05e43d..a01fa4a 100644
--- a/tools/test/misc/testh5clear.sh.in
+++ b/tools/test/misc/testh5clear.sh.in
@@ -315,7 +315,7 @@ TOOLTEST_ERR orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.err
#
# The following are tests to verify the expected exit code from h5clear:
# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code)
-# "h5clear --vers" (valid option, version #, succeed exit code)
+# "h5clear --version" (valid option, version #, succeed exit code)
# "h5clear -k" (invalid 1 option, no file, fail exit code)
# "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code)
# "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code)
@@ -326,7 +326,7 @@ TOOLTEST_ERR orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.err
# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code)
# "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code)
TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED
-TOOLTEST "" --vers "" $SUCCEED
+TOOLTEST "" --version "" $SUCCEED
TOOLTEST "" -k "" $FAIL
TOOLTEST junk.h5 -k "" $FAIL
TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL
diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt
index 7399723..7bf79c5 100644
--- a/tools/test/perform/CMakeLists.txt
+++ b/tools/test/perform/CMakeLists.txt
@@ -4,39 +4,17 @@ project (HDF5_TOOLS_TEST_PERFORM C)
# --------------------------------------------------------------------
# Add the executables
# --------------------------------------------------------------------
-#-- Adding test for h5perf_serial
-set (h5perf_serial_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
-)
-add_executable (h5perf_serial ${h5perf_serial_SOURCES})
-target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5perf_serial STATIC)
- target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
-else ()
- TARGET_C_PROPERTIES (h5perf_serial SHARED)
- target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
-endif ()
-set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
-
-#-----------------------------------------------------------------------------
-# Add Target to clang-format
-#-----------------------------------------------------------------------------
-if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_FORMAT h5perf_serial)
-endif ()
if (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf_serial_alone - io_timer.c includes
set (h5perf_serial_alone_SOURCES
${HDF5_TOOLS_DIR}/lib/io_timer.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/sio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c
)
add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES})
- target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR};${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
@@ -188,63 +166,16 @@ if (HDF5_ENABLE_FORMATTERS)
endif ()
if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL)
- if (UNIX)
- #-- Adding test for perf - only on unix systems
- set (perf_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c
- )
- add_executable (perf ${perf_SOURCES})
- target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (perf STATIC)
- target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (perf SHARED)
- target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- endif ()
- set_target_properties (perf PROPERTIES FOLDER perform)
-
- #-----------------------------------------------------------------------------
- # Add Target to clang-format
- #-----------------------------------------------------------------------------
- if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_perf_FORMAT perf)
- endif ()
- endif ()
-
- #-- Adding test for h5perf
- set (h5perf_SOURCES
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
- )
- add_executable (h5perf ${h5perf_SOURCES})
- target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- if (NOT BUILD_SHARED_LIBS)
- TARGET_C_PROPERTIES (h5perf STATIC)
- target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- else ()
- TARGET_C_PROPERTIES (h5perf SHARED)
- target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- endif ()
- set_target_properties (h5perf PROPERTIES FOLDER perform)
-
- #-----------------------------------------------------------------------------
- # Add Target to clang-format
- #-----------------------------------------------------------------------------
- if (HDF5_ENABLE_FORMATTERS)
- clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_FORMAT h5perf)
- endif ()
-
if (HDF5_BUILD_PERFORM_STANDALONE)
#-- Adding test for h5perf
set (h5perf_alone_SOURCES
${HDF5_TOOLS_DIR}/lib/io_timer.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
- ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_perf.c
+ ${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR}/pio_engine.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c
)
add_executable (h5perf_alone ${h5perf_alone_SOURCES})
- target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_TOOLS_SRC_H5PERF_SOURCE_DIR};${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (h5perf_alone STATIC)
target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${LINK_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>")
diff --git a/tools/test/perform/Makefile.am b/tools/test/perform/Makefile.am
index 244ef3a..10b13fe 100644
--- a/tools/test/perform/Makefile.am
+++ b/tools/test/perform/Makefile.am
@@ -21,17 +21,6 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib
-# bin_PROGRAMS will be installed.
-if BUILD_PARALLEL_CONDITIONAL
- bin_PROGRAMS=h5perf_serial h5perf
-else
- bin_PROGRAMS=h5perf_serial
-endif
-
-# Add h5perf and h5perf_serial specific linker flags here
-h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-h5perf_serial_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
-
# Some programs are not built or run by default, but can be built by hand or by
# specifying --enable-build-all at configure time.
# Also, some of these programs should only be built in parallel.
@@ -47,18 +36,15 @@ endif
# List them in the order they should be run.
# Parallel test programs.
if BUILD_PARALLEL_CONDITIONAL
- TEST_PROG_PARA=h5perf perf
+ TEST_PROG_PARA=
endif
# Serial test programs.
-TEST_PROG = iopipe chunk chunk_cache overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
+TEST_PROG = iopipe chunk chunk_cache overhead zip_perf perf_meta $(BUILD_ALL_PROGS)
# check_PROGRAMS will be built but not installed. Do not any executable
# that is in bin_PROGRAMS already. Otherwise, it will be removed twice in
# "make clean" and some systems, e.g., AIX, do not like it.
-check_PROGRAMS= iopipe chunk chunk_cache overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
-
-h5perf_SOURCES=pio_perf.c pio_engine.c
-h5perf_serial_SOURCES=sio_perf.c sio_engine.c
+check_PROGRAMS= $(TEST_PROG) $(BUILD_ALL_PROGS)
# These are the files that `make clean' (and derivatives) will remove from
# this directory.
@@ -67,9 +53,6 @@ CLEANFILES=*.h5 *.raw *.dat x-gnuplot perftest.out
# All of the programs depend on the main hdf5 library, and some of them
# depend on test or tools library.
LDADD=$(LIBHDF5)
-h5perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
-h5perf_serial_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
-perf_LDADD=$(LIBH5TEST) $(LIBHDF5)
iopipe_LDADD=$(LIBH5TEST) $(LIBHDF5)
zip_perf_LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
perf_meta_LDADD=$(LIBH5TEST) $(LIBHDF5)
diff --git a/tools/test/perform/chunk.c b/tools/test/perform/chunk.c
index 1b08e95..1b6793a 100644
--- a/tools/test/perform/chunk.c
+++ b/tools/test/perform/chunk.c
@@ -24,10 +24,12 @@
#undef NDEBUG
#include "hdf5.h"
+#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#endif
/* Solaris Studio defines attribute, but for the attributes we need */
#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C)
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index 25fa34c..b515961 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -26,9 +26,9 @@
#define RANK 2
#define DSET1_NAME "partial_chunks"
-#define DSET1_DIM1 9 * 1000
+#define DSET1_DIM1 (9 * 1000)
#define DSET1_DIM2 9
-#define CHUNK1_DIM1 2 * 1000
+#define CHUNK1_DIM1 (2 * 1000)
#define CHUNK1_DIM2 2
#define DSET2_NAME "hash_value"
@@ -38,7 +38,7 @@
#define CHUNK2_DIM2 100
#define RDCC_NSLOTS 5
-#define RDCC_NBYTES 1024 * 1024 * 10
+#define RDCC_NBYTES (1024 * 1024 * 10)
#define RDCC_W0 0.75F
#define FILTER_COUNTER 306
diff --git a/tools/test/perform/direct_write_perf.c b/tools/test/perform/direct_write_perf.c
index 6537215..b3ae54d 100644
--- a/tools/test/perform/direct_write_perf.c
+++ b/tools/test/perform/direct_write_perf.c
@@ -23,11 +23,14 @@
#if !defined(WIN32) && !defined(__MINGW32__)
+#include <math.h>
+
+#ifdef H5_STDC_HEADERS
#include <errno.h>
#include <fcntl.h>
-#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index 2aa9e25..d0db06a 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -95,6 +95,7 @@ print_stats(const char *prefix,
static void
synchronize(void)
{
+#ifdef H5_HAVE_SYSTEM
#if defined(H5_HAVE_WIN32_API) && !defined(__CYGWIN__)
_flushall();
#else
@@ -106,6 +107,7 @@ synchronize(void)
status = HDsystem("df >/dev/null");
HDassert(status >= 0);
#endif
+#endif
}
/*-------------------------------------------------------------------------
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index 60ec8d8..dba8220 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -23,11 +23,17 @@
#include "hdf5.h"
#include "H5private.h"
+#ifdef H5_STDC_HEADERS
#include <ctype.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
+#endif
+
+#ifdef H5_HAVE_IO_H
+#include <io.h>
+#endif
#ifdef H5_HAVE_UNISTD_H
#include <sys/types.h>
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index ded15a4..032bfba 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -17,10 +17,6 @@
#include "pio_perf.h"
-#ifdef STANDALONE
-MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */
-#endif
-
/** From h5tools_utils.c **/
/* global variables */
@@ -156,134 +152,3 @@ print_version(const char *progname)
printf("%s: Version %u.%u.%u%s%s\n", progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE,
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-#ifdef STANDALONE
-/*
- * Function: h5_set_info_object
- * Purpose: Process environment variables setting to set up MPI Info
- * object.
- * Return: 0 if all is fine; otherwise non-zero.
- * Programmer: Albert Cheng, 2002/05/21.
- * Modifications:
- * Bill Wendling, 2002/05/31
- * Modified so that the HDF5_MPI_INFO environment variable can
- * be a semicolon separated list of "key=value" pairings. Most
- * of the code is to remove any whitespaces which might be
- * surrounding the "key=value" pairs.
- */
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value = 0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL) {
- char *next, *valp;
-
- valp = envp = next = HDstrdup(envp);
-
- if (!valp)
- return 0;
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char * key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = (char *)HDcalloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- if (!*namep)
- continue; /* was all white space, so move to next k/v pair */
-
- /* eat up any ending white spaces */
- endp = &namep[HDstrlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
-
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- HDprintf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-/*
- * Function: h5_dump_info_object
- * Purpose: Display content of an MPI Info object
- * Return: void
- * Programmer: Albert Cheng 2002/05/21
- * Modifications:
- */
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY + 1];
- char value[MPI_MAX_INFO_VAL + 1];
- int flag;
- int i, nkeys;
-
- HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", MPI_MAX_INFO_VAL);
- if (info == MPI_INFO_NULL) {
- HDprintf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- HDprintf("object has %d items\n", nkeys);
- for (i = 0; i < nkeys; i++) {
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- HDprintf("%s=%s\n", key, value);
- }
- }
-}
-#endif /* STANDALONE */
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index 813ad2d..23cd0e8 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -21,6 +21,10 @@
#include "H5public.h" /* Include Public Definitions */
+/*
+ * Include ANSI-C header files.
+ */
+#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -33,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#endif
/*
* Redefine all the POSIX functions. We should never see a POSIX
@@ -458,17 +463,6 @@ extern char * strdup(const char *s);
#define TRUE true
#endif
-/** From h5test.h **/
-
-#ifdef H5_HAVE_PARALLEL
-extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
-#endif
-
-#ifdef H5_HAVE_PARALLEL
-int h5_set_info_object(void);
-void h5_dump_info_object(MPI_Info info);
-#endif
-
/** From h5tools_utils.h **/
H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index 9a2a8c6..bf925f1 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -21,6 +21,10 @@
#include "H5public.h" /* Include Public Definitions */
+/*
+ * Include ANSI-C header files.
+ */
+#ifdef H5_STDC_HEADERS
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -33,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#endif
/* maximum of two, three, or four values */
#undef MAX
@@ -473,17 +478,6 @@ extern char * strdup(const char *s);
#define TRUE true
#endif
-/** From h5test.h **/
-
-#ifdef H5_HAVE_PARALLEL
-extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */
-#endif
-
-#ifdef H5_HAVE_PARALLEL
-int h5_set_info_object(void);
-void h5_dump_info_object(MPI_Info info);
-#endif
-
/** From h5tools_utils.h **/
H5_DLLVAR int H5_opterr; /* getoption prints errors if this is on */
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index 6231587..d8cd3a1 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -35,7 +35,7 @@
#define MICROSECOND 1000000.0
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes, t) ((fabs(t) < 0.0000000001) ? 0.0 : ((((double)bytes) / (double)ONE_MB) / (t)))
+#define MB_PER_SEC(bytes, t) ((fabs(t) < 0.0000000001) ? 0.0 : ((((double)(bytes)) / (double)ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -67,62 +67,11 @@ static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, u
static const char * s_opts = "hB:b:c:p:rs:0123456789";
static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'},
{"compressability", require_arg, 'c'},
- {"compressabilit", require_arg, 'c'},
- {"compressabili", require_arg, 'c'},
- {"compressabil", require_arg, 'c'},
- {"compressabi", require_arg, 'c'},
- {"compressab", require_arg, 'c'},
- {"compressa", require_arg, 'c'},
- {"compress", require_arg, 'c'},
- {"compres", require_arg, 'c'},
- {"compre", require_arg, 'c'},
- {"compr", require_arg, 'c'},
- {"comp", require_arg, 'c'},
- {"com", require_arg, 'c'},
- {"co", require_arg, 'c'},
{"file-size", require_arg, 's'},
- {"file-siz", require_arg, 's'},
- {"file-si", require_arg, 's'},
- {"file-s", require_arg, 's'},
- {"file", require_arg, 's'},
- {"fil", require_arg, 's'},
- {"fi", require_arg, 's'},
{"max-buffer-size", require_arg, 'B'},
- {"max-buffer-siz", require_arg, 'B'},
- {"max-buffer-si", require_arg, 'B'},
- {"max-buffer-s", require_arg, 'B'},
- {"max-buffer", require_arg, 'B'},
- {"max-buffe", require_arg, 'B'},
- {"max-buff", require_arg, 'B'},
- {"max-buf", require_arg, 'B'},
- {"max-bu", require_arg, 'B'},
- {"max-b", require_arg, 'B'},
- {"max", require_arg, 'B'},
{"min-buffer-size", require_arg, 'b'},
- {"min-buffer-siz", require_arg, 'b'},
- {"min-buffer-si", require_arg, 'b'},
- {"min-buffer-s", require_arg, 'b'},
- {"min-buffer", require_arg, 'b'},
- {"min-buffe", require_arg, 'b'},
- {"min-buff", require_arg, 'b'},
- {"min-buf", require_arg, 'b'},
- {"min-bu", require_arg, 'b'},
- {"min-b", require_arg, 'b'},
- {"min", require_arg, 'b'},
{"prefix", require_arg, 'p'},
- {"prefi", require_arg, 'p'},
- {"pref", require_arg, 'p'},
- {"pre", require_arg, 'p'},
- {"pr", require_arg, 'p'},
{"random-test", no_arg, 'r'},
- {"random-tes", no_arg, 'r'},
- {"random-te", no_arg, 'r'},
- {"random-t", no_arg, 'r'},
- {"random", no_arg, 'r'},
- {"rando", no_arg, 'r'},
- {"rand", no_arg, 'r'},
- {"ran", no_arg, 'r'},
- {"ra", no_arg, 'r'},
{NULL, 0, '\0'}};
/*