Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / teshsuite / smpi / mpich-test / coll / runtests
1 #! /bin/sh
2 # This version puts the output from each program into a separate file.
3 # -mvhome is needed for the ANL SP, and is ignored by others
4 args=
5 device=
6 MPICH_VERSION=
7 STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
8
9 MAKE="make --no-print-directory"
10 MPIRUNMVBACK=''
11 #
12
13 # Set mpirun to the name/path of the mpirun program
14 #FindMPIRUN
15 #
16 runtests=1
17 makeeach=0
18 writesummaryfile=no
19 have_fortran=0
20 quiet=0
21 MAKE="make --no-print-directory"
22 for arg in "$@" ; do
23     case $arg in
24     -basedir=* )
25         basedir=`echo $arg | sed 's/-basedir=//'`
26         ;; 
27     -srcdir=* )
28         srcdir=`echo $arg | sed 's/-srcdir=//'`
29         ;; 
30         -fort=* )
31         have_fortran=`echo $arg | sed 's/-fort=//'`
32         ;;
33         -checkonly )
34         runtests=0
35         ;;
36     -margs=*)
37         margs=`echo $arg | sed 's/-margs=//'`
38         args="$args $margs"
39         ;;
40         -small)
41         shift
42         makeeach=1
43         ;;
44         -summaryfile=*)
45         writesummaryfile=yes
46         summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
47         ;;
48         -quiet)
49         shift
50         quiet=1
51         ;;
52         -help|-u)
53         echo "runtests [-checkonly] [-margs='...']"
54         echo "run tests in this directory.  If -checkonly set, just run"
55         echo "the differences check (do NO rerun the test programs)."
56         echo "If -margs is used, these options are passed to mpirun."
57         echo "If -small is used, the examples are built, run, and deleted."
58         exit 1
59         ;;
60         *)
61         if test -n "$arg" ; then
62             echo "runtests: Unknown argument ($arg)"
63             exit 1
64         fi
65         ;;
66     esac
67 done
68 # Load basic procedures
69 . ${srcdir}/../runbase
70 #
71 # If the programs are not available, run make.
72 if [ ! -x coll1 -a $makeeach = 0 -a $runtests = 1 ] ; then
73     $MAKE
74 fi
75
76 mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
77 testfiles=""
78 if [ $runtests = 1 ] ; then
79 echo '**** Testing MPI Collective routines ****'
80
81 RunTest barrier 4 "*** Barrier Test ***" "" "barrier-0.out"
82
83 RunTest bcast_mpich 4 "*** Broadcast Test ***" "" "bcast-0.out bcast-1.out bcast-2.out bcast-3.out"
84
85 RunTest bcastvec 4 "*** Broadcast Datatype Test ***" "" "bcastvec-0.out bcastvec-1.out bcastvec-2.out bcastvec-3.out"
86
87
88 #TODO : handle MPI_BOTTOM to allow som operations to use absolute addresses
89 RunTest coll1 4
90
91 RunTest coll2 5
92
93 RunTest coll3 5
94
95 RunTest coll4 4
96
97 RunTest coll5 4
98
99 RunTest coll6 5
100
101 RunTest coll7 5
102
103 RunTest coll8 4
104
105 RunTest coll9 4
106
107 #smpi does not handle non commutative operations, removed
108 #RunTest coll10 4
109
110 #smpi does not handle non commutative operations, removed
111 RunTest coll11 4
112
113 #weird manipulations of ranks in split, and comms -> deadlock, removed
114 #RunTest scantst 4
115
116 RunTest coll12 4
117
118 # coll13 is very picky about arguments
119 RunTest coll13 14
120
121 RunTest longuser 4
122
123 # Some implementations (e.g., IBM's) forget to handle the np = 1 case.
124 #RunTest longuser 1 "*** longuser (np == 1) ***"
125 MakeExe longuser
126 cp longuser longuser1
127 RunTest longuser1 1 '*** longuser (np == 1) ***'
128 rm -f longuser1
129
130 #OutTime
131 #testfiles="$testfiles allredmany.out"
132 #rm -f allredmany.out
133 #MakeExe allredmany
134 #echo '**** allredmany ****'
135 #echo '*** allredmany ***' >> allredmany.out
136 #cnt=0
137 ## Run several times to try and catch timing/race conditions in managing
138 ## the flood of one-way messages.
139 #while [ $cnt -lt 20 ] ; do
140 #    echo "*** allredmany run $cnt ***" >> allredmany.out
141 #    $mpirun -np 2 $args allredmany >> allredmany.out 2>&1
142 #    cnt=`expr $cnt + 1`
143 #done
144 #echo '*** allredmany ***' >> allredmany.out
145 #CleanExe allredmany
146
147 RunTest grouptest 4
148 #uses MPI_Dims_create, MPI_Cart_create ... removed
149 RunTest allred 4 "*** Allred ***"
150
151 RunTest allred2 4 "*** Allred2 ***"
152 #uses MPI_Dims_create, MPI_Cart_create ... removed
153 #RunTest scatterv 4 "*** Scatterv ***"
154
155 RunTest scattern 4 "*** Scattern ***"
156
157 #fails, more debug needed to understand
158 RunTest redscat 4 "*** Reduce_scatter ***"
159
160 RunTest alltoallv_mpich 4 "*** Alltoallv ***"
161 echo "runtests: fortran ($have_fortran)"
162 #
163 # Run Fortran tests ONLY if Fortran available
164 if [ $have_fortran -eq "1" ] ; then 
165     echo "FORTRAN TESTS"
166
167     RunTest allredf 4 "*** Testing allreduce from Fortran ***"
168
169     RunTest assocf 4 "*** Testing allreduce from Fortran (2) ***"
170
171     RunTest bcastlog 4 "*** Testing logical datatype in BCAST ***"
172     #buggy test, not available in original test, removed
173     #RunTest allgatherf 2 "*** Testing allgather from Fortran ***"
174     echo "END OF FORTRAN TESTS"
175 fi
176
177 else
178     # Just run checks
179     testfiles=`echo *.out`
180     if test "$testfiles" = "*.out" ; then
181         echo "No output files remain from previous test!"
182         exit 1
183     fi
184 fi
185
186 echo '*** Checking for differences from expected output ***'
187 CheckAllOutput coll.diff
188 exit 0