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 |
set on_error_die |
12 |
set passaccuracy=7 |
set digitsOfAccuracy=8 |
13 |
set SKIP=( ) |
set SKIP=( ) |
14 |
printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " " " > 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 |
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 |
49 |
unlimit |
unlimit |
50 |
|
|
51 |
foreach dr ([a-zA-Z01-9]*) |
foreach dr ([a-zA-Z01-9]*) |
52 |
|
|
53 |
if (! -d $dr/input ) continue |
if (! -d $dr/input ) continue |
54 |
foreach skip ($SKIP) |
foreach skip ($SKIP) |
55 |
if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue |
if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue |
96 |
echo " done." |
echo " done." |
97 |
echo -n " running model ..." |
echo -n " running model ..." |
98 |
if ($compile == 'Yes') then |
if ($compile == 'Yes') then |
|
# ./mitgcmuv | & grep "D iters" > output.txt |
|
99 |
./mitgcmuv > & output.txt |
./mitgcmuv > & output.txt |
100 |
if ($status == 0) then |
if ($status == 0) then |
101 |
set execute=Yes |
set execute=Yes |
102 |
set exactmatch=NO |
set exactmatch=NO |
103 |
set accuracy=- |
set accuracy=- |
104 |
echo " done." |
echo " done." |
105 |
grep "D iters" output.txt | sed 's/.*D iters, err =//' \ |
|
106 |
| grep " 0 " \ |
# Compare output based on cg2d residual |
107 |
> high.txt |
grep "cg2d_init_res" output.txt | sed 's/.*=//' | nl > high.txt |
108 |
grep "D iters" ../results/output.txt \ |
grep "cg2d_init_res" ../results/output.txt | sed 's/.*=//' | nl > oldhigh.txt |
109 |
| sed 's/.*D iters, err =//' \ |
join high.txt oldhigh.txt > low.txt |
110 |
| grep " 0 " \ |
set nlines=`wc -l low.txt | awk '{print $1}'` |
111 |
> oldhigh.txt |
echo " comparing $nlines lines of output" |
112 |
diff oldhigh.txt high.txt > /dev/null |
@ line = 1 |
113 |
if ($status) then |
set bestacc=99; |
114 |
echo " output differs:" |
set worstline='Exact match' |
115 |
diff oldhigh.txt high.txt |
while ($line <= $nlines) |
116 |
echo "" |
set vals=(`grep "^$line" low.txt | awk '{print $2,$3}'`) |
117 |
@ lvl=0 |
@ line += 1 |
118 |
set accuracy='.' |
unset acc |
119 |
set fail |
foreach dp (14 13 12 11 10 9 8 7 6 5 4 3 2 1 0) |
120 |
echo -n Trying reduced accuracy |
set cmp=(`printf '%23.'$dp'e %23.'$dp'e\n' $vals[1] $vals[2]`) |
121 |
while ($lvl <= $passaccuracy) |
if ($cmp[1] =~ $cmp[2]) then |
122 |
@ lvl+=1 |
if (! $?acc) then |
123 |
echo -n " " $lvl |
set acc=$dp |
124 |
sed s/{$accuracy}E/E/ high.txt > low.txt |
break |
125 |
sed s/{$accuracy}E/E/ oldhigh.txt > oldlow.txt |
endif |
|
diff oldlow.txt low.txt > /dev/null |
|
|
if ($status == 0) then |
|
|
unset fail |
|
|
break |
|
|
endif |
|
|
set accuracy=`echo $accuracy | sed 's/\./../'` |
|
|
end |
|
|
echo "" |
|
|
if ($?fail ) then |
|
|
if (! $?fails) set fails |
|
|
set fails=($fails $dr) |
|
|
set pass=FAIL |
|
|
echo " ***** FAIL *****" |
|
|
else |
|
|
if (! $?passes) set passes |
|
|
set passes=($passes $dr) |
|
|
set pass=Pass |
|
|
echo "" |
|
|
echo " ***** PASS (grade $lvl) *****" |
|
126 |
endif |
endif |
127 |
set accuracy=$lvl |
end |
128 |
|
if (! $?acc) set acc=0 |
129 |
|
if ($acc < $bestacc) then |
130 |
|
set worstline=($line $vals[1] $vals[2] `printf '%23.'$acc'e' $vals[1]` $acc) |
131 |
|
set bestacc=$acc |
132 |
|
endif |
133 |
|
# echo $line $vals[1] $vals[2] `printf '%23.'$acc'e' $vals[1]` $acc |
134 |
|
end |
135 |
|
if ($nlines == 0) then |
136 |
|
set bestacc=0 |
137 |
|
set worstline="Could find no lines in output.txt to compare" |
138 |
|
endif |
139 |
|
if ($bestacc == 14 & $?exactmatch) then |
140 |
|
set exactmatch=Yes |
141 |
|
echo " " |
142 |
|
echo " ***** EXACT MATCH *****" |
143 |
|
endif |
144 |
|
if ($bestacc > $digitsOfAccuracy) then |
145 |
|
set pass=Pass |
146 |
|
echo " " |
147 |
|
echo " ***** PASS (digits=$bestacc) *****" |
148 |
|
echo " " |
149 |
|
echo " worstline: " $worstline |
150 |
else |
else |
151 |
set exactmatch=Yes |
echo " " |
152 |
set pass=Pass |
echo " ***** FAIL (digits=$bestacc) *****" |
153 |
echo "" |
echo " " |
154 |
echo Model passed at highest accuracy. |
echo " worstline: " $worstline |
|
echo "" |
|
|
echo " ***** PASS *****" |
|
|
if (! $?passes) set passes |
|
|
set passes=($passes $dr) |
|
155 |
endif |
endif |
156 |
|
set accuracy=$bestacc |
157 |
else |
else |
158 |
echo " error" |
echo " error" |
159 |
echo " ***** An error occured running the model *****" |
echo " ***** An error occured running the model *****" |