1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
|
#! /bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
mpirun="@MPIRUN@"
STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
#
# If the programs are not available, run make.
runtests=1
makeeach=0
check_at_once=1
quiet=0
MAKE="@MAKE@"
srcdir=@srcdir@
check_canrun=0
subset_only=0
FILENAME=test
# Using shifts should remove args from the list.
for arg in "$@" ; do
case $arg in
-checkonly)
shift
runtests=0
;;
-margs=*)
shift
margs=`echo $arg | sed 's/-margs=//'`
args="$args $margs"
;;
-echo)
shift
set -x
;;
-check)
check_canrun=1
;;
-quiet)
shift
quiet=1
;;
-small)
shift
makeeach=1
;;
-subset)
shift
subset_only=1
;;
-fname=*)
FILENAME=`echo $arg|sed 's/-*fname=//'`
;;
-atend)
shift
check_at_once=0
;;
-help|-u)
shift
echo "runtests [-fname=FILENAME] [-checkonly] [-atend] [-check]"
echo "run tests in this directory. If -checkonly set, just run"
echo "the differences check (do NOT rerun the test programs)."
echo "If -small is used, the examples are built, run, and deleted."
echo "If -atend is used, the success of the tests is checked only"
echo "at the end of the test rather than also after each test."
echo "If -check is used, only a single simple test is run; this"
echo "is used to check that mpirun can run an MPI program."
echo "If -subset is used, we skip tests for atomicity and shared"
echo "file pointers which can fail on some distributed file systems"
exit 1
;;
*)
if test -n "$arg" ; then
echo "Passing remaining arguments to programs ($*)"
break
fi
;;
esac
done
# MakeExe program-name
MakeExe() {
if [ -s $STOPFILE ] ; then
echo "Found stopfile; exiting"
exit 0
fi
if [ ! -x $1 ] ; then
$MAKE $1
if [ ! -x $1 ] ; then
echo "Could not build executable $1; aborting tests"
exit 1
fi
fi
}
# CleanExe program-name
CleanExe() {
if [ $makeeach = 1 ] ; then
rm -f $1 $1.o
fi
}
# Output marker
OutTime() {
if [ $quiet = 0 ] ; then
if [ -z "$hostname" ] ; then
hostname=`hostname`
fi
d=`date`
echo "$hostname : $d"
fi
}
# Do an "on the fly" check for problems.
CheckOutput() {
bfile=$1
if [ $check_at_once = 1 ] ; then
stdfile=${srcdir}/std/$bfile.std
if [ ! -s $bfile.out ] ; then
echo "No output file $bfile.out!"
elif [ -s $stdfile ] ; then
stdfile2=${stdfile}2
# Handle Fortran systems that generate stop statements
rm -f ${bfile}.tout
grep -v 'FORTRAN STOP' ${bfile}.out > ${bfile}.tout
if diff -b $bfile.tout $stdfile > /dev/null ; then
true
elif [ -s $stdfile2 ] ; then
# check for alternate in case configuration has fewer datatypes
if diff -b $bfile.tout $stdfile2 > /dev/null ; then
true
else
echo "Differences in $bfile.out"
diff -b $bfile.tout $stdfile
nodiff=0
fi
else
echo "Differences in $bfile.out"
diff -b $bfile.tout $stdfile
fi
rm -f ${bfile}.tout
else
echo "Can not find file $stdfile to compare against for test $bfile"
fi
fi
}
# nothing uses this function yet... just toying with the concept
RunTest() {
OutTime
testfiles="$testfiles ${1}.out"
rm -rf ${1}.out
MakeExe simple
rm -rf $FILENAME*
echo "**** Testing ${1}.c ****"
mpirun -np 4 ./${1} -fname $FILENAME "$@" >>${1}.out 2>1
CheckOutput ${1}
CleanExe ${1}
}
# If the programs are not available, run make.
if [ ! -x simple -a $makeeach = 0 ] ; then
$MAKE default
fi
#
testfiles=""
if [ $runtests = 1 ] ; then
echo '**** Testing I/O functions ****'
#
OutTime
testfiles="$testfiles simple.out"
\rm -f simple.out
MakeExe simple
\rm -f $FILENAME*
echo '**** Testing simple.c ****'
$mpirun -np 4 ./simple -fname $FILENAME
# CheckOutput simple
CleanExe simple
#
OutTime
testfiles="$testfiles async.out"
\rm -f async.out
MakeExe async
\rm -f $FILENAME*
echo '**** Testing async.c ****'
$mpirun -np 4 ./async -fname $FILENAME
# CheckOutput async
CleanExe async
#
OutTime
testfiles="$testfiles async-multi.out"
\rm -f async-multi.out
MakeExe async-multiple
\rm -f $FILENAME*
echo '**** Testing async-multiple.c ****'
$mpirun -np 4 ./async-multiple -fname $FILENAME
# CheckOutput async-multiple
CleanExe async-multiple
#
OutTime
if [ $subset_only -eq 0 ] ; then
testfiles="$testfiles atomicity.out"
\rm -f atomicity.out
MakeExe atomicity
\rm -f $FILENAME*
echo '**** Testing atomicity.c ****'
# Atomicity test recommends at least 8 processes (separate processors
# even better)
$mpirun -np 4 ./atomicity -fname $FILENAME
# CheckOutput atomicity
CleanExe atomicity
#
OutTime
fi
testfiles="$testfiles coll_test.out"
\rm -f coll_test.out
MakeExe coll_test
\rm -f $FILENAME*
echo '**** Testing coll_test.c ****'
$mpirun -np 4 ./coll_test -fname $FILENAME
# CheckOutput coll_test
CleanExe coll_test
#
OutTime
testfiles="$testfiles excl.out"
\rm -f excl.out
MakeExe excl
\rm -f $FILENAME*
echo '**** Testing excl.c ****'
$mpirun -np 4 ./excl -fname $FILENAME
# CheckOutput excl
CleanExe excl
#
OutTime
testfiles="$testfiles file_info.out"
\rm -f file_info.out
MakeExe file_info
\rm -f $FILENAME*
echo '**** Testing file_info.c ****'
$mpirun -np 4 ./file_info -fname $FILENAME
# CheckOutput file_info
CleanExe file_info
#
OutTime
testfiles="$testfiles i_noncontig.out"
\rm -f i_noncontig.out
MakeExe i_noncontig
\rm -f $FILENAME*
echo '**** Testing i_noncontig.c ****'
$mpirun -np 2 ./i_noncontig -fname $FILENAME
# CheckOutput i_noncontig
CleanExe i_noncontig
#
OutTime
testfiles="$testfiles noncontig.out"
\rm -f noncontig.out
MakeExe noncontig
\rm -f $FILENAME*
echo '**** Testing noncontig.c ****'
$mpirun -np 2 ./noncontig -fname $FILENAME
# CheckOutput noncontig
CleanExe noncontig
#
OutTime
testfiles="$testfiles noncontig_coll.out"
\rm -f noncontig_coll.out
MakeExe noncontig_coll
\rm -f $FILENAME*
echo '**** Testing noncontig_coll.c ****'
$mpirun -np 2 ./noncontig_coll -fname $FILENAME
# CheckOutput noncontig_coll
CleanExe noncontig_coll
#
OutTime
testfiles="$testfiles noncontig_coll2.out"
\rm -f noncontig_coll2.out
MakeExe noncontig_coll2
\rm -f $FILENAME*
echo '**** Testing noncontig_coll2.c ****'
$mpirun -np 4 ./noncontig_coll2 -fname $FILENAME
# CheckOutput noncontig_coll2
CleanExe noncontig_coll2
MakeExe aggregation1
echo '**** Testing aggregation1 ****'
$mpirun -np 4 ./aggregation1 -h -f $FILENAME
# CheckOutput aggregation1
CleanExe aggregation1
MakeExe aggregation2
echo '**** Testing aggregation2 ****'
$mpirun -np 4 ./aggregation2 $FILENAME
# CheckOutput aggregation2
CleanExe aggregation2
MakeExe hindexed
echo '**** Testing hindexed ****'
$mpirun -np 4 ./hindexed $FILENAME
# CheckOutput hindexed
CleanExe hindexed
#
#echo '**** Testing write_all_test (run 1)****'
#$mpirun -np 4 ./write_all_test -nzp 2 -zplace 2 -nzw 2 -naw 2 -size 100 \
# -offm 8 -hints romio_cb_write enable -fname $FILENAME
#echo '**** Testing write_all_test (run 2)****'
#$mpirun -np 4 ./write_all_test -nzp 2 -zplace 2 -nzw 2 -naw 2 -size 100 \
# -offm 4 -hints romio_cb_write enable -fname $FILENAME
#CleanExe write_all_test
OutTime
if [ $subset_only -eq 0 ] ; then
testfiles="$testfiles misc.out"
\rm -f misc.out
MakeExe misc
\rm -f $FILENAME*
echo '**** Testing misc.c ****'
$mpirun -np 4 ./misc -fname $FILENAME
# CheckOutput misc
CleanExe misc
#
OutTime
fi
if [ $subset_only -eq 0 ] ; then
testfiles="$testfiles shared_fp.out"
\rm -f shared_fp.out
MakeExe shared_fp
\rm -f $FILENAME*
echo '**** Testing shared_fp.c ****'
$mpirun -np 4 ./shared_fp -fname $FILENAME
# CheckOutput shared_fp
CleanExe shared_fp
#
OutTime
testfiles="$testfiles ordered_fp.out"
\rm -f ordered_fp.out
MakeExe ordered_fp
\rm -f $FILENAME*
echo '**** Testing ordered_fp.c ****'
$mpirun -np 4 ./ordered_fp -fname $FILENAME
CleanExe ordered_fp
#
OutTime
fi
testfiles="$testfiles split_coll.out"
\rm -f split_coll.out
MakeExe split_coll
\rm -f $FILENAME*
echo '**** Testing split_coll.c ****'
$mpirun -np 4 ./split_coll -fname $FILENAME
# CheckOutput split_coll
CleanExe split_coll
#
OutTime
testfiles="$testfiles psimple.out"
\rm -f psimple.out
MakeExe psimple
\rm -f $FILENAME*
echo '**** Testing psimple.c ****'
$mpirun -np 4 ./psimple -fname $FILENAME
# CheckOutput psimple
CleanExe psimple
#
OutTime
testfiles="$testfiles error.out"
\rm -f error.out
MakeExe error
\rm -f $FILENAME*
echo '**** Testing error.c ****'
$mpirun -np 1 ./error -fname $FILENAME
# CheckOutput error
CleanExe error
#
OutTime
testfiles="$testfiles status.out"
\rm -f status.out
MakeExe status
\rm -f $FILENAME*
echo '**** Testing status.c ****'
# Some systems have a status program.
$mpirun -np 1 ./status -fname $FILENAME
# CheckOutput status
CleanExe status
testfiles="$testfiles types_with_zeros.out"
\rm -f types_with_zeros.out
MakeExe types_with_zeros
\rm -f $FILENAME*
echo '**** Testing types_with_zeros ****'
$mpirun -np 2 ./types_with_zeros $FILENAME
CleanExe types_with_zeros
testfiles="$testfiles darray_read.out"
\rm -f darray_read.out
MakeExe darray_read
\rm -f $FILENAME*
echo '**** Testing darray_read ****'
$mpirun -np 4 ./darray_read $FILENAME
CleanExe darray_read
#
if [ @NOF77@ = 0 ] ; then
echo ""
echo "FORTRAN TESTS"
OutTime
if [ $subset_only -eq 0 ] ; then
testfiles="$testfiles fmisc.out"
\rm -f fmisc.out
MakeExe fmisc
\rm -f $FILENAME*
echo '**** Testing fmisc.f ****'
$mpirun -np 4 ./fmisc -fname $FILENAME
# CheckOutput fmisc
CleanExe fmisc
#
OutTime
fi
testfiles="$testfiles fcoll_test.out"
\rm -f fcoll_test.out
MakeExe fcoll_test
\rm -f $FILENAME*
echo '**** Testing fcoll_test.f ****'
$mpirun -np 4 ./fcoll_test -fname $FILENAME
# CheckOutput fcoll_test
CleanExe fcoll_test
#
OutTime
testfiles="$testfiles pfcoll_test.out"
\rm -f pfcoll_test.out
MakeExe pfcoll_test
\rm -f $FILENAME*
echo '**** Testing pfcoll_test.f ****'
$mpirun -np 4 ./pfcoll_test -fname $FILENAME
# CheckOutput pfcoll_test
CleanExe pfcoll_test
#
echo ""
fi
#
else
# Just run checks
testfiles=`echo *.out`
if test "$testfiles" = "*.out" ; then
echo "No output files remain from previous test!"
exit 1
fi
fi
#
# echo '*** Checking for differences from expected output ***'
# rm -f iotests.diff
# nodiff=1
# for file in $testfiles ; do
# stdfile="${srcdir}/std/`basename $file .out`.std"
# # if basename is sendrecv or isndrcv, then we may want to test
# # with .std2 as well. We should really separate out the long double
# # tests ...
# if [ -s $stdfile ] ; then
# stdfile2=${stdfile}2
# # Handle Fortran systems that generate stop statements
# bfile="`basename $file .out`.tout"
# rm -f ${bfile}
# grep -v 'FORTRAN STOP' ${file} > ${bfile}
# if diff -b $bfile $stdfile > /dev/null ; then
# true
# elif [ -s $stdfile2 ] ; then
# # check for alternate in case configuration has fewer datatypes
# if diff -b $bfile $stdfile2 > /dev/null ; then
# true
# else
# echo "Differences in `basename $file .out`" >> iotests.diff
# diff -b $bfile $stdfile >> iotests.diff
# nodiff=0
# fi
# else
# echo "Differences in `basename $file .out`" >> iotests.diff
# diff -b $bfile $stdfile >> iotests.diff
# nodiff=0
# fi
# rm -f ${bfile}
# else
# echo "Can not find file $stdfile to compare against for test `basename $file .out`"
# nodiff=0
# fi
# done
# if [ -s iotests.diff ] ; then
# cat iotests.diff
# elif [ $nodiff = 1 ] ; then
# echo "-- No differences found; test successful"
# fi
exit 0
|