3 # Run some of the tests. If any arguments are provided, pass them to the
6 # -mvhome is needed for the ANL SP, and is ignored by others
10 STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
11 MAKE="make --no-print-directory"
14 # Load basic procedures
17 # Set mpirun to the name/path of the mpirun program
20 # If the programs are not available, run make.
27 CheckOutputWhileRunning="yes"
28 # Using shifts should remove args from the list.
32 basedir=`echo $arg | sed 's/-basedir=//'`
35 srcdir=`echo $arg | sed 's/-srcdir=//'`
43 margs=`echo $arg | sed 's/-margs=//'`
48 summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
71 echo "runtests [-checkonly] [-margs='...'] [-atend] [-check]"
72 echo "run tests in this directory. If -checkonly set, just run"
73 echo "the differences check (do NO rerun the test programs)."
74 echo "If -margs is used, these options are passed to mpirun."
75 echo "If -small is used, the examples are built, run, and deleted."
76 echo "If -atend is used, the success of the tests is checked only"
77 echo "at the end of the test rather than also after each test."
78 echo "If -check is used, only a single simple test is run; this"
79 echo "is used to check that mpirun can run an MPI program."
83 if test -n "$arg" ; then
84 echo "Passing remaining arguments to programs ($*)"
92 # Load basic procedures
93 . ${srcdir}/../runbase
95 # Do this because we're writing the output while running
96 savewritesummaryfile=$writesummaryfile
99 mpirun=" ${basedir}/bin/smpirun --cfg=smpi/running_power:108095000 -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile --log=root.thres:critical"
101 # If cannot run test, do that and exit
102 if [ $check_canrun = 1 ] ; then
103 # Make sure that we don't have an old file lying around
104 rm -f third third.o third.exe
107 echo '*** Testing Unexpected messages ***' >> third.out
108 $mpirun $args -np 2 ./third </dev/null >> third.out 2>&1
109 echo '*** Testing Unexpected messages ***' >> third.out
111 cat >>third.stdo <<EOF
112 *** Testing Unexpected messages ***
114 *** Testing Unexpected messages ***
116 # if diff -b third.out third.stdo > /dev/null ; then
119 # echo "Failed to run simple program!"
120 # echo "Output from run attempt was"
122 # echo "mpirun program was $mpirun"
123 # echo "mpirun command was "
124 # echo "$mpirun $args -np 2 ./third </dev/null >>third.out 2>&1"
132 # If the programs are not available, run make.
133 if [ ! -x sendrecv_mpich -a $makeeach = 0 -a $runtests = 1 ] ; then
138 if [ $runtests = 1 ] ; then
139 echo '**** Testing MPI Point-to-point routines ****'
141 RunTest sendrecv_mpich 2 "**** Testing MPI_Send and MPI_Recv ****" "" "sendrecv-0.out sendrecv-1.out"
143 RunTest sendrecv2 2 "**** Testing MPI_Send and MPI_Recv (2) ****"
146 #Uses MPI_Pack and Unpack
147 #RunTest sendrecv3 2 "**** Testing MPI_Send and MPI_Recv (3) ****"
149 RunTest sendrecv4 2 "**** Testing MPI_Send and MPI_Recv (4) ****"
152 #RunTest bsendtest 2 "**** Testing MPI_Bsend and MPI_Recv (4) ****" "" "bsendtest-0.out bsendtest-1.out"
154 RunTest isndrcv 2 "**** Testing MPI_Isend and MPI_Irecv ****" "" "isndrcv-0.out isndrcv-1.out"
156 #RunTest irsend 2 "**** Testing MPI_Irsend ****"
158 #RunTest irsendinit 2 "**** Testing MPI_Rsend_init ****"
161 #rsend and ssend to implement, removed for now
162 RunTest longmsgs 2 "**** Testing long messages ****"
164 RunTest testsome 2 "**** Testing MPI_Testsome/Testany/Waitsome ****"
166 #issend used, replaced by isend - fails
167 #RunTest testall_mpich 2 "**** Testing MPI_Testall ****"
169 #MPI_Cancel, not yet implemented
170 #RunTest cancel 2 "**** Checking MPI_Cancel (Irecv's) ****"
172 #RunTest cancel2 2 "**** Checking MPI_Cancel (Persistent Recv's) ****"
174 #RunTest cancel3 2 "**** Checking MPI_Cancel (Persistent Send's) ****"
176 #RunTest cancelmessages 2 "**** Checking MPI_Cancel (short/eager/rndv) ****"
178 #RunTest cancelibm 2 "**** Checking MPI_Cancel (successful/nonsuccessful) ****"
180 # This test exposes a SEGV in the MPICH1 code. However, this is an
181 # uncommon situtation. Users who need this feature should switch to
182 # MPICH2 (www.mcs.anl.gov/mpi/mpich2)
183 #RunTest cancelissend 2 "**** Checking MPI_Cancel and MPI_Issend (short msgs) ****"
185 RunTest sndrcv 2 "**** Testing MPI_Sendrecv ****"
187 RunTest sndrcvrep 2 "**** Testing MPI_Sendrecv_replace ****"
189 #fails : check if buffer is correctly moved
190 RunTest sndrcvrpl2 2 "**** Testing MPI_Sendrecv_replace (long) ****"
192 #not implemented :TODO, should be simple, add a nbelements parameter to the datatype, compute it at creation time, then multiply status->count by this number
193 #RunTest getelm 2 "**** Testing MPI_Get_elements ****"
195 #uses Pack_size, Buffer_attach, Bsend, Buffer_detach
196 #RunTest overtake 2 "**** Verifying that messages are non-overtaking ****" "" "overtake-0.out overtake-1.out"
198 #RunTest ssendtest 2 "**** Verifying ssend ****"
200 #RunTest ssendtest2 2 "**** Verifying ssend (2) ****"
202 #RunTest issendtest 2 "**** Verifying Issend ****" "" "issendtest-1.out"
204 #RunTest issend2 2 "**** Verifying Issend (2) ****"
206 #uses MPI_Cancel, lets a lot of orphan comms.
207 #RunTest reqcreate 1 "**** Checking the request creation routines ****"
210 #hangs without reason: TODO debug
211 #RunTest reqfree 2 "**** Checking request free ****" "-req 2048"
213 RunTest typebase 1 "**** Checking the type (sizes) routines ****"
215 RunTest typecreate 1 "**** Checking the type creation routines ****"
217 RunTest typetest 2 "**** Checking the type routines ****" "" "typetest-0.out typetest-1.out"
219 #weird error, because comment says smpi returned value is same as expected from mpich .. modified to handle this value as correct
220 RunTest typeub 2 "**** Checking the type routines: MPI_UB ****"
222 #todo : handle lb correctly !
223 RunTest typeub2 1 "**** Checking the type routines: MPI_UB(2) ****"
225 #types too complex for smpi (structs of vectors)
226 #RunTest typeub3 1 "**** Checking the type routines: MPI_UB(3) ****"
229 RunTest typelb 1 "**** Checking the type routines: MPI_LB ****"
231 RunTest structlb 1 "**** Checking Type_struct routines: MPI_LB ****"
233 #ssend, replaced by send
234 RunTest dtypelife 2 "**** Checking the type routines: MPI_Type_free ****"
236 #TODO: handle alignment for extent values
237 #RunTest dataalign 2 "**** Checking the type alignment ****"
239 RunTest dtyperecv 2 "**** Checking the type recv ****"
241 RunTest commit 1 "**** Checking the type routines: MPI_Type_commit ****"
243 RunTest third 2 "*** Testing Unexpected messages ***"
245 RunTest fourth 4 "*** Testing Irecv/Isend/Wait ***"
247 RunTest fifth 4 "*** Testing Irecv/Isend/Waitall ***"
249 #uses MPI_keyval_create, Attr_put, Attr_get, Attr_delete, Keyval_free
250 #RunTest sixth 2 "*** Testing attribute manipulation ***"
252 RunTest nblock 4 "*** Testing Isend/Irecv (large numbers) ***"
254 #TODO : unlock probing ...
255 #RunTest nbtest 4 "*** Testing Isend/Probe/Recv (large numbers) ***"
257 RunTest sendmany 8 "*** Testing Send (many procs) ***"
259 # ... replaced by smpi_sleep calls
260 RunTest order 2 "*** Testing Recv ordering ***"
262 RunTest sendorder 2 "**** Checking Message Ordering ****"
264 RunTest exittest 3 "**** Checking Exit Processing ****"
267 #RunTest trunc 2 "*** Testing Message truncation ***"
268 #TODO: handle MPI_ERR_IN_STATUS
269 #RunTest truncmult 2 '*** Testing Message trunction in multiple completions ***'
271 RunTest nullproc 2 "*** Testing handling of MPI_PROC_NULL ***"
273 RunTest nullproc2 2 "*** Testing handling of MPI_PROC_NULL in blocking Recv ***"
275 RunTest relrank 2 "*** Testing handling of relative rank ***"
277 RunTest hvectest 2 "*** Testing Vector type ***"
279 RunTest hvectest2 2 "*** Testing struct type for vectors (MPI_UB) ***"
282 RunTest hvec 2 "*** Testing Type_Hvector ***"
284 RunTest hindexed 1 "*** Testing Type_Hindexed ***"
286 RunTest probe 2 "*** Testing Probe and Get_count ***"
288 RunTest probe1 2 "*** Testing Iprobe and Get_count ***"
290 RunTest self 1 "*** Testing send to self ***"
291 #TODO : handle COMM_SELF
292 #RunTest selfvsworld 2 "*** Testing COMM_SELF and COMM_WORLD ***"
294 RunTest testtest1 2 "*** Testing MPI_Test ***"
296 RunTest persistent 4 "*** Testing MPI_Recv_init ***"
298 RunTest persist 4 "*** Testing MPI_Startall/Request_free ***"
299 #used MPI_Buffers and Bsends
300 #RunTest persist2 4 "*** Testing MPI_Startall(Bsend)/Request_free ***"
302 RunTest waitall 4 "*** Testing MPI_Waitall ***"
304 #uses issend, replaced by isend, and ssend replaced by send
305 #weirdly fails when launched by make
306 RunTest waitall2 2 "*** Testing MPI_Waitall (order) ***"
308 RunTest waitall3 4 "*** Testing MPI_Waitall (order-irecv) ***"
310 RunTest waitall4 4 "*** Testing MPI_Waitall (order-isend) ***"
312 RunTest waitany 4 "*** Testing MPI_Waitany ***"
314 #RunTest pack 2 "*** Testing MPI_Pack ***"
316 #calls to ssend replaced by send
317 RunTest flood 2 "**** Testing large messages ****"
318 RunTest sendcplx 2 "*** Testing Fortran send ***"
320 #RunTest flood2 2 "**** Testing large numbers of messages ****"
322 # Run Fortran tests ONLY if Fortran available
326 #echo "*** secondf ***" >> pt2pt.out
327 #$mpirun $args -np 2 ./secondf "$@" >> pt2pt.out 2>&1
329 RunTest isendf 2 "*** Testing isend from Fortran ***"
331 RunTest allpair 2 "*** Testing pt-2-pt from Fortran ***"
333 RunTest allpair2 2 "*** Testing pt-2-pt from Fortran (many calls) ***"
336 testfiles="$testfiles structf.out"
339 echo '*** Testing Type_struct from Fortran ***'
340 echo '*** Testing Type_struct from Fortran ***' >> structf.out
341 # This is tricky. Because of a bug in IRIX64, we need to direct
342 # input from /dev/null (so that we can know that we need a new process
343 # group). This should be ok for everyone, but SunOS 4.1.4 tends to
344 # panic (!!) in this case. Since both behaviors represent broken
345 # operating systems, we test for ARCH=IRIX64
346 if [ "LINUX" = "IRIX64" ] ; then
347 $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1 < /dev/null
349 $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1
351 echo '*** Testing Type_struct from Fortran ***' >> structf.out
355 RunTest send1 2 "*** Testing pt-2-pt from Fortran (2) ***"
357 RunTest sendfort 2 "*** Testing Fortran logical datatype ***"
360 # testfiles="$testfiles pingpong.out"
363 # echo '*** Testing pt-2-pt from Fortran (3) ***'
364 # echo '*** Testing pt-2-pt from Fortran (3) ***' >> pingpong.out
365 # $mpirun $args -np 2 ./pingpong "$@" >> pingpong.out 2>&1
366 # echo '*** Testing pt-2-pt from Fortran (3) ***' >> pingpong.out
367 # CheckOutput pingpong
370 echo "END OF FORTRAN TESTS"
375 testfiles=`echo *.out`
376 if test "$testfiles" = "*.out" ; then
377 echo "No output files remain from previous test!"
382 writesummaryfile=$savewritesummaryfile
383 echo '*** Checking for differences from expected output ***'
384 CheckAllOutput pt2pt.diff