diff options
Diffstat (limited to 'perform')
-rw-r--r-- | perform/pio_engine.c | 53 | ||||
-rw-r--r-- | perform/pio_perf.c | 26 | ||||
-rw-r--r-- | perform/pio_perf.h | 6 |
3 files changed, 70 insertions, 15 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 009e84a..9edf499 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -145,7 +145,7 @@ static void do_cleanupfile(iotype iot, char *fname); * Modifications: */ results -do_pio(parameters param) +do_pio(FILE *output, parameters param) { /* return codes */ herr_t ret_code = 0; /*return code */ @@ -164,6 +164,10 @@ do_pio(parameters param) /* HDF5 variables */ herr_t hrc; /*HDF5 return code */ + int myrank; + + MPI_Comm_rank(pio_comm_g, &myrank); + /* Sanity check parameters */ /* IO type */ @@ -252,6 +256,11 @@ buf_size=MIN(1024*1024, buf_size); GOTOERROR(FAIL); } + if (pio_debug_level >= 4) { + /* output all of the times for all iterations */ + output_report(output, "Timer details:\n"); + } + for (nf = 1; nf <= nfiles; nf++) { /* * Write performance measurement @@ -269,14 +278,30 @@ fprintf(stderr, "filename=%s\n", fname); set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Gross Write Start: %.2f\n", + myrank, get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS)); + hrc = do_fopen(iot, fname, &fd, PIO_CREATE | PIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Fine Write Start: %.2f\n", + myrank, get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS)); + hrc = do_write(&fd, iot, ndsets, nelmts, buf_size, buffer); set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Fine Write Stop: %.2f\n", + myrank, get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS)); + VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ @@ -284,6 +309,11 @@ fprintf(stderr, "filename=%s\n", fname); set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Gross Write Stop: %.2f\n", + myrank, get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS)); + VRFY((hrc == SUCCESS), "do_fclose failed"); MPI_Barrier(pio_comm_g); @@ -294,14 +324,30 @@ fprintf(stderr, "filename=%s\n", fname); /* Open file for read */ set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Gross Read Start: %.2f\n", + myrank, get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS)); + hrc = do_fopen(iot, fname, &fd, PIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Fine Read Start: %.2f\n", + myrank, get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS)); + hrc = do_read(&fd, iot, ndsets, nelmts, buf_size, buffer); set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Fine Read Stop: %.2f\n", + myrank, get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS)); + VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ @@ -309,6 +355,11 @@ fprintf(stderr, "filename=%s\n", fname); set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + if (pio_debug_level >= 4) + /* output all of the times for all iterations */ + fprintf(output, " Proc %d: Gross Read Stop: %.2f\n", + myrank, get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS)); + VRFY((hrc == SUCCESS), "do_fclose failed"); MPI_Barrier(pio_comm_g); diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 28735b3..f58146b 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -229,7 +229,6 @@ static void get_minmax(minmax *mm, double val); static minmax accumulate_minmax_stuff(minmax *mm, long raw_size, int count); static int create_comm_world(int num_procs, int *doing_pio); static int destroy_comm_world(void); -static void output_report(FILE *output, const char *fmt, ...); static void print_indent(register FILE *output, register int indent); static void usage(const char *prog); @@ -472,7 +471,7 @@ run_test(FILE *output, iotype iot, parameters parms) double t; MPI_Barrier(pio_comm_g); - res = do_pio(parms); + res = do_pio(output, parms); /* gather all of the "write" times */ t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); @@ -500,7 +499,7 @@ run_test(FILE *output, iotype iot, parameters parms) } /* accumulate and output the max, min, and average "write" times */ - if (pio_debug_level == 3) { + if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(output, 3); output_report(output, "Write details:\n"); @@ -521,7 +520,7 @@ run_test(FILE *output, iotype iot, parameters parms) total_mm.sum / total_mm.num); /* accumulate and output the max, min, and average "gross write" times */ - if (pio_debug_level == 3) { + if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(output, 3); output_report(output, "Write Open-Close details:\n"); @@ -542,7 +541,7 @@ run_test(FILE *output, iotype iot, parameters parms) total_mm.sum / total_mm.num); /* accumulate and output the max, min, and average "read" times */ - if (pio_debug_level == 3) { + if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(output, 3); output_report(output, "Read details:\n"); @@ -563,7 +562,7 @@ run_test(FILE *output, iotype iot, parameters parms) total_mm.sum / total_mm.num); /* accumulate and output the max, min, and average "gross read" times */ - if (pio_debug_level == 3) { + if (pio_debug_level >= 3) { /* output all of the times for all iterations */ print_indent(output, 3); output_report(output, "Read Open-Close details:\n"); @@ -755,7 +754,7 @@ destroy_comm_world(void) * Programmer: Bill Wendling, 19. December 2001 * Modifications: */ -static void +void output_report(FILE *output, const char *fmt, ...) { int myrank; @@ -779,7 +778,7 @@ output_report(FILE *output, const char *fmt, ...) * Programmer: Bill Wendling, 29. October 2001 * Modifications: */ -static void +void print_indent(register FILE *output, register int indent) { int myrank; @@ -834,8 +833,8 @@ parse_command_line(int argc, char *argv[]) case 'D': pio_debug_level = strtol(opt_arg, NULL, 10); - if (pio_debug_level > 3) - pio_debug_level = 3; + if (pio_debug_level > 4) + pio_debug_level = 4; else if (pio_debug_level < 0) pio_debug_level = 0; @@ -959,13 +958,13 @@ usage(const char *prog) fprintf(stdout, " -D N, --debug=N Indicate the debugging level [default:0]\n"); fprintf(stdout, " -f S, --file-size=S Size of a single file [default: 64M]\n"); fprintf(stdout, " -F N, --num-files=N Number of files [default: 1]\n"); - fprintf(stdout, " -H, --hdf5 Run HDF5 performance test only\n"); + fprintf(stdout, " -H, --hdf5 Run HDF5 performance test\n"); fprintf(stdout, " -i, --num-iterations Number of iterations to perform [default: 1]\n"); - fprintf(stdout, " -m, --mpiio Run MPI/IO performance test only\n"); + fprintf(stdout, " -m, --mpiio Run MPI/IO performance test\n"); fprintf(stdout, " -o F, --output=F Output raw data into file F [default: none]\n"); fprintf(stdout, " -P N, --max-num-processes=N Maximum number of processes to use [default: all MPI_COMM_WORLD processes ]\n"); fprintf(stdout, " -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); - fprintf(stdout, " -r, --raw Run raw (UNIX) performance test only\n"); + fprintf(stdout, " -r, --raw Run raw (UNIX) performance test\n"); fprintf(stdout, " -X S, --max-xfer-size=S Maximum transfer buffer size [default: 1M]\n"); fprintf(stdout, " -x S, --min-xfer-size=S Minimum transfer buffer size [default: 128K]\n"); fprintf(stdout, "\n"); @@ -985,6 +984,7 @@ usage(const char *prog) fprintf(stdout, " 1 - Minimal\n"); fprintf(stdout, " 2 - Not quite everything\n"); fprintf(stdout, " 3 - Everything\n"); + fprintf(stdout, " 4 - Everything and the kitchen sink\n"); fprintf(stdout, "\n"); fflush(stdout); } diff --git a/perform/pio_perf.h b/perform/pio_perf.h index 08306a6..9d51f01 100644 --- a/perform/pio_perf.h +++ b/perform/pio_perf.h @@ -55,7 +55,11 @@ extern int pio_debug_level; /* The debug level: #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -extern results do_pio(parameters param); + +extern results do_pio(FILE * output, parameters param); +extern void output_report(FILE *output, const char *fmt, ...); +extern void print_indent(register FILE *output, register int indent); + #ifdef __cplusplus } #endif /* __cplusplus */ |