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.
28 CheckOutputWhileRunning="yes"
29 # Using shifts should remove args from the list.
33 basedir=`echo $arg | sed 's/-basedir=//'`
36 srcdir=`echo $arg | sed 's/-srcdir=//'`
39 have_fortran=`echo $arg | sed 's/-fort=//'`
47 margs=`echo $arg | sed 's/-margs=//'`
52 summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
75 echo "runtests [-checkonly] [-margs='...'] [-atend] [-check]"
76 echo "run tests in this directory. If -checkonly set, just run"
77 echo "the differences check (do NO rerun the test programs)."
78 echo "If -margs is used, these options are passed to mpirun."
79 echo "If -small is used, the examples are built, run, and deleted."
80 echo "If -atend is used, the success of the tests is checked only"
81 echo "at the end of the test rather than also after each test."
82 echo "If -check is used, only a single simple test is run; this"
83 echo "is used to check that mpirun can run an MPI program."
87 if test -n "$arg" ; then
88 echo "Passing remaining arguments to programs ($*)"
96 # Load basic procedures
97 . ${srcdir}/../runbase
99 # Do this because we're writing the output while running
100 savewritesummaryfile=$writesummaryfile
103 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"
105 # If cannot run test, do that and exit
106 if [ $check_canrun = 1 ] ; then
107 # Make sure that we don't have an old file lying around
108 rm -f third third.o third.exe
111 echo '*** Testing Unexpected messages ***' >> third.out
112 $mpirun $args -np 2 ./third </dev/null >> third.out 2>&1
113 echo '*** Testing Unexpected messages ***' >> third.out
115 cat >>third.stdo <<EOF
116 *** Testing Unexpected messages ***
118 *** Testing Unexpected messages ***
120 # if diff -b third.out third.stdo > /dev/null ; then
123 # echo "Failed to run simple program!"
124 # echo "Output from run attempt was"
126 # echo "mpirun program was $mpirun"
127 # echo "mpirun command was "
128 # echo "$mpirun $args -np 2 ./third </dev/null >>third.out 2>&1"
136 # If the programs are not available, run make.
137 if [ ! -x sendrecv_mpich -a $makeeach = 0 -a $runtests = 1 ] ; then
142 if [ $runtests = 1 ] ; then
143 echo '**** Testing MPI Point-to-point routines ****'
145 RunTest sendrecv_mpich 2 "**** Testing MPI_Send and MPI_Recv ****" "" "sendrecv-0.out sendrecv-1.out"
147 RunTest sendrecv2 2 "**** Testing MPI_Send and MPI_Recv (2) ****"
150 #Uses MPI_Pack and Unpack
151 #RunTest sendrecv3 2 "**** Testing MPI_Send and MPI_Recv (3) ****"
153 RunTest sendrecv4 2 "**** Testing MPI_Send and MPI_Recv (4) ****"
156 #RunTest bsendtest 2 "**** Testing MPI_Bsend and MPI_Recv (4) ****" "" "bsendtest-0.out bsendtest-1.out"
158 RunTest isndrcv 2 "**** Testing MPI_Isend and MPI_Irecv ****" "" "isndrcv-0.out isndrcv-1.out"
160 #RunTest irsend 2 "**** Testing MPI_Irsend ****"
162 #RunTest irsendinit 2 "**** Testing MPI_Rsend_init ****"
165 #rsend and ssend to implement, removed for now
166 RunTest longmsgs 2 "**** Testing long messages ****"
168 RunTest testsome 2 "**** Testing MPI_Testsome/Testany/Waitsome ****"
170 #issend used, replaced by isend - fails
171 #RunTest testall_mpich 2 "**** Testing MPI_Testall ****"
173 #MPI_Cancel, not yet implemented
174 #RunTest cancel 2 "**** Checking MPI_Cancel (Irecv's) ****"
176 #RunTest cancel2 2 "**** Checking MPI_Cancel (Persistent Recv's) ****"
178 #RunTest cancel3 2 "**** Checking MPI_Cancel (Persistent Send's) ****"
180 #RunTest cancelmessages 2 "**** Checking MPI_Cancel (short/eager/rndv) ****"
182 #RunTest cancelibm 2 "**** Checking MPI_Cancel (successful/nonsuccessful) ****"
184 # This test exposes a SEGV in the MPICH1 code. However, this is an
185 # uncommon situtation. Users who need this feature should switch to
186 # MPICH2 (www.mcs.anl.gov/mpi/mpich2)
187 #RunTest cancelissend 2 "**** Checking MPI_Cancel and MPI_Issend (short msgs) ****"
189 RunTest sndrcv 2 "**** Testing MPI_Sendrecv ****"
191 RunTest sndrcvrep 2 "**** Testing MPI_Sendrecv_replace ****"
193 RunTest sndrcvrpl2 2 "**** Testing MPI_Sendrecv_replace (long) ****"
195 #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
196 #RunTest getelm 2 "**** Testing MPI_Get_elements ****"
198 #uses Pack_size, Buffer_attach, Bsend, Buffer_detach
199 #RunTest overtake 2 "**** Verifying that messages are non-overtaking ****" "" "overtake-0.out overtake-1.out"
201 #RunTest ssendtest 2 "**** Verifying ssend ****"
203 #RunTest ssendtest2 2 "**** Verifying ssend (2) ****"
205 #RunTest issendtest 2 "**** Verifying Issend ****" "" "issendtest-1.out"
207 #RunTest issend2 2 "**** Verifying Issend (2) ****"
209 #uses MPI_Cancel, lets a lot of orphan comms.
210 #RunTest reqcreate 1 "**** Checking the request creation routines ****"
213 #free does really free the request, without waiting for completion, leading to bugs.
214 #RunTest reqfree 2 "**** Checking request free ****" "-req 2048"
216 RunTest typebase 1 "**** Checking the type (sizes) routines ****"
218 RunTest typecreate 1 "**** Checking the type creation routines ****"
220 RunTest typetest 2 "**** Checking the type routines ****" "" "typetest-0.out typetest-1.out"
222 #weird error, because comment says smpi returned value is same as expected from mpich .. modified to handle this value as correct
223 RunTest typeub 2 "**** Checking the type routines: MPI_UB ****"
225 #todo : handle lb correctly !
226 #RunTest typeub2 1 "**** Checking the type routines: MPI_UB(2) ****"
228 #types too complex for smpi (structs of vectors)
229 #RunTest typeub3 1 "**** Checking the type routines: MPI_UB(3) ****"
232 #RunTest typelb 1 "**** Checking the type routines: MPI_LB ****"
234 #RunTest structlb 1 "**** Checking Type_struct routines: MPI_LB ****"
236 #ssend, replaced by send
237 RunTest dtypelife 2 "**** Checking the type routines: MPI_Type_free ****"
239 #TODO: handle alignment for extent values
240 #RunTest dataalign 2 "**** Checking the type alignment ****"
242 RunTest dtyperecv 2 "**** Checking the type recv ****"
244 RunTest commit 1 "**** Checking the type routines: MPI_Type_commit ****"
246 RunTest third 2 "*** Testing Unexpected messages ***"
248 RunTest fourth 4 "*** Testing Irecv/Isend/Wait ***"
250 RunTest fifth 4 "*** Testing Irecv/Isend/Waitall ***"
252 #uses MPI_keyval_create, Attr_put, Attr_get, Attr_delete, Keyval_free
253 #RunTest sixth 2 "*** Testing attribute manipulation ***"
255 RunTest nblock 4 "*** Testing Isend/Irecv (large numbers) ***"
257 #TODO : unlock probing ...
258 #RunTest nbtest 4 "*** Testing Isend/Probe/Recv (large numbers) ***"
260 RunTest sendmany 8 "*** Testing Send (many procs) ***"
262 # ... replaced by smpi_sleep calls
263 RunTest order 2 "*** Testing Recv ordering ***"
265 RunTest sendorder 2 "**** Checking Message Ordering ****"
267 RunTest exittest 3 "**** Checking Exit Processing ****"
270 #RunTest trunc 2 "*** Testing Message truncation ***"
271 #TODO: handle MPI_ERR_IN_STATUS
272 #RunTest truncmult 2 '*** Testing Message trunction in multiple completions ***'
274 RunTest nullproc 2 "*** Testing handling of MPI_PROC_NULL ***"
276 RunTest nullproc2 2 "*** Testing handling of MPI_PROC_NULL in blocking Recv ***"
278 RunTest relrank 2 "*** Testing handling of relative rank ***"
280 RunTest hvectest 2 "*** Testing Vector type ***"
282 RunTest hvectest2 2 "*** Testing struct type for vectors (MPI_UB) ***"
285 #RunTest hvec 2 "*** Testing Type_Hvector ***"
287 #RunTest hindexed 1 "*** Testing Type_Hindexed ***"
289 RunTest probe 2 "*** Testing Probe and Get_count ***"
291 RunTest probe1 2 "*** Testing Iprobe and Get_count ***"
293 RunTest self 1 "*** Testing send to self ***"
294 #TODO : handle COMM_SELF
295 #RunTest selfvsworld 2 "*** Testing COMM_SELF and COMM_WORLD ***"
297 RunTest testtest1 2 "*** Testing MPI_Test ***"
299 RunTest persistent 4 "*** Testing MPI_Recv_init ***"
301 RunTest persist 4 "*** Testing MPI_Startall/Request_free ***"
302 #used MPI_Buffers and Bsends
303 #RunTest persist2 4 "*** Testing MPI_Startall(Bsend)/Request_free ***"
305 RunTest waitall 4 "*** Testing MPI_Waitall ***"
307 #uses issend, replaced by isend, and ssend replaced by send
308 #RunTest waitall2 2 "*** Testing MPI_Waitall (order) ***"
310 #RunTest waitall3 4 "*** Testing MPI_Waitall (order-irecv) ***"
312 #RunTest waitall4 4 "*** Testing MPI_Waitall (order-isend) ***"
313 #put a big value for the message size, because it failed as a detached send (isend was used instead of issend)
314 RunTest waitany 4 "*** Testing MPI_Waitany ***"
316 #RunTest pack 2 "*** Testing MPI_Pack ***"
318 #calls to ssend replaced by send
319 RunTest flood 2 "**** Testing large messages ****"
322 #RunTest flood2 2 "**** Testing large numbers of messages ****"
324 # Run Fortran tests ONLY if Fortran available
325 if [ $have_fortran -eq "1" ] ; then
328 #echo "*** secondf ***" >> pt2pt.out
329 #$mpirun $args -np 2 ./secondf "$@" >> pt2pt.out 2>&1
331 RunTest isendf 2 "*** Testing isend from Fortran ***"
333 RunTest sendcplx 2 "*** Testing Fortran send ***"
334 #RunTest allpair 2 "*** Testing pt-2-pt from Fortran ***"
336 #RunTest allpair2 2 "*** Testing pt-2-pt from Fortran (many calls) ***"
339 # testfiles="$testfiles structf.out"
342 # echo '*** Testing Type_struct from Fortran ***'
343 # echo '*** Testing Type_struct from Fortran ***' >> structf.out
344 # This is tricky. Because of a bug in IRIX64, we need to direct
345 # input from /dev/null (so that we can know that we need a new process
346 # group). This should be ok for everyone, but SunOS 4.1.4 tends to
347 # panic (!!) in this case. Since both behaviors represent broken
348 # operating systems, we test for ARCH=IRIX64
349 # if [ "LINUX" = "IRIX64" ] ; then
350 # $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1 < /dev/null
352 # $mpirun $args -np 2 ./structf "$@" >> structf.out 2>&1
354 # echo '*** Testing Type_struct from Fortran ***' >> structf.out
355 # CheckOutput structf
358 RunTest send1 2 "*** Testing pt-2-pt from Fortran (2) ***"
360 RunTest sendfort 2 "*** Testing Fortran logical datatype ***"
363 testfiles="$testfiles pingpong.out"
367 echo '*** Testing pt-2-pt from Fortran (3) ***'
368 $mpirun $args -np 2 ./pingpong_f "$@" >> /dev/null
372 echo "END OF FORTRAN TESTS"
377 testfiles=`echo *.out`
378 if test "$testfiles" = "*.out" ; then
379 echo "No output files remain from previous test!"
384 writesummaryfile=$savewritesummaryfile
385 echo '*** Checking for differences from expected output ***'
386 CheckAllOutput pt2pt.diff