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
14 margs=`echo $arg | sed 's/-margs=//'`
21 echo "runtests [-checkonly] [-margs='...']"
22 echo "run tests in this directory. If -checkonly set, just run"
23 echo "the differences check (do NO rerun the test programs)."
24 echo "If -margs is used, these options are passed to mpirun."
25 echo "If -small is used, the examples are built, run, and deleted."
29 if test -n "$arg" ; then
30 echo "runtests: Unknown argument ($arg)"
38 if [ $makeeach = 1 -o ! -x $1 ] ; then
43 if [ $makeeach = 1 ] ; then
48 # If the programs are not available, run make.
49 if [ ! -x coll1 -a $makeeach = 0 ] ; then
54 if [ $runtests = 1 ] ; then
55 echo '**** Testing MPI Collective routines ****'
57 testfiles="$testfiles barrier.out"
58 /bin/rm -f barrier.out barrier-0.out
60 echo '*** Barrier Test ***' >> barrier.out
61 echo '**** Barrier Test ****'
62 mpirun $args -np 4 -mvback "barrier-0.out" barrier $* >> barrier.out
63 cat barrier-0.out >> barrier.out
64 /bin/rm -f barrier-[01234].out
65 echo '*** Barrier Test ***' >> barrier.out
68 testfiles="$testfiles bcast.out"
69 /bin/rm -f bcast.out bcast-[0-3].out
71 echo '**** Broadcast Test ****'
72 echo '*** Broadcast Test ***' >> bcast.out
74 -mvback "bcast-0.out bcast-1.out bcast-2.out bcast-3.out" \
76 cat bcast-[0123].out >> bcast.out
77 /bin/rm -f bcast-[0123].out
78 echo '*** Broadcast Test ***' >> bcast.out
81 testfiles="$testfiles coll1.out"
84 echo '**** coll1 ****'
85 echo '*** coll1 ***' >> coll1.out
86 mpirun $args -np 4 coll1 $* >> coll1.out
87 echo '*** coll1 ***' >> coll1.out
90 testfiles="$testfiles coll2.out"
93 echo '**** coll2 ****'
94 echo '*** coll2 ***' >> coll2.out
95 # mpirun $args -np 5 coll2 $* >> coll2.out
96 echo '*** coll2 ***' >> coll2.out
99 testfiles="$testfiles coll3.out"
102 echo '**** coll3 ****'
103 echo '*** coll3 ***' >> coll3.out
104 mpirun $args -np 5 coll3 $* >> coll3.out
105 echo '*** coll3 ***' >> coll3.out
108 testfiles="$testfiles coll4.out"
111 echo '**** coll4 ****'
112 echo '*** coll4 ***' >> coll4.out
113 mpirun $args -np 4 coll4 $* >> coll4.out
114 echo '*** coll4 ***' >> coll4.out
117 testfiles="$testfiles coll5.out"
120 echo '**** coll5 ****'
121 echo '*** coll5 ***' >> coll5.out
122 mpirun $args -np 4 coll5 $* >> coll5.out
123 echo '*** coll5 ***' >> coll5.out
126 testfiles="$testfiles coll6.out"
129 echo '**** coll6 ****'
130 echo '*** coll6 ***' >> coll6.out
131 mpirun $args -np 5 coll6 $* >> coll6.out
132 echo '*** coll6 ***' >> coll6.out
135 testfiles="$testfiles coll7.out"
138 echo '**** coll7 ****'
139 echo '*** coll7 ***' >> coll7.out
140 mpirun $args -np 5 coll7 $* >> coll7.out
141 echo '*** coll7 ***' >> coll7.out
144 testfiles="$testfiles coll8.out"
147 echo '**** coll8 ****'
148 echo '*** coll8 ***' >> coll8.out
149 mpirun $args -np 4 coll8 $* >> coll8.out
150 echo '*** coll8 ***' >> coll8.out
153 testfiles="$testfiles coll9.out"
156 echo '**** coll9 ****'
157 echo '*** coll9 ***' >> coll9.out
158 mpirun $args -np 4 coll9 $* >> coll9.out
159 echo '*** coll9 ***' >> coll9.out
162 testfiles="$testfiles coll10.out"
163 /bin/rm -f coll10.out
165 echo '**** coll10 ****'
166 echo '*** coll10 ***' >> coll10.out
167 mpirun -np 4 $args coll10 $* >> coll10.out
168 echo '*** coll10 ***' >> coll10.out
171 testfiles="$testfiles coll11.out"
172 /bin/rm -f coll11.out
174 echo '**** coll11 ****'
175 echo '*** coll11 ***' >> coll11.out
176 mpirun -np 4 $args coll11 $* >> coll11.out
177 echo '*** coll11 ***' >> coll11.out
180 testfiles="$testfiles coll12.out"
181 /bin/rm -f coll12.out
183 echo '**** coll12 ****'
184 echo '*** coll12 ***' >> coll12.out
185 mpirun -np 4 $args coll12 $* >> coll12.out
186 echo '*** coll12 ***' >> coll12.out
189 testfiles="$testfiles coll13.out"
190 /bin/rm -f coll13.out
192 echo '**** coll13 ****'
193 echo '*** coll13 ***' >> coll13.out
194 mpirun -np 4 $args coll13 $* >> coll13.out
195 echo '*** coll13 ***' >> coll13.out
198 testfiles="$testfiles grouptest.out"
199 /bin/rm -f grouptest.out
201 echo '*** Grouptest ***'
202 echo '*** grouptest ***' >> grouptest.out
203 mpirun $args -np 4 grouptest $* >> grouptest.out
204 echo '*** grouptest ***' >> grouptest.out
207 testfiles="$testfiles allred.out"
208 /bin/rm -f allred.out
210 echo '*** Allred ***'
211 echo '*** Allred ***' >> allred.out
212 mpirun $args -np 4 allred $* >> allred.out
213 echo '*** Allred ***' >> allred.out
216 testfiles="$testfiles scatterv.out"
217 /bin/rm -f scatterv.out
219 echo '*** Scatterv ***'
220 echo '*** Scatterv ***' >> scatterv.out
221 mpirun $args -np 4 scatterv $* >> scatterv.out
222 echo '*** Scatterv ***' >> scatterv.out
226 # Run Fortran tests ONLY if Fortran available
230 testfiles="$testfiles allredf.out"
231 /bin/rm -f allredf.out
233 echo '*** Testing allreduce from Fortran ***'
234 echo '*** Testing allreduce from Fortran ***' >> allredf.out
235 mpirun $args -np 4 allredf "$@" >> allredf.out
236 echo '*** Testing allreduce from Fortran ***' >> allredf.out
239 echo "END OF FORTRAN TESTS"
244 testfiles=`echo *.out`
245 if test "$testfiles" = "*.out" ; then
246 echo "No output files remain from previous test!"
251 echo '*** Differences from expected output ***'
253 for file in $testfiles ; do
254 stdfile=`basename $file .out`.std
255 if [ -s $stdfile ] ; then
256 if diff -b $file `basename $file .out`.std > /dev/null ; then
259 echo "Differences in `basename $file .out`" >> coll.diff
260 diff -b $file `basename $file .out`.std >> coll.diff
263 echo "Can not find file $stdfile to compare against for test `basename $file .out`"
266 if [ -s coll.diff ] ; then