Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add mpich3 test suite, to replace older one.
[simgrid.git] / teshsuite / smpi / mpich-test / profile / runtests
1 #! /bin/sh
2 #
3 # Run some of the tests.  If any arguments are provided, pass them to the
4 # test programs.
5 #
6 # -mvhome is needed for the ANL SP, and is ignored by others
7 args=
8 device=
9 MPICH_VERSION=
10 STOPFILE=${MPITEST_STOPTEST:-"$HOME/.stopmpichtests"}
11
12 MAKE="make --no-print-directory"
13 MPIRUNMVBACK=""
14 #
15
16 #
17 # Set mpirun to the name/path of the mpirun program
18 #FindMPIRUN
19 #if [ -z "$mpirun" ] ; then
20 #    echo "No mpirun in path.  Testing cannot proceed."
21 #    exit 1
22 #fi
23 #
24 # If the programs are not available, run make.
25 runtests=1
26 makeeach=0
27 writesummaryfile=no
28 quiet=0
29 have_fortran=0
30 check_at_once=1
31 MAKE="make --no-print-directory"
32 for arg in "$@" ; do
33     case $arg in 
34     -basedir=* )
35         basedir=`echo $arg | sed 's/-basedir=//'`
36         ;; 
37     -srcdir=* )
38         srcdir=`echo $arg | sed 's/-srcdir=//'`
39         ;; 
40         -fort=* )
41         have_fortran=`echo $arg | sed 's/-fort=//'`
42         ;;
43         -checkonly)
44         runtests=0
45         ;;
46     -margs=*)
47         margs=`echo $arg | sed 's/-margs=//'`
48         args="$args $margs"
49         ;;
50         -summaryfile=*)
51         writesummaryfile=yes
52         summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
53         ;;
54         -echo)
55         set -x
56         ;;
57         -small)
58         makeeach=1
59         ;;
60         -quiet)
61         shift
62         quiet=1
63         ;;
64         -atend)
65         check_at_once=0
66         ;;
67         -help|-u)
68         echo "runtests [-checkonly] [-margs='...'] [-atend]"
69         echo "run tests in this directory.  If -checkonly set, just run"
70         echo "the differences check (do NO rerun the test programs)."
71         echo "If -margs is used, these options are passed to mpirun."
72         echo "If -small is used, the examples are built, run, and deleted."
73         echo "If -atend is used, the success of the tests is checked only"
74         echo "at the end of the test rather than also after each test."
75         exit 1
76         ;;
77         *)
78         if test -n "$arg" ; then
79             echo "Passing remaining arguments to programs ($*)"
80             break
81         fi
82         ;;
83     esac
84 done
85
86
87 # Load basic procedures
88 . ${srcdir}/../runbase
89
90 mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
91 # If the programs are not available, run make.
92 #if [ ! -x sendrecv -a $makeeach = 0 -a $runtests = 1 ] ; then
93 #    $MAKE default
94 #fi
95
96 testfiles=""
97 if [ $runtests = 1 ] ; then
98 echo '**** Testing MPI Profiling routines ****'
99 #just a test for  MPI_Pcontrol, which is not implemented
100 RunTest ptest 1 "**** Testing MPI_Pcontrol ****"
101
102 RunTest colluses 4 "**** Testing for PMPI in Allreduce ****"
103
104 else
105     # Just run checks
106     testfiles=`echo *.out`
107     if test "$testfiles" = "*.out" ; then
108         echo "No output files remain from previous test!"
109         exit 1
110     fi
111 fi
112 #
113 echo '*** Checking for differences from expected output ***'
114 CheckAllOutput profile.diff
115 exit 0
116
117
118