Logo AND Algorithmique Numérique Distribuée

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