From ce7a12f964dc13411a5b3e4571e8c55f8b5edc8e Mon Sep 17 00:00:00 2001 From: mquinson Date: Thu, 24 Dec 2009 09:41:49 +0000 Subject: [PATCH] Fix the reduce test (by removing timings when -q is passed) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6986 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/smpi/reduce.c | 11 +++++++-- examples/smpi/reduce.tesh | 51 ++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/examples/smpi/reduce.c b/examples/smpi/reduce.c index bc74092050..25ae108206 100644 --- a/examples/smpi/reduce.c +++ b/examples/smpi/reduce.c @@ -65,12 +65,16 @@ int main(int argc, char **argv) int sum = -99, sum_mirror = -99, min = 999, max = -999; double start_timer; + int quiet = 0; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); + if (argc > 1 && !strcmp(argv[1], "-q")) + quiet = 1; + start_timer = MPI_Wtime(); value = rank + 1; /* easy to verify that sum= (size*(size+1))/2; */ @@ -99,7 +103,8 @@ int main(int argc, char **argv) printf("ok.\n"); else printf("failed.\n"); - printf("Elapsed time=%lf s\n", MPI_Wtime() - start_timer); + if (!quiet) + printf("Elapsed time=%lf s\n", MPI_Wtime() - start_timer); } MPI_Barrier(MPI_COMM_WORLD); @@ -108,8 +113,10 @@ int main(int argc, char **argv) printf("** IBM Test Result: ... \n"); if (!ibm_test(rank, size)) printf("\t[%d] failed.\n", rank); - else + else if (!quiet) printf("\t[%d] ok.\n", rank); + else + printf("\tok.\n"); MPI_Finalize(); return 0; diff --git a/examples/smpi/reduce.tesh b/examples/smpi/reduce.tesh index 4d4b767a14..2f2145d87b 100644 --- a/examples/smpi/reduce.tesh +++ b/examples/smpi/reduce.tesh @@ -4,7 +4,7 @@ # Go for the first test p Test Reduce with 3 processes -$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 3 ./reduce +$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 3 ./reduce -q > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -15,16 +15,15 @@ $ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir > [0] sum=6 ... validation ok. > [0] min=1 ... validation ok. > [0] max=3 ... validation ok. -> Elapsed time=0.007907 s > ** IBM Test Result: ... -> [0] ok. -> [2] ok. -> [1] ok. +> ok. +> ok. +> ok. # second test ! setenv LD_LIBRARY_PATH=../../src/.libs p Test Reduce with 6 processes -$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 6 ./reduce +$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 6 ./reduce -q > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -41,20 +40,19 @@ $ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir > [0] sum=21 ... validation ok. > [0] min=1 ... validation ok. > [0] max=6 ... validation ok. -> Elapsed time=0.007907 s > ** IBM Test Result: ... -> [2] ok. -> [5] ok. -> [4] ok. -> [0] ok. -> [1] ok. -> [3] ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. # third test ! setenv LD_LIBRARY_PATH=../../src/.libs p Test Reduce with 12 processes -$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 12 ./reduce +$ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../msg/small_platform.xml -np 12 ./reduce -q > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -83,17 +81,16 @@ $ ../../src/smpi/smpirun -map -hostfile ${srcdir:=.}/hostfile -platform ${srcdir > [0] sum=78 ... validation ok. > [0] min=1 ... validation ok. > [0] max=12 ... validation ok. -> Elapsed time=0.007908 s > ** IBM Test Result: ... -> [1] ok. -> [11] ok. -> [5] ok. -> [10] ok. -> [0] ok. -> [3] ok. -> [8] ok. -> [9] ok. -> [4] ok. -> [7] ok. -> [2] ok. -> [6] ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. +> ok. -- 2.20.1