X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c57842fe897f53b46f0be3da87f7c996674be7d6..f7a51878e3b2549b1d551887f953e9ff6b54b5d4:/teshsuite/smpi/mpich3-test/perf/twovec.c diff --git a/teshsuite/smpi/mpich3-test/perf/twovec.c b/teshsuite/smpi/mpich3-test/perf/twovec.c index 81e84e8e87..9d285f3ca9 100644 --- a/teshsuite/smpi/mpich3-test/perf/twovec.c +++ b/teshsuite/smpi/mpich3-test/perf/twovec.c @@ -31,15 +31,14 @@ int main(int argc, char *argv[]) { MPI_Datatype column[LOOPS], xpose[LOOPS]; - double t[NUM_SIZES], ttmp, tmean; + double t[NUM_SIZES], ttmp; double tMeanLower, tMeanHigher; int size; int i, j, errs = 0, nrows, ncols; MPI_Init(&argc, &argv); - tmean = 0; - size = 1; + size = 1; for (i = -SKIP; i < NUM_SIZES; i++) { nrows = ncols = size; @@ -55,11 +54,10 @@ int main(int argc, char *argv[]) t[i] = MPI_Wtime() - ttmp; if (t[i] < 100 * MPI_Wtick()) { /* Time is too inaccurate to use. Set to zero. - Consider increasing the LOOPS value to make this - time large enough */ + * Consider increasing the LOOPS value to make this + * time large enough */ t[i] = 0; } - tmean += t[i]; } for (j = 0; j < LOOPS; j++) { @@ -70,34 +68,34 @@ int main(int argc, char *argv[]) if (i >= 0) size *= 2; } - tmean /= NUM_SIZES; /* Now, analyze the times to see that they do not grow too fast - as a function of size. As that is a vague criteria, we do the - following as a simple test: - Compute the mean of the first half and the second half of the - data - Compare the two means - If the mean of the second half is more than FRACTION times the - mean of the first half, then the time may be growing too fast. + * as a function of size. As that is a vague criteria, we do the + * following as a simple test: + * Compute the mean of the first half and the second half of the + * data + * Compare the two means + * If the mean of the second half is more than FRACTION times the + * mean of the first half, then the time may be growing too fast. */ tMeanLower = tMeanHigher = 0; - for (i=0; i 0 && tMeanHigher > (1 + FRACTION) * tMeanLower) errs++; + * FRACTION here - the goal is to detect significant growth in + * execution time as the size increases, and there is no MPI + * standard requirement here to meet. + * + * If the times were too small, then the test also passes - the + * goal is to find implementation problems that lead to excessive + * time in these routines. + */ + if (tMeanLower > 0 && tMeanHigher > (1 + FRACTION) * tMeanLower) + errs++; if (errs) { fprintf(stderr, "too much difference in performance: ");