Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'v3_8_x'
[simgrid.git] / teshsuite / smpi / mpich-test / context / 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 MAKE="make --no-print-directory"
12
13 #
14 # Set mpirun to the name/path of the mpirun program
15 #FindMPIRUN
16 #
17 #
18 test_mpi2=1
19 runtests=1
20 quiet=0
21 makeeach=0
22 have_fortran=0
23 writesummaryfile=no
24 MAKE="make --no-print-directory"
25 for arg in "$@" ; do
26     case $arg in 
27     -basedir=* )
28         basedir=`echo $arg | sed 's/-basedir=//'`
29         ;; 
30     -srcdir=* )
31         srcdir=`echo $arg | sed 's/-srcdir=//'`
32         ;; 
33         -fort=* )
34         have_fortran=`echo $arg | sed 's/-fort=//'`
35         ;;
36         -checkonly )
37         runtests=0
38         ;;
39         -margs=*)
40         margs=`echo $arg | sed 's/-margs=//'`
41         args="$args $margs"
42         ;;
43         -summaryfile=*)
44         writesummaryfile=yes
45         summaryfile=`echo A$arg | sed 's/A-summaryfile=//'`
46         ;;
47         -small)
48         makeeach=1
49         ;;
50         -quiet)
51         shift
52         quiet=1
53         ;;
54         -help|-u)
55         echo "runtests [-checkonly] [-margs='...']"
56         echo "run tests in this directory.  If -checkonly set, just run"
57         echo "the differences check (do NO rerun the test programs)."
58         echo "If -margs is used, these options are passed to mpirun."
59         echo "If -small is used, the examples are built, run, and deleted."
60         exit 1
61         ;;
62         *)
63         if test -n "$arg" ; then
64             echo "runtests: Unknown argument ($arg)"
65             exit 1
66         fi
67         ;;
68     esac
69 done
70
71 #
72 # Load basic procedures
73 . ${srcdir}/../runbase
74
75 # If the programs are not available, run make.
76 if [ ! -x attrerr -a $makeeach = 0 -a $runtests = 1 ] ; then
77     $MAKE
78 fi
79 mpirun=" ${basedir}/bin/smpirun -platform ${srcdir}/../../../../examples/msg/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile  --log=root.thres:critical"
80 testfiles=""
81 if [ $runtests = 1 ] ; then
82
83 #
84 # Run Fortran tests ONLY if Fortran available
85 if [ 0 = 1 ] ; then 
86     RunTest attrtest 2 "*** Testing attributes from Fortran ***"
87
88     if [ $test_mpi2 = 1 ] ; then
89        RunTest commnamesf 1 "*** Testing Communicator Names from Fortran ***"
90     fi
91 fi
92 #uses attr, not implemented
93 #RunTest attrt 2 "*** Testing attributes ***"
94 #fails, uses MPI_Attr_get, et MPI_Attr_put
95 #RunTest attrerr 1 "*** Testing attributes (2) ***"
96
97 #TODO : fails with unions, excludes or intersections, need debug in smpi to work
98 #RunTest grouptest_mpich 4 "*** Testing Groups ***"
99
100 RunTest groupcreate 4 "*** Testing Group creation ***"
101
102 #uses MPI_Intercomm_create
103 #RunTest ictest 4 "*** Testing Intercommunicators ***"
104
105 RunTest icdup 3 "*** Testing dup of an intercommunicator ***"
106
107 #
108 # ictest2 relies on a inconsistency in the standard, to wit, that the
109 # leader in both groups can be the same process.  This seems to be
110 # essential in a dynamic setting, since the only process both groups can
111 # access may be the single parent process (other than using client/server
112 # intercommunicator creating routines, with the parent providing the common
113 # information).
114 #
115 #testfiles="$testfiles ictest2.out"
116 #rm -f ictest2.out
117 #MakeExe ictest2
118 #echo '*** Testing Intercommunicators (2) ***'
119 #echo '*** Testing Intercommunicators (2) ***' >> ictest2.out
120 #$mpirun $args -np 4 ictest2 $* >> ictest2.out 2>&1
121 #echo '*** Testing Intercommunicators (2) ***' >> ictest2.out
122 #CleanExe ictest2
123 #uses MPI_Comm_test_inter and MPI_Intercomm_create
124 #RunTest ictest3 4 "*** Testing Intercommunicators (3) ***"
125
126 #if [ $have_fortran -eq "1" ]  ; then
127 #    RunTest commnamesf 2 "*** Testing Communicator Names ***"
128 #fi
129 #else
130     # Just run checks
131 #    testfiles=`echo *.out`
132 fi
133
134 echo '*** Checking for differences from expected output ***'
135 CheckAllOutput context.diff
136 exit 0