From 0d069736a7fefcd6e5cc7318782f30982b3ca849 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 11 Jan 2002 15:30:02 -0500 Subject: [svn-r4818] Purpose: Small Fix Description: Fixed the Min/Max/Average accumlation stuff... Solution: Actually thought about the code and made it accumulate the information in the correct way. Platforms tested: Linux --- perform/pio_perf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 6377ce4..03441f1 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -561,17 +561,15 @@ run_test(FILE *output, iotype iot, parameters parms) static void get_minmax(minmax *mm, double val) { - double sum; - int myrank, nproc; + double min, max, sum; + int myrank; MPI_Comm_rank(pio_comm_g, &myrank); - MPI_Comm_size(pio_comm_g, &nproc); + MPI_Comm_size(pio_comm_g, &mm->num); - MPI_Allreduce(&val, &(mm->max), 1, MPI_DOUBLE, MPI_MAX, pio_comm_g); - MPI_Allreduce(&val, &(mm->min), 1, MPI_DOUBLE, MPI_MIN, pio_comm_g); - MPI_Allreduce(&val, &sum, 1, MPI_DOUBLE, MPI_SUM, pio_comm_g); - mm->sum += sum; - mm->num += nproc; + MPI_Allreduce(&val, &mm->max, 1, MPI_DOUBLE, MPI_MAX, pio_comm_g); + MPI_Allreduce(&val, &mm->min, 1, MPI_DOUBLE, MPI_MIN, pio_comm_g); + MPI_Allreduce(&val, &mm->sum, 1, MPI_DOUBLE, MPI_SUM, pio_comm_g); } /* -- cgit v0.12