Logo AND Algorithmique Numérique Distribuée

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