mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[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
This commit is contained in:
parent
52bf29ae4a
commit
0d069736a7
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user