Logo AND Algorithmique Numérique Distribuée

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