forked from jmrosinski/GPTL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runalltests.csh.jet
executable file
·67 lines (57 loc) · 2.83 KB
/
runalltests.csh.jet
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
#!/bin/csh -f
# Test the GPTL library by permuting the default values of as many user-settable
# parameters as possible. The list defined by the "foreach" loop below will
# need to be culled of all tests which truly can't be changed. For example if
# PAPI is unavailable, delete HAVE_PAPI from the list because this script will
# try to run a PAPI test where HAVE_PAPI is permuted from "no" to "yes", and
# the test will fail.
set basescript = jrmacros/macros.make.jet # This is the base script to start from
set make = make # Name of gnu make program
echo "$0 Testing $basescript..."
echo "$basescript settings:"
foreach setting (DEBUG OPENMP PTHREADS FORTRAN HAVE_PAPI HAVE_MPI TEST_AUTOPROFILE \
ENABLE_PMPI HAVE_IARGCGETARG )
echo `grep "^ *$setting *= " $basescript`
end
cp $basescript macros.make || echo "Failure to cp $basescript to macros.make" && exit 1
$make clean; $make || echo "Failure in $make" && exit 1
$make test || echo "Failure in $make test" && exit 1
echo "$0 $basescript worked" >! results
# Will need to delete from user settable list all items which truly aren't available
#foreach usersettable ( DEBUG OPENMP PTHREADS FORTRAN HAVE_PAPI HAVE_MPI TEST_AUTOPROFILE \
# ENABLE_PMPI HAVE_IARGCGETARG )
foreach usersettable ( DEBUG OPENMP PTHREADS FORTRAN HAVE_PAPI HAVE_MPI TEST_AUTOPROFILE \
ENABLE_PMPI )
grep "^ *$usersettable *= *yes *" $basescript
set ret = $status
# Determine whether to toggle from no to yes, or yes to no
if ($ret == 0) then
set oldtest = yes
set newtest = no
else
set oldtest = no
set newtest = yes
endif
echo "$0 Testing $usersettable = $newtest ..."
echo "$0 Testing $usersettable = $newtest ..." >> results
# For PTHREADS case, ensure OPENMP is no
if ( $usersettable == PTHREADS ) then
sed -e "s/^ *OPENMP *= *yes */OPENMP = no/g" \
-e "s/^ *$usersettable *= *$oldtest */$usersettable = $newtest/g" $basescript >! macros.make
# For HAVE_IARGCGETARG case, ensure HAVE_MPI and ENABLE_PMPI are true
else if ( $usersettable == HAVE_IARGCGETARG ) then
sed -e "s/^ *HAVE_MPI *= *no */HAVE_MPI = yes/g" \
-e "s/^ *ENABLE_PMPI *= *no */ENABLE_PMPI = yes/g" \
-e "s/^ *$usersettable *= *$oldtest */$usersettable = $newtest/g" $basescript >! macros.make
# For ENABLE_PMPI case, ensure HAVE_MPI is true
else if ( $usersettable == ENABLE_PMPI ) then
sed -e "s/^ *HAVE_MPI *= *no */HAVE_MPI = yes/g" \
-e "s/^ *$usersettable *= *$oldtest */$usersettable = $newtest/g" $basescript >! macros.make
else
sed -e "s/^ *$usersettable *= *$oldtest */$usersettable = $newtest/g" $basescript >! macros.make
endif
$make clean; $make || echo "Failure in $make" && exit 1
$make test || echo "Failure in $make test" && exit 1
echo "$usersettable = $newtest worked" >> results
end
echo "Permuting all user settable tests passed" && exit 0