1 |
#!/bin/csh |
#!/bin/csh -f |
2 |
|
|
3 |
# Run this script from the verification directory |
# Run this script from the verification directory |
4 |
# It will automatically configure, compile, run and verify all experiments |
# It will automatically configure, compile, run and verify all experiments |
8 |
# This is the number of least-significant digits allows to be |
# This is the number of least-significant digits allows to be |
9 |
# in error before the test is classified as a "fail". |
# in error before the test is classified as a "fail". |
10 |
|
|
11 |
|
set on_error_die |
12 |
set passaccuracy=7 |
set passaccuracy=7 |
13 |
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " > summary.txt |
set SKIP=( ) |
14 |
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits experiment >> summary.txt |
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " " " > summary.txt |
15 |
|
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits Status Experiment >> summary.txt |
16 |
|
|
17 |
# Pass any arguments |
# Pass any arguments |
18 |
foreach arg ($argv) |
foreach arg ($argv) |
32 |
end |
end |
33 |
rm -f summary.txt |
rm -f summary.txt |
34 |
exit 0 |
exit 0 |
35 |
|
breaksw |
36 |
|
case -nodie: |
37 |
|
unset on_error_die |
38 |
|
breaksw |
39 |
|
case -skip=*: |
40 |
|
set SKIP = ( $SKIP `echo $arg | sed 's/-skip=//' | sed 's/,/ /g' `) |
41 |
|
breaksw |
42 |
default: |
default: |
43 |
echo Unknown argument given to $0 |
echo Unknown argument given to $0 |
44 |
exit 1 |
exit 1 |
47 |
|
|
48 |
foreach dr ([a-zA-Z01-9]*) |
foreach dr ([a-zA-Z01-9]*) |
49 |
if (! -d $dr/input ) continue |
if (! -d $dr/input ) continue |
50 |
|
foreach skip ($SKIP) |
51 |
|
if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue |
52 |
|
end |
53 |
set config=- |
set config=- |
54 |
set makedepend=- |
set makedepend=- |
55 |
set compile=- |
set compile=- |
56 |
set execute=- |
set execute=- |
57 |
set exactmatch=- |
set exactmatch=- |
58 |
set accuracy=- |
set accuracy=- |
59 |
|
set pass=FAIL |
60 |
echo ============================================================================== |
echo ============================================================================== |
61 |
echo Entering $dr |
echo Entering $dr |
62 |
cd $dr |
cd $dr |
67 |
set untested=($untested $dr) |
set untested=($untested $dr) |
68 |
else |
else |
69 |
set config=NO |
set config=NO |
|
set makedepend=NO |
|
|
set compile=NO |
|
|
set execute=NO |
|
|
set exactmatch=NO |
|
|
set accuracy=- |
|
70 |
cd input |
cd input |
71 |
echo -n " generating Makefile ..." |
echo -n " generating Makefile ..." |
72 |
../../../tools/genmake -mods=../code >&! make.log |
../../../tools/genmake -mods=../code >&! make.log |
73 |
if ($status == 0) set config=Yes |
if ($status == 0) set config=Yes |
74 |
|
set makedepend=NO |
75 |
echo " done." |
echo " done." |
76 |
echo -n " make depend ..." |
echo -n " make depend ..." |
77 |
make cleanlinks depend >>& make.log |
make cleanlinks depend >>& make.log |
82 |
if ($status) then |
if ($status) then |
83 |
echo " ***** An error occurred during make *****" |
echo " ***** An error occurred during make *****" |
84 |
cat make.log |
cat make.log |
85 |
exit 1 |
echo The error during compilation occured in \"$dr\" |
86 |
|
set compile=NO |
87 |
|
if ($?on_error_die) exit 1 |
88 |
else |
else |
89 |
set compile=Yes |
set compile=Yes |
90 |
|
set execute=NO |
91 |
endif |
endif |
92 |
echo " done." |
echo " done." |
93 |
echo -n " running model ..." |
echo -n " running model ..." |
94 |
./mitgcmuv | & grep "D iters" > output.txt |
if ($compile == 'Yes') then |
95 |
|
# ./mitgcmuv | & grep "D iters" > output.txt |
96 |
|
./mitgcmuv > & output.txt |
97 |
if ($status == 0) then |
if ($status == 0) then |
98 |
set execute=Yes |
set execute=Yes |
99 |
|
set exactmatch=NO |
100 |
|
set accuracy=- |
101 |
echo " done." |
echo " done." |
102 |
sed 's/.*D iters, err =//' output.txt \ |
grep "D iters" output.txt | sed 's/.*D iters, err =//' \ |
103 |
| grep " 0 " \ |
| grep " 0 " \ |
104 |
> high.txt |
> high.txt |
105 |
grep "D iters" ../results/output.txt \ |
grep "D iters" ../results/output.txt \ |
131 |
if ($?fail ) then |
if ($?fail ) then |
132 |
if (! $?fails) set fails |
if (! $?fails) set fails |
133 |
set fails=($fails $dr) |
set fails=($fails $dr) |
134 |
|
set pass=FAIL |
135 |
echo " ***** FAIL *****" |
echo " ***** FAIL *****" |
136 |
else |
else |
137 |
if (! $?passes) set passes |
if (! $?passes) set passes |
138 |
set passes=($passes $dr) |
set passes=($passes $dr) |
139 |
|
set pass=Pass |
140 |
echo "" |
echo "" |
141 |
echo " ***** PASS (grade $lvl) *****" |
echo " ***** PASS (grade $lvl) *****" |
142 |
endif |
endif |
143 |
set accuracy=$lvl |
set accuracy=$lvl |
144 |
else |
else |
145 |
set exactmatch=Yes |
set exactmatch=Yes |
146 |
|
set pass=Pass |
147 |
echo "" |
echo "" |
148 |
echo Model passed at highest accuracy. |
echo Model passed at highest accuracy. |
149 |
echo "" |
echo "" |
153 |
endif |
endif |
154 |
else |
else |
155 |
echo " error" |
echo " error" |
156 |
echo " ***** An error occured running the mode *****" |
echo " ***** An error occured running the model *****" |
157 |
tail output.txt |
tail output.txt |
158 |
exit 1 |
echo The runtime error occured in \"$dr\" |
159 |
|
if ($?on_error_die) exit 1 |
160 |
|
set pass=- |
161 |
|
endif |
162 |
|
rm -f high.txt oldhigh.txt low.txt oldlow.txt output.txt make.log |
163 |
endif |
endif |
164 |
cd .. |
cd .. |
165 |
endif |
endif |
166 |
echo "" |
echo "" |
167 |
cd .. |
cd .. |
168 |
# Pretty summary |
# Pretty summary |
169 |
printf ' %s\t %s\t %s\t %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $dr >> summary.txt |
printresults: |
170 |
|
printf ' %s\t %s\t %s\t %s\t %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $pass $dr >> summary.txt |
171 |
end |
end |
172 |
echo ============================================================================== |
echo ============================================================================== |
173 |
echo "" |
echo "" |