summaryrefslogtreecommitdiffstats
path: root/tools/test/perform/pio_perf.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-10-16 22:47:27 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-10-16 22:47:27 (GMT)
commitdb30c2da68ece4a155e9e50c28ec16d6057509b2 (patch)
tree1d36f673c36dfee71c266bba39511da21ecc782e /tools/test/perform/pio_perf.c
parent5b9cf732caab9daa6ed1e00f2df4f5a792340196 (diff)
parent2e2b87d1cbdee3b919e6e5cba6c5ecd1b9434434 (diff)
downloadhdf5-db30c2da68ece4a155e9e50c28ec16d6057509b2.zip
hdf5-db30c2da68ece4a155e9e50c28ec16d6057509b2.tar.gz
hdf5-db30c2da68ece4a155e9e50c28ec16d6057509b2.tar.bz2
Merge HDF5 1.10.7 release files into 1.10/masterhdf5-1_10_7
Diffstat (limited to 'tools/test/perform/pio_perf.c')
-rw-r--r--tools/test/perform/pio_perf.c82
1 files changed, 48 insertions, 34 deletions
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 93741c4..cb15f64 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -80,8 +80,13 @@
#define PIO_MPI 0x2
#define PIO_HDF5 0x4
+#ifdef STANDALONE
+#define DBL_EPSILON 2.2204460492503131e-16
+#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON)
+#endif
+
/* report 0.0 in case t is zero too */
-#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
+#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
#ifndef TRUE
#define TRUE 1
@@ -311,6 +316,7 @@ static void output_report(const char *fmt, ...);
static void print_indent(register int indent);
static void usage(const char *prog);
static void report_parameters(struct options *opts);
+static off_t squareo(off_t);
/*
* Function: main
@@ -321,7 +327,7 @@ static void report_parameters(struct options *opts);
* Modifications:
*/
int
-main(int argc, char **argv)
+main(int argc, char *argv[])
{
int ret;
int exit_value = EXIT_SUCCESS;
@@ -393,6 +399,12 @@ finish:
return exit_value;
}
+off_t
+squareo(off_t x)
+{
+ return x * x;
+}
+
/*
* Function: run_test_loop
* Purpose: Run the I/O tests. Write the results to OUTPUT.
@@ -428,8 +440,8 @@ run_test_loop(struct options *opts)
parms.interleaved = opts->interleaved;
parms.collective = opts->collective;
parms.dim2d = opts->dim2d;
- parms.h5_align = opts->h5_alignment;
- parms.h5_thresh = opts->h5_threshold;
+ parms.h5_align = (hsize_t)opts->h5_alignment;
+ parms.h5_thresh = (hsize_t)opts->h5_threshold;
parms.h5_use_chunks = opts->h5_use_chunks;
parms.h5_write_only = opts->h5_write_only;
parms.verify = opts->verify;
@@ -456,7 +468,7 @@ run_test_loop(struct options *opts)
parms.buf_size = buf_size;
if (parms.dim2d){
- parms.num_bytes = (off_t)pow((double)(opts->num_bpp*parms.num_procs),2);
+ parms.num_bytes = squareo(opts->num_bpp * parms.num_procs);
if (parms.interleaved)
output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MB\n",
buf_size, opts->blk_size,
@@ -558,6 +570,8 @@ run_test(iotype iot, parameters parms, struct options *opts)
case PHDF5:
output_report("PHDF5 (w/MPI-IO driver)\n");
break;
+ default:
+ break;
}
MPI_Comm_size(pio_comm_g, &comm_size);
@@ -587,74 +601,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;
@@ -879,7 +893,7 @@ accumulate_minmax_stuff(minmax *mm, int count)
int i;
minmax total_mm;
- total_mm.sum = 0.0;
+ total_mm.sum = 0.0f;
total_mm.max = -DBL_MAX;
total_mm.min = DBL_MAX;
total_mm.num = count;
@@ -1155,10 +1169,10 @@ report_parameters(struct options *opts)
recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n");
HDfprintf(output, "rank %d: File size=", rank);
- recover_size_and_print((long long)(pow(opts->num_bpp * opts->min_num_procs,2)
- * opts->num_dsets), ":");
- recover_size_and_print((long long)(pow(opts->num_bpp * opts->max_num_procs,2)
- * opts->num_dsets), "\n");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->min_num_procs)
+ * opts->num_dsets), ":");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->max_num_procs)
+ * opts->num_dsets), "\n");
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
if(opts->interleaved){
@@ -1322,7 +1336,7 @@ parse_command_line(int argc, char *argv[])
break;
#endif /* 0 */
case 'B':
- cl_opts->blk_size = parse_size_directive(opt_arg);
+ cl_opts->blk_size = (size_t)parse_size_directive(opt_arg);
break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
@@ -1423,10 +1437,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = TRUE;
break;
case 'x':
- cl_opts->min_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'X':
- cl_opts->max_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'h':
case '?':
@@ -1446,13 +1460,13 @@ parse_command_line(int argc, char *argv[])
}
if (cl_opts->max_xfer_size == 0)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
if (cl_opts->min_xfer_size == 0)
- cl_opts->min_xfer_size = (cl_opts->num_bpp)/2;
+ cl_opts->min_xfer_size = (size_t)(cl_opts->num_bpp)/2;
if (cl_opts->blk_size == 0)
- cl_opts->blk_size = (cl_opts->num_bpp)/2;
+ cl_opts->blk_size = (size_t)(cl_opts->num_bpp)/2;
/* set default if none specified yet */
@@ -1462,15 +1476,15 @@ parse_command_line(int argc, char *argv[])
/* verify parameters sanity. Adjust if needed. */
/* cap xfer_size with bytes per process */
if (!cl_opts->dim2d) {
- if (cl_opts->min_xfer_size > cl_opts->num_bpp)
- cl_opts->min_xfer_size = cl_opts->num_bpp;
- if (cl_opts->max_xfer_size > cl_opts->num_bpp)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ if (cl_opts->min_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->min_xfer_size = (size_t)cl_opts->num_bpp;
+ if (cl_opts->max_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
}
if (cl_opts->min_xfer_size > cl_opts->max_xfer_size)
cl_opts->min_xfer_size = cl_opts->max_xfer_size;
- if (cl_opts->blk_size > cl_opts->num_bpp )
- cl_opts->blk_size = cl_opts->num_bpp;
+ if (cl_opts->blk_size > (size_t)cl_opts->num_bpp )
+ cl_opts->blk_size = (size_t)cl_opts->num_bpp;
/* check range of number of processes */
if (cl_opts->min_num_procs <= 0)
cl_opts->min_num_procs = 1;