summaryrefslogtreecommitdiffstats
path: root/tools/test/perform
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/perform')
-rw-r--r--tools/test/perform/CMakeTests.cmake53
-rw-r--r--tools/test/perform/iopipe.c14
-rw-r--r--tools/test/perform/overhead.c6
-rw-r--r--tools/test/perform/perf.c12
-rw-r--r--tools/test/perform/perf_meta.c28
-rw-r--r--tools/test/perform/pio_engine.c130
-rw-r--r--tools/test/perform/pio_perf.c344
-rw-r--r--tools/test/perform/pio_standalone.h2
-rw-r--r--tools/test/perform/sio_engine.c82
-rw-r--r--tools/test/perform/sio_perf.c254
-rw-r--r--tools/test/perform/sio_standalone.h2
11 files changed, 476 insertions, 451 deletions
diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake
index 20e7f59..f0ae416 100644
--- a/tools/test/perform/CMakeTests.cmake
+++ b/tools/test/perform/CMakeTests.cmake
@@ -53,9 +53,10 @@ add_test (
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>)
+ add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>)
else ()
add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -66,17 +67,20 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_h5perf_serial PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>)
+ add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>)
endif ()
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>)
+ add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>)
else ()
add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -87,12 +91,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_chunk PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>)
+ add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>)
else ()
add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -103,12 +110,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_iopipe PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>)
+ add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>)
else ()
add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -119,12 +129,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_overhead PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>)
+ add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>)
else ()
add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -135,12 +148,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_perf_meta PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h")
+ add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h")
else ()
add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -151,12 +167,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf_help PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5)
+ add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5)
else ()
add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -167,7 +186,9 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf PROPERTIES
+ DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects"
+)
if (H5_HAVE_PARALLEL)
if (UNIX)
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index eac099b..2d9c44f 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -224,7 +224,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill raw");
+ HDfprintf (stderr, HEADING, "fill raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -262,7 +262,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill hdf5");
+ HDfprintf (stderr, HEADING, "fill hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -301,7 +301,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out raw");
+ HDfprintf (stderr, HEADING, "out raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -341,7 +341,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out hdf5");
+ HDfprintf (stderr, HEADING, "out hdf5");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -380,7 +380,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in raw");
+ HDfprintf (stderr, HEADING, "in raw");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -421,7 +421,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5");
+ HDfprintf (stderr, HEADING, "in hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -465,7 +465,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5 partial");
+ HDfprintf (stderr, HEADING, "in hdf5 partial");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index 81f9de6..108d9e4 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -84,9 +84,9 @@ typedef enum fill_t {
static void
usage(const char *prog)
{
- fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
+ HDfprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
prog);
- fprintf(stderr, "\
+ HDfprintf(stderr, "\
STYLE is the order that the dataset is filled and should be one of:\n\
forward -- Fill the dataset from lowest address to highest\n\
address. This style tests the right split ratio.\n\
@@ -401,6 +401,6 @@ main(int argc, char *argv[])
return 0;
error:
- fprintf(stderr, "*** ERRORS DETECTED ***\n");
+ HDfprintf(stderr, "*** ERRORS DETECTED ***\n");
return 1;
}
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index 1d52471..34b8a2d 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -64,13 +64,13 @@
#define H5FATAL 1
#define VRFY(val, mesg, fatal) do { \
if (!val) { \
- printf("Proc %d: ", mynod); \
+ printf("Proc %d: ", mynod); \
printf("*** Assertion failed (%s) at line %4d in %s\n", \
- mesg, (int)__LINE__, __FILE__); \
- if (fatal){ \
- fflush(stdout); \
- goto die_jar_jar_die; \
- } \
+ mesg, (int)__LINE__, __FILE__); \
+ if (fatal){ \
+ fflush(stdout); \
+ goto die_jar_jar_die; \
+ } \
} \
} while(0)
#define RANK 1
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index c24e598..b56f074 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -313,7 +313,7 @@ create_dsets(hid_t file)
* Create a dataset using the default dataset creation properties.
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
@@ -378,14 +378,14 @@ create_attrs_1(void)
* Create all(user specifies the number) attributes for each dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -422,7 +422,7 @@ create_attrs_1(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
+ HDfprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(open_t, close_t, attr_t);
}
@@ -480,7 +480,7 @@ create_attrs_2(void)
* Create all(user specifies the number) attributes for each new dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
create_t.start = retrieve_time();
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE,
space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -488,7 +488,7 @@ create_attrs_2(void)
perf(&create_t, create_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -525,7 +525,7 @@ create_attrs_2(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
+ HDfprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(create_t, close_t, attr_t);
}
@@ -593,14 +593,14 @@ create_attrs_3(void)
for(i = 0; i < loop_num; i++) {
for(j = 0; j < NUM_DSETS; j++) {
- sprintf(dset_name, "dataset %d", j);
+ HDsprintf(dset_name, "dataset %d", j);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(k = 0; k < BATCH_ATTRS; k++) {
- sprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ HDsprintf(attr_name, "some attrs for each dset %d %d", i, k);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -637,7 +637,7 @@ create_attrs_3(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
+ HDfprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
BATCH_ATTRS, NUM_DSETS, loop_num);
print_perf(open_t, close_t, attr_t);
}
@@ -750,12 +750,12 @@ void perf(p_time *perf_t, double start_t, double end_t)
*/
void print_perf(p_time open_t, p_time close_t, p_time attr_t)
{
- fprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
open_t.func, open_t.avg, open_t.max, open_t.min);
- fprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
close_t.avg, close_t.max, close_t.min);
if(NUM_ATTRS)
- fprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
attr_t.avg, attr_t.max, attr_t.min);
}
@@ -799,7 +799,7 @@ main(int argc, char **argv)
#ifdef H5_HAVE_PARALLEL
if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS))
#endif /*H5_HAVE_PARALLEL*/
- fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
+ HDfprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
fapl = H5Pcreate (H5P_FILE_ACCESS);
#ifdef H5_HAVE_PARALLEL
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index d47cd43..77c04ab 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -61,14 +61,14 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define GOTODONE { goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
#define MSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "(%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "(%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -194,7 +194,7 @@ do_pio(parameters param)
break;
default:
/* unknown request */
- fprintf(stderr, "Unknown IO type request (%d)\n", iot);
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", iot);
GOTOERROR(FAIL);
}
@@ -213,21 +213,21 @@ do_pio(parameters param)
}
if (param.num_files < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of files must be >= 0 (%ld)\n",
param.num_files);
GOTOERROR(FAIL);
}
if (ndsets < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of datasets per file must be >= 0 (%ld)\n",
ndsets);
GOTOERROR(FAIL);
}
if (param.num_procs <= 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"maximum number of process to use must be > 0 (%d)\n",
param.num_procs);
GOTOERROR(FAIL);
@@ -292,7 +292,7 @@ do_pio(parameters param)
/* output all of the times for all iterations */
if (myrank == 0)
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
}
for (nf = 1; nf <= param.num_files; nf++) {
@@ -302,7 +302,7 @@ do_pio(parameters param)
/* Open file for write */
char base_name[256];
- sprintf(base_name, "#pio_tmp_%lu", nf);
+ HDsprintf(base_name, "#pio_tmp_%lu", nf);
pio_create_filename(iot, base_name, fname, sizeof(fname));
if (pio_debug_level > 0)
HDfprintf(output, "rank %d: data filename=%s\n",
@@ -311,21 +311,21 @@ do_pio(parameters param)
/* Need barrier to make sure everyone starts at the same time */
MPI_Barrier(pio_comm_g);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_CREATE | PIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -339,20 +339,20 @@ do_pio(parameters param)
MPI_Barrier(pio_comm_g);
/* Open file for read */
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -385,7 +385,7 @@ done:
/* release generic resources */
if(buffer)
- free(buffer);
+ HDfree(buffer);
res.ret_code = ret_code;
return res;
}
@@ -620,7 +620,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Prepare buffer for verifying data */
if (parms->verify)
- memset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
+ HDmemset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
} /* end else */
@@ -853,7 +853,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -861,7 +861,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -883,7 +883,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
case PHDF5:
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* 1D dataspace */
@@ -894,7 +894,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[0] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 1, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -907,25 +907,25 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[1] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 2, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
}/* end else */
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, h5dcpl);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset Create failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Create failed\n");
GOTOERROR(FAIL);
}
hrc = H5Pclose(h5dcpl);
/* verifying the close of the dcpl */
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
break;
@@ -958,7 +958,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Write */
@@ -1389,7 +1389,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -1398,7 +1398,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -1455,7 +1455,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -1465,7 +1465,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -1475,7 +1475,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -1824,7 +1824,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1832,7 +1832,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -1852,10 +1852,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
break;
case PHDF5:
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset open failed\n");
+ HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
@@ -1889,7 +1889,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Read */
@@ -2344,7 +2344,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
@@ -2353,7 +2353,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -2410,7 +2410,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -2420,7 +2420,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -2430,7 +2430,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -2461,7 +2461,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fd->posixfd = POSIXOPEN(fname, O_RDONLY);
if (fd->posixfd < 0 ) {
- fprintf(stderr, "POSIX File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2485,7 +2485,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2493,13 +2493,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
/*filesize , set size to 0 explicitedly. */
mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_File_set_size failed\n");
+ HDfprintf(stderr, "MPI_File_set_size failed\n");
GOTOERROR(FAIL);
}
} else {
mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
}
@@ -2508,19 +2508,19 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
case PHDF5:
if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* Set the file driver to the MPI-IO driver */
if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
/* Set the alignment of objects in HDF5 file */
if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
@@ -2530,13 +2530,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
else
fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl);
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
/* verifying the close of the acc_tpl */
if (H5Pclose(acc_tpl) < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
@@ -2565,7 +2565,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2576,7 +2576,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
mrc = MPI_File_close(&fd->mpifd);
if (mrc != MPI_SUCCESS){
- fprintf(stderr, "MPI File close failed\n");
+ HDfprintf(stderr, "MPI File close failed\n");
GOTOERROR(FAIL);
}
@@ -2587,7 +2587,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2621,7 +2621,7 @@ do_cleanupfile(iotype iot, char *fname)
if (clean_file_g){
switch (iot){
case POSIXIO:
- remove(fname);
+ HDremove(fname);
break;
case MPIO:
case PHDF5:
@@ -2639,9 +2639,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, TSTART);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -2650,9 +2650,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, TSTART);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -2660,9 +2660,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, TSTART);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
@@ -2670,9 +2670,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, TSTART);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 597629e..9f4d116 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -277,13 +277,13 @@ struct options {
unsigned interleaved; /* Interleaved vs. contiguous blocks */
unsigned collective; /* Collective vs. independent I/O */
unsigned dim2d; /* 1D vs. 2D geometry */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
off_t h5_alignment; /* alignment in HDF5 file */
off_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
};
typedef struct _minmax {
@@ -339,12 +339,12 @@ main(int argc, char **argv)
ret = MPI_Comm_size(MPI_COMM_WORLD, &comm_world_nprocs_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -353,12 +353,12 @@ main(int argc, char **argv)
ret = MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -376,7 +376,7 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
perror(opts->output_file);
goto finish;
}
@@ -587,74 +587,74 @@ run_test(iotype iot, parameters parms, struct options *opts)
res = do_pio(parms);
/* gather all of the "mpi write" times */
- t = get_time(res.timers, HDF5_MPI_WRITE);
+ t = io_time_get(res.timers, HDF5_MPI_WRITE);
get_minmax(&write_mpi_mm, t);
write_mpi_mm_table[i] = write_mpi_mm;
/* gather all of the "write" times */
- t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
get_minmax(&write_mm, t);
write_mm_table[i] = write_mm;
/* gather all of the "write" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
get_minmax(&write_gross_mm, t);
write_gross_mm_table[i] = write_gross_mm;
/* gather all of the raw "write" times */
- t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
get_minmax(&write_raw_mm, t);
write_raw_mm_table[i] = write_raw_mm;
/* gather all of the file open times (time from open to first write) */
- t = get_time(res.timers, HDF5_FILE_WRITE_OPEN);
+ t = io_time_get(res.timers, HDF5_FILE_WRITE_OPEN);
get_minmax(&write_open_mm, t);
write_open_mm_table[i] = write_open_mm;
/* gather all of the file close times (time from last write to close) */
- t = get_time(res.timers, HDF5_FILE_WRITE_CLOSE);
+ t = io_time_get(res.timers, HDF5_FILE_WRITE_CLOSE);
get_minmax(&write_close_mm, t);
write_close_mm_table[i] = write_close_mm;
if (!parms.h5_write_only) {
/* gather all of the "mpi read" times */
- t = get_time(res.timers, HDF5_MPI_READ);
+ t = io_time_get(res.timers, HDF5_MPI_READ);
get_minmax(&read_mpi_mm, t);
read_mpi_mm_table[i] = read_mpi_mm;
/* gather all of the "read" times */
- t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
get_minmax(&read_mm, t);
read_mm_table[i] = read_mm;
/* gather all of the "read" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
get_minmax(&read_gross_mm, t);
read_gross_mm_table[i] = read_gross_mm;
/* gather all of the raw "read" times */
- t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
get_minmax(&read_raw_mm, t);
read_raw_mm_table[i] = read_raw_mm;
/* gather all of the file open times (time from open to first read) */
- t = get_time(res.timers, HDF5_FILE_READ_OPEN);
+ t = io_time_get(res.timers, HDF5_FILE_READ_OPEN);
get_minmax(&read_open_mm, t);
read_open_mm_table[i] = read_open_mm;
/* gather all of the file close times (time from last read to close) */
- t = get_time(res.timers, HDF5_FILE_READ_CLOSE);
+ t = io_time_get(res.timers, HDF5_FILE_READ_CLOSE);
get_minmax(&read_close_mm, t);
read_close_mm_table[i] = read_close_mm;
@@ -667,7 +667,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -733,7 +733,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -925,7 +925,7 @@ create_comm_world(int num_procs, int *doing_pio)
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (num_procs > nprocs) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n",
num_procs, nprocs);
goto error_done;
@@ -936,7 +936,7 @@ create_comm_world(int num_procs, int *doing_pio)
mrc = MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &pio_comm_g);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_Comm_split failed\n");
+ HDfprintf(stderr, "MPI_Comm_split failed\n");
goto error_done;
}
@@ -1065,9 +1065,9 @@ output_report(const char *fmt, ...)
if (myrank == 0) {
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
}
@@ -1087,10 +1087,10 @@ print_indent(register int indent)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
}
@@ -1115,11 +1115,11 @@ static void
print_io_api(long io_types)
{
if (io_types & PIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & PIO_MPI)
- HDfprintf(output, "mpiio ");
+ HDfprintf(output, "mpiio ");
if (io_types & PIO_HDF5)
- HDfprintf(output, "phdf5 ");
+ HDfprintf(output, "phdf5 ");
HDfprintf(output, "\n");
}
@@ -1128,7 +1128,7 @@ report_parameters(struct options *opts)
{
int rank = comm_world_rank_g;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "rank %d: ==== Parameters ====\n", rank);
HDfprintf(output, "rank %d: IO API=", rank);
@@ -1303,9 +1303,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= PIO_POSIX;
} else {
- fprintf(stderr, "pio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1345,17 +1345,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
if (!isdigit(buf[j])) {
- fprintf(stderr, "pio_perf: invalid --debug option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
pio_debug_level = atoi(buf);
@@ -1379,8 +1379,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1396,13 +1396,13 @@ parse_command_line(int argc, char *argv[])
cl_opts->num_bpp = parse_size_directive(opt_arg);
break;
case 'F':
- cl_opts->num_files = atoi(opt_arg);
+ cl_opts->num_files = HDatoi(opt_arg);
break;
case 'g':
cl_opts->dim2d = 1;
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'I':
cl_opts->interleaved = 1;
@@ -1411,10 +1411,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->output_file = opt_arg;
break;
case 'p':
- cl_opts->min_num_procs = atoi(opt_arg);
+ cl_opts->min_num_procs = HDatoi(opt_arg);
break;
case 'P':
- cl_opts->max_num_procs = atoi(opt_arg);
+ cl_opts->max_num_procs = HDatoi(opt_arg);
break;
case 'T':
cl_opts->h5_threshold = parse_size_directive(opt_arg);
@@ -1432,7 +1432,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1526,8 +1526,8 @@ parse_size_directive(const char *size)
s *= ONE_GB;
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1540,7 +1540,7 @@ parse_size_directive(const char *size)
* Return: Nothing
* Programmer: Bill Wendling, 31. October 2001
* Modifications:
- * Added 2D testing (Christian Chilan, 10. August 2005)
+ * Added 2D testing (Christian Chilan, 10. August 2005)
*/
static void
usage(const char *prog)
@@ -1550,125 +1550,125 @@ usage(const char *prog)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h, --help Print a usage message and exit\n");
- printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
- printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h, --help Print a usage message and exit\n");
+ HDprintf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
+ HDprintf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
#if 0
- printf(" -b, --binary The elusive binary option\n");
+ HDprintf(" -b, --binary The elusive binary option\n");
#endif /* 0 */
- printf(" -B S, --block-size=S Block size within transfer buffer\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
- printf(" [default: contiguous storage]\n");
- printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
- printf(" [default: independent I/O)\n");
- printf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
- printf(" -D DL, --debug=DL Indicate the debugging level\n");
- printf(" [default: no debugging]\n");
- printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
- printf(" (see below for description)\n");
- printf(" [default: 256K for 1D, 8K for 2D]\n");
- printf(" -F N, --num-files=N Number of files [default: 1]\n");
- printf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
- printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
- printf(" -I, --interleaved Interleaved access pattern\n");
- printf(" (see below for example)\n");
- printf(" [default: Contiguous access pattern]\n");
- printf(" -o F, --output=F Output raw data into file F [default: none]\n");
- printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
- printf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
- printf(" [default: all MPI_COMM_WORLD processes ]\n");
- printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
- printf(" [default: 1]\n");
- printf(" -w, --write-only Perform write tests not the read tests\n");
- printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
- printf(" [default: the number of bytes per process per\n");
- printf(" dataset]\n");
- printf("\n");
- printf(" F - is a filename.\n");
- printf(" N - is an integer >=0.\n");
- printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" phdf5 - Parallel HDF5\n");
- printf(" mpiio - MPI-I/O\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: --api=mpiio,phdf5\n");
- printf("\n");
- printf(" Dataset size:\n");
- printf(" Depending on the selected geometry, each test dataset is either a linear\n");
- printf(" array of size bytes-per-process * num-processes, or a square array of size\n");
- printf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
- printf("\n");
- printf(" Block size vs. Transfer buffer size:\n");
- printf(" buffer-size controls the size of the memory buffer, which is broken into\n");
- printf(" blocks and written to the file. Depending on the selected geometry, each\n");
- printf(" block can be a linear array of size block-size or a square array of size\n");
- printf(" block-size x block-size. The arrangement in which blocks are written is\n");
- printf(" determined by the access pattern.\n");
- printf("\n");
- printf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
- printf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
- printf(" or buffer-size x block-size if interleaved pattern is selected.\n");
- printf("\n");
- printf(" Interleaved and Contiguous patterns in 1D geometry:\n");
- printf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
- printf(" into num-processes regions and each process writes data to its own region.\n");
- printf(" When interleaved blocks are written to a dataset, space for the first\n");
- printf(" block of the first process is allocated in the dataset, then space is\n");
- printf(" allocated for the first block of the second process, etc. until space is\n");
- printf(" allocated for the first block of each process, then space is allocated for\n");
- printf(" the second block of the first process, the second block of the second\n");
- printf(" process, etc.\n");
- printf("\n");
- printf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
- printf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
- printf(" requests to complete access to the dataset.\n");
- printf(" Contiguous blocks of the first transfer request are written like so:\n");
- printf(" 1111----2222----3333----\n");
- printf(" Interleaved blocks of the first transfer request are written like so:\n");
- printf(" 123123123123------------\n");
- printf(" The actual number of I/O operations involved in a transfer request\n");
- printf(" depends on the access pattern and communication mode.\n");
- printf(" When using independent I/O with interleaved pattern, each process\n");
- printf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
- printf(" If collective I/O is turned on, the combined content of the buffers of\n");
- printf(" the 3 processes will be written using one collective I/O operation\n");
- printf(" per transfer request.\n");
- printf("\n");
- printf(" For information about access patterns in 2D geometry, please refer to the\n");
- printf(" HDF5 Reference Manual.\n");
- printf("\n");
- printf(" DL - is a list of debugging flags. Valid values are:\n");
- printf(" 1 - Minimal\n");
- printf(" 2 - Not quite everything\n");
- printf(" 3 - Everything\n");
- printf(" 4 - The kitchen sink\n");
- printf(" r - Raw data I/O throughput information\n");
- printf(" t - Times as well as throughputs\n");
- printf(" v - Verify data correctness\n");
- printf("\n");
- printf(" Example: --debug=2,r,t\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
- printf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
+ HDprintf(" -B S, --block-size=S Block size within transfer buffer\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
+ HDprintf(" [default: contiguous storage]\n");
+ HDprintf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
+ HDprintf(" [default: independent I/O)\n");
+ HDprintf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
+ HDprintf(" -D DL, --debug=DL Indicate the debugging level\n");
+ HDprintf(" [default: no debugging]\n");
+ HDprintf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: 256K for 1D, 8K for 2D]\n");
+ HDprintf(" -F N, --num-files=N Number of files [default: 1]\n");
+ HDprintf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
+ HDprintf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
+ HDprintf(" -I, --interleaved Interleaved access pattern\n");
+ HDprintf(" (see below for example)\n");
+ HDprintf(" [default: Contiguous access pattern]\n");
+ HDprintf(" -o F, --output=F Output raw data into file F [default: none]\n");
+ HDprintf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
+ HDprintf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
+ HDprintf(" [default: all MPI_COMM_WORLD processes ]\n");
+ HDprintf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -w, --write-only Perform write tests not the read tests\n");
+ HDprintf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
+ HDprintf(" [default: the number of bytes per process per\n");
+ HDprintf(" dataset]\n");
+ HDprintf("\n");
+ HDprintf(" F - is a filename.\n");
+ HDprintf(" N - is an integer >=0.\n");
+ HDprintf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" phdf5 - Parallel HDF5\n");
+ HDprintf(" mpiio - MPI-I/O\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: --api=mpiio,phdf5\n");
+ HDprintf("\n");
+ HDprintf(" Dataset size:\n");
+ HDprintf(" Depending on the selected geometry, each test dataset is either a linear\n");
+ HDprintf(" array of size bytes-per-process * num-processes, or a square array of size\n");
+ HDprintf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
+ HDprintf("\n");
+ HDprintf(" Block size vs. Transfer buffer size:\n");
+ HDprintf(" buffer-size controls the size of the memory buffer, which is broken into\n");
+ HDprintf(" blocks and written to the file. Depending on the selected geometry, each\n");
+ HDprintf(" block can be a linear array of size block-size or a square array of size\n");
+ HDprintf(" block-size x block-size. The arrangement in which blocks are written is\n");
+ HDprintf(" determined by the access pattern.\n");
+ HDprintf("\n");
+ HDprintf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
+ HDprintf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
+ HDprintf(" or buffer-size x block-size if interleaved pattern is selected.\n");
+ HDprintf("\n");
+ HDprintf(" Interleaved and Contiguous patterns in 1D geometry:\n");
+ HDprintf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
+ HDprintf(" into num-processes regions and each process writes data to its own region.\n");
+ HDprintf(" When interleaved blocks are written to a dataset, space for the first\n");
+ HDprintf(" block of the first process is allocated in the dataset, then space is\n");
+ HDprintf(" allocated for the first block of the second process, etc. until space is\n");
+ HDprintf(" allocated for the first block of each process, then space is allocated for\n");
+ HDprintf(" the second block of the first process, the second block of the second\n");
+ HDprintf(" process, etc.\n");
+ HDprintf("\n");
+ HDprintf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
+ HDprintf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
+ HDprintf(" requests to complete access to the dataset.\n");
+ HDprintf(" Contiguous blocks of the first transfer request are written like so:\n");
+ HDprintf(" 1111----2222----3333----\n");
+ HDprintf(" Interleaved blocks of the first transfer request are written like so:\n");
+ HDprintf(" 123123123123------------\n");
+ HDprintf(" The actual number of I/O operations involved in a transfer request\n");
+ HDprintf(" depends on the access pattern and communication mode.\n");
+ HDprintf(" When using independent I/O with interleaved pattern, each process\n");
+ HDprintf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
+ HDprintf(" If collective I/O is turned on, the combined content of the buffers of\n");
+ HDprintf(" the 3 processes will be written using one collective I/O operation\n");
+ HDprintf(" per transfer request.\n");
+ HDprintf("\n");
+ HDprintf(" For information about access patterns in 2D geometry, please refer to the\n");
+ HDprintf(" HDF5 Reference Manual.\n");
+ HDprintf("\n");
+ HDprintf(" DL - is a list of debugging flags. Valid values are:\n");
+ HDprintf(" 1 - Minimal\n");
+ HDprintf(" 2 - Not quite everything\n");
+ HDprintf(" 3 - Everything\n");
+ HDprintf(" 4 - The kitchen sink\n");
+ HDprintf(" r - Raw data I/O throughput information\n");
+ HDprintf(" t - Times as well as throughputs\n");
+ HDprintf(" v - Verify data correctness\n");
+ HDprintf("\n");
+ HDprintf(" Example: --debug=2,r,t\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
+ HDprintf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
fflush(stdout);
} /* end if */
} /* end usage() */
@@ -1685,7 +1685,7 @@ usage(const char *prog)
int
main(void)
{
- printf("No parallel IO performance because parallel is not configured\n");
+ HDprintf("No parallel IO performance because parallel is not configured\n");
return EXIT_SUCCESS;
} /* end main */
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index a40cff8..e6db2e8 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -294,6 +294,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -355,6 +356,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c
index ed15fa5..07a39cb 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/test/perform/sio_engine.c
@@ -41,7 +41,7 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -198,7 +198,7 @@ do_sio(parameters param, results *res)
if (sio_debug_level >= 4)
/* output all of the times for all iterations */
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
/*
* Write performance measurement
@@ -212,18 +212,18 @@ do_sio(parameters param, results *res)
HDfprintf(output, "data filename=%s\n",
fname);
- set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_CREATE | SIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(res, &fd, &param, buffer);
- set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -232,19 +232,19 @@ do_sio(parameters param, results *res)
*/
/* Open file for read */
- set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(res, &fd, &param, buffer);
- set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -264,7 +264,7 @@ done:
case HDF5:
if (fd.h5fd != -1)
hrc = do_fclose(iot, &fd);
- break;
+ break;
default:
/* unknown request */
HDassert(0 && "Unknown IO type");
@@ -490,7 +490,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -512,7 +512,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -520,12 +520,12 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Set the chunk size to be the same as the buffer size */
hrc = H5Pset_chunk(h5dcpl, rank, h5chunk);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
- sprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
@@ -550,19 +550,19 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
}
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
/* Perform write */
hrc = dset_write(rank-1, fd, parms, buffer);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset write\n");
+ HDfprintf(stderr, "Error in dataset write\n");
GOTOERROR(FAIL);
}
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -571,7 +571,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -584,7 +584,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -594,7 +594,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -604,7 +604,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -685,7 +685,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
VRFY((hrc >= 0), "H5Dwrite");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -837,7 +837,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
break;
@@ -856,14 +856,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
break;
case HDF5:
- sprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -872,16 +872,16 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
} /* end switch */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
hrc = dset_read(rank-1, fd, parms, buffer, buffer2);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset read\n");
+ HDfprintf(stderr, "Error in dataset read\n");
GOTOERROR(FAIL);
}
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
@@ -890,7 +890,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -903,7 +903,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -913,7 +913,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -923,7 +923,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -987,7 +987,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer,
h5dset_space_id, h5dxpl, buffer);
VRFY((hrc >= 0), "H5Dread");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -1089,7 +1089,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fapl = set_vfd(param);
if (fapl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1110,11 +1110,11 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type);
@@ -1176,7 +1176,7 @@ set_vfd(parameters *param)
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
memb_addr[mt] = (haddr_t)MAX(mt - 1,0) * (HADDR_MAX / 10);
}
@@ -1225,7 +1225,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -1236,13 +1236,13 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
fd->h5fd = -1;
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c
index e77b99e..a56558e 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/test/perform/sio_perf.c
@@ -98,7 +98,7 @@ static const char *progname = "h5perf_serial";
* It seems that only the options that accept additional information
* such as dataset size (-e) require the colon next to it.
*/
-static const char *s_opts = "a:A:B:b:c:Cd:D:e:F:G:ghi:Imno:p:P:r:stT:v:wx:X:";
+static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
static struct long_options l_opts[] = {
{ "align", require_arg, 'a' },
{ "alig", require_arg, 'a' },
@@ -281,14 +281,14 @@ struct options {
int buf_rank; /* Rank */
int order_rank; /* Rank */
int chk_rank; /* Rank */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
hsize_t h5_alignment; /* alignment in HDF5 file */
hsize_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int h5_extendable; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int h5_extendable; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
vfdtype vfd; /* File driver */
size_t page_buffer_size;
size_t page_size;
@@ -333,7 +333,7 @@ main(int argc, char **argv)
/* Initialize h5tools lib */
h5tools_init();
#endif
-
+
output = stdout;
opts = parse_command_line(argc, argv);
@@ -345,8 +345,8 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
- perror(opts->output_file);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
+ HDperror(opts->output_file);
goto finish;
}
}
@@ -356,7 +356,7 @@ main(int argc, char **argv)
run_test_loop(opts);
finish:
- free(opts);
+ HDfree(opts);
return exit_value;
}
@@ -385,8 +385,8 @@ static void
run_test_loop(struct options *opts)
{
parameters parms;
- int i;
- size_t buf_bytes;
+ int i;
+ size_t buf_bytes;
/* load options into parameter structure */
parms.num_files = opts->num_files;
@@ -498,50 +498,50 @@ run_test(iotype iot, parameters parms, struct options *opts)
do_sio(parms, &res);
/* gather all of the "sys write" times */
- t = get_time(res.timers, HDF5_MPI_WRITE);
+ t = io_time_get(res.timers, HDF5_MPI_WRITE);
get_minmax(&write_sys_mm, t);
write_sys_mm_table[i] = write_sys_mm;
/* gather all of the "write" times */
- t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
get_minmax(&write_mm, t);
write_mm_table[i] = write_mm;
/* gather all of the "write" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
get_minmax(&write_gross_mm, t);
write_gross_mm_table[i] = write_gross_mm;
/* gather all of the raw "write" times */
- t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
get_minmax(&write_raw_mm, t);
write_raw_mm_table[i] = write_raw_mm;
if (!parms.h5_write_only) {
/* gather all of the "mpi read" times */
- t = get_time(res.timers, HDF5_MPI_READ);
+ t = io_time_get(res.timers, HDF5_MPI_READ);
get_minmax(&read_sys_mm, t);
read_sys_mm_table[i] = read_sys_mm;
/* gather all of the "read" times */
- t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
get_minmax(&read_mm, t);
read_mm_table[i] = read_mm;
/* gather all of the "read" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
get_minmax(&read_gross_mm, t);
read_gross_mm_table[i] = read_gross_mm;
/* gather all of the raw "read" times */
- t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
get_minmax(&read_raw_mm, t);
read_raw_mm_table[i] = read_gross_mm;
@@ -552,7 +552,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -598,7 +598,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size);
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -647,16 +647,16 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
/* clean up our mess */
- free(write_sys_mm_table);
- free(write_mm_table);
- free(write_gross_mm_table);
- free(write_raw_mm_table);
+ HDfree(write_sys_mm_table);
+ HDfree(write_mm_table);
+ HDfree(write_gross_mm_table);
+ HDfree(write_raw_mm_table);
if (!parms.h5_write_only) {
- free(read_sys_mm_table);
- free(read_mm_table);
- free(read_gross_mm_table);
- free(read_raw_mm_table);
+ HDfree(read_sys_mm_table);
+ HDfree(read_mm_table);
+ HDfree(read_gross_mm_table);
+ HDfree(read_raw_mm_table);
}
return ret_value;
@@ -790,9 +790,9 @@ output_report(const char *fmt, ...)
{
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
/*
@@ -806,10 +806,10 @@ output_report(const char *fmt, ...)
static void
print_indent(register int indent)
{
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
static void
@@ -833,9 +833,9 @@ static void
print_io_api(long io_types)
{
if (io_types & SIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & SIO_HDF5)
- HDfprintf(output, "hdf5 ");
+ HDfprintf(output, "hdf5 ");
HDfprintf(output, "\n");
}
@@ -845,7 +845,7 @@ report_parameters(struct options *opts)
int i, rank;
rank = opts->dset_rank;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "==== Parameters ====\n");
HDfprintf(output, "IO API=");
@@ -1004,7 +1004,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
if (!HDstrcasecmp(buf, "hdf5")) {
@@ -1012,9 +1012,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= SIO_POSIX;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1043,7 +1043,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->chk_size[j] = parse_size_directive(buf);
@@ -1071,17 +1071,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
- if (!isdigit(buf[j])) {
- fprintf(stderr, "sio_perf: invalid --debug option %s\n",
+ if (!HDisdigit(buf[j])) {
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
sio_debug_level = atoi(buf);
@@ -1105,8 +1105,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1129,7 +1129,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->dset_size[j] = parse_size_directive(buf);
@@ -1147,7 +1147,7 @@ parse_command_line(int argc, char *argv[])
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'o':
cl_opts->output_file = opt_arg;
@@ -1171,9 +1171,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(opt_arg, "direct")) {
cl_opts->vfd=direct;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
opt_arg);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'w':
@@ -1193,7 +1193,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->buf_size[j] = parse_size_directive(buf);
@@ -1221,7 +1221,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->order[j] = (int)parse_size_directive(buf);
@@ -1243,7 +1243,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1339,8 +1339,8 @@ parse_size_directive(const char *size)
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1357,72 +1357,72 @@ parse_size_directive(const char *size)
static void
usage(const char *prog)
{
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h Print an usage message and exit\n");
- printf(" -A AL Which APIs to test\n");
- printf(" [default: all of them]\n");
- printf(" -c SL Selects chunked storage and defines chunks dimensions\n");
- printf(" and sizes\n");
- printf(" [default: Off]\n");
- printf(" -e SL Dimensions and sizes of dataset\n");
- printf(" [default: 100,200]\n");
- printf(" -i N Number of iterations to perform\n");
- printf(" [default: 1]\n");
- printf(" -r NL Dimension access order (see below for description)\n");
- printf(" [default: 1,2]\n");
- printf(" -t Selects extendable dimensions for HDF5 dataset\n");
- printf(" [default: Off]\n");
- printf(" -v VFD Selects file driver for HDF5 access\n");
- printf(" [default: sec2]\n");
- printf(" -w Perform write tests, not the read tests\n");
- printf(" [default: Off]\n");
- printf(" -x SL Dimensions and sizes of the transfer buffer\n");
- printf(" [default: 10,20]\n");
- printf("\n");
- printf(" N - is an integer > 0.\n");
- printf("\n");
- printf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" hdf5 - HDF5\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: -A posix,hdf5\n");
- printf("\n");
- printf(" NL - is list of integers (N) separated by commas.\n");
- printf("\n");
- printf(" Example: 1,2,3\n");
- printf("\n");
- printf(" SL - is list of size specifiers (S) separated by commas.\n");
- printf("\n");
- printf(" Example: 2K,2K,3K\n");
- printf("\n");
- printf(" The example defines an object (dataset, tranfer buffer) with three\n");
- printf(" dimensions. Be aware that as the number of dimensions increases, the\n");
- printf(" the total size of the object increases exponentially.\n");
- printf("\n");
- printf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
- printf(" sec2, stdio, core, split, multi, family, direct\n");
- printf("\n");
- printf(" Dimension access order:\n");
- printf(" Data access starts at the cardinal origin of the dataset using the\n");
- printf(" transfer buffer. The next access occurs on a dataset region next to\n");
- printf(" the previous one. For a multidimensional dataset, there are several\n");
- printf(" directions as to where to proceed. This can be specified in the dimension\n");
- printf(" access order. For example, -r 1,2 states that the tool should traverse\n");
- printf(" dimension 1 first, and then dimension 2.\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_PREFIX Data file prefix\n");
- printf("\n");
- fflush(stdout);
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h Print an usage message and exit\n");
+ HDprintf(" -A AL Which APIs to test\n");
+ HDprintf(" [default: all of them]\n");
+ HDprintf(" -c SL Selects chunked storage and defines chunks dimensions\n");
+ HDprintf(" and sizes\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -e SL Dimensions and sizes of dataset\n");
+ HDprintf(" [default: 100,200]\n");
+ HDprintf(" -i N Number of iterations to perform\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -r NL Dimension access order (see below for description)\n");
+ HDprintf(" [default: 1,2]\n");
+ HDprintf(" -t Selects extendable dimensions for HDF5 dataset\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -v VFD Selects file driver for HDF5 access\n");
+ HDprintf(" [default: sec2]\n");
+ HDprintf(" -w Perform write tests, not the read tests\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -x SL Dimensions and sizes of the transfer buffer\n");
+ HDprintf(" [default: 10,20]\n");
+ HDprintf("\n");
+ HDprintf(" N - is an integer > 0.\n");
+ HDprintf("\n");
+ HDprintf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" hdf5 - HDF5\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: -A posix,hdf5\n");
+ HDprintf("\n");
+ HDprintf(" NL - is list of integers (N) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 1,2,3\n");
+ HDprintf("\n");
+ HDprintf(" SL - is list of size specifiers (S) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 2K,2K,3K\n");
+ HDprintf("\n");
+ HDprintf(" The example defines an object (dataset, tranfer buffer) with three\n");
+ HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n");
+ HDprintf(" the total size of the object increases exponentially.\n");
+ HDprintf("\n");
+ HDprintf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
+ HDprintf(" sec2, stdio, core, split, multi, family, direct\n");
+ HDprintf("\n");
+ HDprintf(" Dimension access order:\n");
+ HDprintf(" Data access starts at the cardinal origin of the dataset using the\n");
+ HDprintf(" transfer buffer. The next access occurs on a dataset region next to\n");
+ HDprintf(" the previous one. For a multidimensional dataset, there are several\n");
+ HDprintf(" directions as to where to proceed. This can be specified in the dimension\n");
+ HDprintf(" access order. For example, -r 1,2 states that the tool should traverse\n");
+ HDprintf(" dimension 1 first, and then dimension 2.\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_PREFIX Data file prefix\n");
+ HDprintf("\n");
+ HDfflush(stdout);
} /* end usage() */
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index e73a6b5..5ce922b 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -316,6 +316,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -377,6 +378,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);