📄 temprun
字号:
#!/bin/sh# This version puts the output from each program into a separate file.# -mvhome is needed for the ANL SP, and is ignored by othersargs="-pg -mvhome"#runtests=1makeeach=0for arg in "$@" ; do case $arg in -checkonly ) runtests=0 ;; -margs=*) margs=`echo $arg | sed 's/-margs=//'` args="$args $margs" ;; -small) makeeach=1 ;; -help|-u) echo "runtests [-checkonly] [-margs='...']" echo "run tests in this directory. If -checkonly set, just run" echo "the differences check (do NO rerun the test programs)." echo "If -margs is used, these options are passed to mpirun." echo "If -small is used, the examples are built, run, and deleted." exit 1 ;; *) if test -n "$arg" ; then echo "runtests: Unknown argument ($arg)" exit 1 fi ;; esacdoneMakeExe() { if [ $makeeach = 1 -o ! -x $1 ] ; then make $1 fi}CleanExe() { if [ $makeeach = 1 ] ; then /bin/rm -f $1 $1.o fi}# If the programs are not available, run make.if [ ! -x coll1 -a $makeeach = 0 ] ; then make fitestfiles=""if [ $runtests = 1 ] ; thenecho '**** Testing MPI Collective routines ****'testfiles="$testfiles barrier.out"/bin/rm -f barrier.out barrier-0.outMakeExe barrierecho '*** Barrier Test ***' >> barrier.outecho '**** Barrier Test ****'mpirun $args -np 4 -mvback "barrier-0.out" barrier $* >> barrier.outcat barrier-0.out >> barrier.out/bin/rm -f barrier-[01234].outecho '*** Barrier Test ***' >> barrier.outCleanExe barriertestfiles="$testfiles bcast.out"/bin/rm -f bcast.out bcast-[0-3].outMakeExe bcastecho '**** Broadcast Test ****'echo '*** Broadcast Test ***' >> bcast.outmpirun $args -np 4 \ -mvback "bcast-0.out bcast-1.out bcast-2.out bcast-3.out" \ bcast $* >> bcast.outcat bcast-[0123].out >> bcast.out/bin/rm -f bcast-[0123].outecho '*** Broadcast Test ***' >> bcast.outCleanExe bcasttestfiles="$testfiles coll1.out"/bin/rm -f coll1.outMakeExe coll1echo '**** coll1 ****'echo '*** coll1 ***' >> coll1.outmpirun $args -np 4 coll1 $* >> coll1.outecho '*** coll1 ***' >> coll1.outCleanExe coll1testfiles="$testfiles coll2.out"/bin/rm -f coll2.outMakeExe coll2echo '**** coll2 ****'echo '*** coll2 ***' >> coll2.out# mpirun $args -np 5 coll2 $* >> coll2.outecho '*** coll2 ***' >> coll2.outCleanExe coll2testfiles="$testfiles coll3.out"/bin/rm -f coll3.outMakeExe coll3echo '**** coll3 ****'echo '*** coll3 ***' >> coll3.outmpirun $args -np 5 coll3 $* >> coll3.outecho '*** coll3 ***' >> coll3.outCleanExe coll3testfiles="$testfiles coll4.out"/bin/rm -f coll4.outMakeExe coll4echo '**** coll4 ****'echo '*** coll4 ***' >> coll4.outmpirun $args -np 4 coll4 $* >> coll4.outecho '*** coll4 ***' >> coll4.outCleanExe coll4testfiles="$testfiles coll5.out"/bin/rm -f coll5.outMakeExe coll5echo '**** coll5 ****'echo '*** coll5 ***' >> coll5.outmpirun $args -np 4 coll5 $* >> coll5.outecho '*** coll5 ***' >> coll5.outCleanExe coll5testfiles="$testfiles coll6.out"/bin/rm -f coll6.outMakeExe coll6echo '**** coll6 ****'echo '*** coll6 ***' >> coll6.outmpirun $args -np 5 coll6 $* >> coll6.outecho '*** coll6 ***' >> coll6.outCleanExe coll6testfiles="$testfiles coll7.out"/bin/rm -f coll7.outMakeExe coll7echo '**** coll7 ****'echo '*** coll7 ***' >> coll7.outmpirun $args -np 5 coll7 $* >> coll7.outecho '*** coll7 ***' >> coll7.outCleanExe coll7testfiles="$testfiles coll8.out"/bin/rm -f coll8.outMakeExe coll8echo '**** coll8 ****'echo '*** coll8 ***' >> coll8.outmpirun $args -np 4 coll8 $* >> coll8.outecho '*** coll8 ***' >> coll8.outCleanExe coll8testfiles="$testfiles coll9.out"/bin/rm -f coll9.outMakeExe coll9echo '**** coll9 ****'echo '*** coll9 ***' >> coll9.outmpirun $args -np 4 coll9 $* >> coll9.outecho '*** coll9 ***' >> coll9.outCleanExe coll9testfiles="$testfiles coll10.out"/bin/rm -f coll10.outMakeExe coll10echo '**** coll10 ****'echo '*** coll10 ***' >> coll10.outmpirun -np 4 $args coll10 $* >> coll10.outecho '*** coll10 ***' >> coll10.outCleanExe coll10testfiles="$testfiles coll11.out"/bin/rm -f coll11.outMakeExe coll11echo '**** coll11 ****'echo '*** coll11 ***' >> coll11.outmpirun -np 4 $args coll11 $* >> coll11.outecho '*** coll11 ***' >> coll11.outCleanExe coll11testfiles="$testfiles coll12.out"/bin/rm -f coll12.outMakeExe coll12echo '**** coll12 ****'echo '*** coll12 ***' >> coll12.outmpirun -np 4 $args coll12 $* >> coll12.outecho '*** coll12 ***' >> coll12.outCleanExe coll12testfiles="$testfiles coll13.out"/bin/rm -f coll13.outMakeExe coll13echo '**** coll13 ****'echo '*** coll13 ***' >> coll13.outmpirun -np 4 $args coll13 $* >> coll13.outecho '*** coll13 ***' >> coll13.outCleanExe coll13testfiles="$testfiles grouptest.out"/bin/rm -f grouptest.outMakeExe grouptestecho '*** Grouptest ***'echo '*** grouptest ***' >> grouptest.outmpirun $args -np 4 grouptest $* >> grouptest.outecho '*** grouptest ***' >> grouptest.outCleanExe grouptesttestfiles="$testfiles allred.out"/bin/rm -f allred.outMakeExe allredecho '*** Allred ***'echo '*** Allred ***' >> allred.outmpirun $args -np 4 allred $* >> allred.outecho '*** Allred ***' >> allred.outCleanExe allredtestfiles="$testfiles scatterv.out"/bin/rm -f scatterv.outMakeExe scattervecho '*** Scatterv ***'echo '*** Scatterv ***' >> scatterv.outmpirun $args -np 4 scatterv $* >> scatterv.outecho '*** Scatterv ***' >> scatterv.outCleanExe scatterv## Run Fortran tests ONLY if Fortran availableif [ 1 = 1 ] ; then echo "FORTRAN TESTS" # testfiles="$testfiles allredf.out" /bin/rm -f allredf.out MakeExe allredf echo '*** Testing allreduce from Fortran ***' echo '*** Testing allreduce from Fortran ***' >> allredf.out mpirun $args -np 4 allredf "$@" >> allredf.out echo '*** Testing allreduce from Fortran ***' >> allredf.out CleanExe allredf # echo "END OF FORTRAN TESTS"fielse # Just run checks testfiles=`echo *.out` if test "$testfiles" = "*.out" ; then echo "No output files remain from previous test!" exit 1 fifiecho '*** Differences from expected output ***'/bin/rm -f coll.difffor file in $testfiles ; do stdfile=`basename $file .out`.std if [ -s $stdfile ] ; then if diff -b $file `basename $file .out`.std > /dev/null ; then true else echo "Differences in `basename $file .out`" >> coll.diff diff -b $file `basename $file .out`.std >> coll.diff fi else echo "Can not find file $stdfile to compare against for test `basename $file .out`" fidoneif [ -s coll.diff ] ; then cat coll.difffiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -