summaryrefslogtreecommitdiffstats
path: root/perform/pio_perf.c
diff options
context:
space:
mode:
Diffstat (limited to 'perform/pio_perf.c')
-rw-r--r--perform/pio_perf.c123
1 files changed, 67 insertions, 56 deletions
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index 4b23e18..cc86c83 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -117,9 +117,9 @@ static const char *progname = "h5perf";
* adding more, make sure that they don't clash with each other.
*/
#if 1
-static const char *s_opts = "ha:A:cCD:e:P:p:X:x:nd:F:i:Io:stT:w";
+static const char *s_opts = "ha:A:B:cCd:D:e:F:i:Ino:p:P:stT:wx:X:";
#else
-static const char *s_opts = "ha:A:bcCD:e:P:p:X:x:nd:F:i:Io:stT:w";
+static const char *s_opts = "ha:A:bB:cCd:D:e:F:i:Ino:p:P:stT:wx:X:";
#endif /* 1 */
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
@@ -139,6 +139,15 @@ static struct long_options l_opts[] = {
{ "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' },
@@ -156,14 +165,6 @@ static struct long_options l_opts[] = {
{ "debu", require_arg, 'D' },
{ "deb", require_arg, 'D' },
{ "de", require_arg, 'D' },
- { "num-elements", require_arg, 'e' },
- { "num-element", require_arg, 'e' },
- { "num-elemen", require_arg, 'e' },
- { "num-eleme", require_arg, 'e' },
- { "num-elem", require_arg, 'e' },
- { "num-ele", require_arg, 'e' },
- { "num-el", require_arg, 'e' },
- { "num-e", require_arg, 'e' },
{ "interleaved", require_arg, 'I' },
{ "interleave", require_arg, 'I' },
{ "interleav", require_arg, 'I' },
@@ -214,6 +215,12 @@ static struct long_options l_opts[] = {
{ "no-f", no_arg, 'n' },
{ "no-", no_arg, 'n' },
{ "no", no_arg, 'n' },
+ { "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-b", require_arg, 'e' },
{ "num-dsets", require_arg, 'd' },
{ "num-dset", require_arg, 'd' },
{ "num-dse", require_arg, 'd' },
@@ -261,14 +268,15 @@ static struct long_options l_opts[] = {
struct options {
long io_types; /* bitmask of which I/O types to test */
const char *output_file; /* file to print report to */
- off_t num_elmts; /* number of elements per proc per dset */
long num_dsets; /* number of datasets */
long num_files; /* number of files */
+ size_t num_bpp; /* number of bytes per proc per dset */
int num_iters; /* number of iterations */
int max_num_procs; /* maximum number of processes to use */
int min_num_procs; /* minimum number of processes to use */
size_t max_xfer_size; /* maximum transfer buffer size */
size_t min_xfer_size; /* minimum transfer buffer size */
+ size_t blk_size; /* Block size */
unsigned interleaved; /* Interleaved vs. contiguous blocks */
unsigned collective; /* Collective vs. independent I/O */
int print_times; /* print times as well as throughputs */
@@ -408,10 +416,10 @@ run_test_loop(struct options *opts)
int num_procs;
int doing_pio; /* if this process is doing PIO */
- parms.num_elmts = opts->num_elmts;
parms.num_files = opts->num_files;
parms.num_dsets = opts->num_dsets;
parms.num_iters = opts->num_iters;
+ parms.blk_size = opts->blk_size;
parms.interleaved = opts->interleaved;
parms.collective = opts->collective;
parms.h5_align = opts->h5_alignment;
@@ -441,15 +449,16 @@ run_test_loop(struct options *opts)
for (buf_size = opts->min_xfer_size;
buf_size <= opts->max_xfer_size; buf_size <<= 1) {
parms.buf_size = buf_size;
+ parms.num_bytes = (off_t)opts->num_bpp*parms.num_procs;
print_indent(1);
output_report("Transfer Buffer Size: %ld bytes, File size: %.2f MBs\n",
buf_size,
- ((double)parms.num_dsets * (double)parms.num_elmts *
- (double)parms.num_procs * (double)sizeof(int)) / ONE_MB);
+ ((double)parms.num_dsets * (double)parms.num_bytes)
+ / ONE_MB);
print_indent(1);
- output_report(" # of files: %ld, # of dsets: %ld, # of elmts per dset: %ld\n",
- parms.num_files, parms.num_dsets, parms.num_elmts);
+ output_report(" # of files: %ld, # of datasets: %ld, dataset size: %.2f MBs\n",
+ parms.num_files, parms.num_dsets, (double)parms.num_bytes/ONE_MB);
if (opts->io_types & PIO_POSIX)
run_test(POSIXIO, parms, opts);
@@ -461,7 +470,7 @@ run_test_loop(struct options *opts)
run_test(PHDF5, parms, opts);
/* Run the tests once if buf_size==0, but then break out */
- if (buf_size == 0)
+ if(buf_size==0)
break;
}
@@ -503,8 +512,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
minmax read_gross_mm = {0.0, 0.0, 0.0, 0};
minmax read_raw_mm = {0.0, 0.0, 0.0, 0};
- raw_size = (off_t)parms.num_procs * (off_t)parms.num_dsets *
- (off_t)parms.num_elmts * (off_t)sizeof(int);
+ raw_size = (off_t)parms.num_dsets * (off_t)parms.num_bytes;
parms.io_type = iot;
print_indent(2);
output_report("IO API = ");
@@ -525,16 +533,16 @@ run_test(iotype iot, parameters parms, struct options *opts)
/* allocate space for tables minmax and that it is sufficient */
/* to initialize all elements to zeros by calloc. */
- write_mpi_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- write_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- write_gross_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- write_raw_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
+ write_mpi_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ write_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ write_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ write_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
if (!parms.h5_write_only) {
- read_mpi_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- read_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- read_gross_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
- read_raw_mm_table = calloc((size_t)parms.num_iters, sizeof(minmax));
+ read_mpi_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ read_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ read_gross_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
+ read_raw_mm_table = calloc((size_t)parms.num_iters , sizeof(minmax));
}
/* Do IO iteration times, collecting statistics each time */
@@ -611,7 +619,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_all_info(write_raw_mm_table, parms.num_iters, 4);
}
- output_results(opts, "Raw Data Write", write_raw_mm_table, parms.num_iters, raw_size);
+ output_results(opts,"Raw Data Write",write_raw_mm_table,parms.num_iters,raw_size);
} /* end if */
/* show mpi write statics */
@@ -632,7 +640,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_all_info(write_mm_table, parms.num_iters, 4);
}
- output_results(opts, "Write", write_mm_table, parms.num_iters, raw_size);
+ output_results(opts,"Write",write_mm_table,parms.num_iters,raw_size);
/* accumulate and output the max, min, and average "gross write" times */
if (pio_debug_level >= 3) {
@@ -642,7 +650,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_all_info(write_gross_mm_table, parms.num_iters, 4);
}
- output_results(opts, "Write Open-Close", write_gross_mm_table, parms.num_iters, raw_size);
+ output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size);
if (!parms.h5_write_only) {
/* Read statistics */
@@ -877,7 +885,7 @@ destroy_comm_world(void)
*/
static void
output_results(const struct options *opts, const char *name, minmax *table,
- int table_size, off_t data_size)
+ int table_size,off_t data_size)
{
minmax total_mm;
@@ -897,7 +905,7 @@ output_results(const struct options *opts, const char *name, minmax *table,
print_indent(4);
output_report("Average Throughput: %6.2f MB/s",
- MB_PER_SEC(data_size, total_mm.sum / total_mm.num));
+ MB_PER_SEC(data_size,total_mm.sum / total_mm.num));
if(opts->print_times)
output_report(" (%7.3f s)\n", (total_mm.sum / total_mm.num));
else
@@ -997,35 +1005,33 @@ report_parameters(struct options *opts)
HDfprintf(output, "rank %d: IO API=", rank);
print_io_api(opts->io_types);
- HDfprintf(output, "rank %d: Number of elements per process per dataset=%Hd",
- rank, (long_long)opts->num_elmts);
+ HDfprintf(output, "rank %d: Number of bytes per process per dataset=", rank);
+ recover_size_and_print((long_long)opts->num_bpp, "\n");
+
HDfprintf(output, "rank %d: Number of files=%Hd\n", rank,
- (long_long)opts->num_files);
+ (long_long)opts->num_files);
HDfprintf(output, "rank %d: Number of datasets=%Hd\n", rank,
- (long_long)opts->num_dsets);
+ (long_long)opts->num_dsets);
HDfprintf(output, "rank %d: Number of iterations=%Hd\n", rank,
- (long_long)opts->num_iters);
+ (long_long)opts->num_iters);
HDfprintf(output, "rank %d: Number of processes=%d:%d\n", rank,
- opts->min_num_procs, opts->max_num_procs);
+ opts->min_num_procs, opts->max_num_procs);
HDfprintf(output, "rank %d: Size of dataset(s)=", rank);
- recover_size_and_print((long_long)(opts->num_elmts * opts->min_num_procs), ":");
- recover_size_and_print((long_long)(opts->num_elmts * opts->max_num_procs), "\n");
+ recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs), ":");
+ 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)(opts->num_elmts * opts->min_num_procs
- * opts->num_dsets * sizeof(int)), ":");
- recover_size_and_print((long_long)(opts->num_elmts * opts->max_num_procs
- * opts->num_dsets * sizeof(int)), "\n");
-
- /*
- * dset size = elements per process * nprocs
- * fsize = dsetsize * sizeof(int) * ndsets
- */
+ recover_size_and_print((long_long)(opts->num_bpp * opts->min_num_procs
+ * opts->num_dsets), ":");
+ recover_size_and_print((long_long)(opts->num_bpp * opts->max_num_procs
+ * opts->num_dsets), "\n");
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
recover_size_and_print((long_long)opts->min_xfer_size, ":");
recover_size_and_print((long_long)opts->max_xfer_size, "\n");
+ HDfprintf(output, "rank %d: Block size=", rank);
+ recover_size_and_print((long_long)opts->blk_size, "\n");
HDfprintf(output, "rank %d: Block Pattern in Dataset=", rank);
if(opts->interleaved)
@@ -1071,14 +1077,15 @@ parse_command_line(int argc, char *argv[])
cl_opts->output_file = NULL;
cl_opts->io_types = 0; /* will set default after parsing options */
- cl_opts->num_elmts = 256 * ONE_KB;
cl_opts->num_dsets = 1;
cl_opts->num_files = 1;
+ cl_opts->num_bpp = 256 * ONE_KB;
cl_opts->num_iters = 1;
cl_opts->max_num_procs = comm_world_nprocs_g;
cl_opts->min_num_procs = 1;
cl_opts->max_xfer_size = 1 * ONE_MB;
cl_opts->min_xfer_size = 128 * ONE_KB;
+ cl_opts->blk_size = 128 * ONE_KB; /* Default to writing 128K per block */
cl_opts->interleaved = 0; /* Default to contiguous blocks in dataset */
cl_opts->collective = 0; /* Default to independent I/O access */
cl_opts->print_times = FALSE; /* Printing times is off by default */
@@ -1134,6 +1141,9 @@ parse_command_line(int argc, char *argv[])
/* the future "binary" option */
break;
#endif /* 0 */
+ case 'B':
+ cl_opts->blk_size = parse_size_directive(opt_arg);
+ break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
cl_opts->h5_use_chunks = TRUE;
@@ -1203,7 +1213,7 @@ parse_command_line(int argc, char *argv[])
break;
case 'e':
- cl_opts->num_elmts = parse_size_directive(opt_arg);
+ cl_opts->num_bpp = parse_size_directive(opt_arg);
break;
case 'F':
cl_opts->num_files = atoi(opt_arg);
@@ -1333,13 +1343,14 @@ usage(const char *prog)
#if 0
printf(" -b, --binary The elusive binary option\n");
#endif /* 0 */
+ printf(" -B N, --block-size=N Block size within transfer buffer [default:128K]\n");
printf(" -c, --chunk Create HDF5 datasets chunked [default: off]\n");
printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
printf(" [default: off (i.e. 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-elements=S Number of elements per process per dataset\n");
+ printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
printf(" [default: 256K]\n");
printf(" -F N, --num-files=N Number of files [default: 1]\n");
printf(" -i, --num-iterations Number of iterations to perform [default: 1]\n");
@@ -1353,7 +1364,7 @@ usage(const char *prog)
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(" [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");
@@ -1361,13 +1372,13 @@ usage(const char *prog)
printf(" -X S, --max-xfer-size=S Maximum transfer buffer size [default: 1M]\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(" 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 = 37 Megabytes = %d bytes\n", 37 * ONE_MB);
+ printf(" Example: 37M = 37 Megabytes = %d bytes\n", 37*ONE_MB);
printf("\n");
printf(" AL - is an API list. Valid values are:\n");
printf(" phdf5 - Parallel HDF5\n");