82 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
echo testoutput: cg2dres=$cg2dres 1>&2 |
83 |
fi |
fi |
84 |
|
|
85 |
if [ $testmore -gt 0 ]; then |
if [ $longtest -gt 0 ]; then |
86 |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$? |
testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$? |
87 |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$? |
testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$? |
88 |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean"; tmean=$? |
testoutput_for_prop $1 "dynstat_theta_mean" "theta mean"; tmean=$? |
122 |
( cd $1; |
( cd $1; |
123 |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
if [ $quick -eq 0 -o ! -r Makefile ]; then |
124 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
125 |
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
if [ $ieee -eq 0 ]; then |
126 |
|
../../../tools/genmake -mods=../code > make.log 2>&1 |
127 |
|
else |
128 |
|
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
129 |
|
fi |
130 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
131 |
tail make.log |
tail make.log |
132 |
echo makemodel: genmake failed 1>&2 |
echo genmakemodel: genmake failed 1>&2 |
133 |
return 1 |
return 1 |
134 |
else |
else |
135 |
echo succesful 1>&2 |
echo succesful 1>&2 |
138 |
) |
) |
139 |
} |
} |
140 |
|
|
141 |
|
makeclean() |
142 |
|
{ |
143 |
|
# makedependmodel directory |
144 |
|
( cd $1; |
145 |
|
if [ $clean -gt 0 ]; then |
146 |
|
rm -f output.txt |
147 |
|
printf 'make clean ... ' 2>&1 |
148 |
|
make CLEAN >> make.log 2>&1 |
149 |
|
if [ $? -ne 0 ]; then |
150 |
|
tail make.log |
151 |
|
echo makeclean: make clean failed 1>&2 |
152 |
|
return 1 |
153 |
|
else |
154 |
|
echo succesful 1>&2 |
155 |
|
fi |
156 |
|
fi |
157 |
|
) |
158 |
|
} |
159 |
|
|
160 |
makedependmodel() |
makedependmodel() |
161 |
{ |
{ |
162 |
# makedependmodel directory |
# makedependmodel directory |
204 |
if [ -x $2 ]; then |
if [ -x $2 ]; then |
205 |
if [ ! -r output.txt -o $quick -eq 0 ]; then |
if [ ! -r output.txt -o $quick -eq 0 ]; then |
206 |
echo runmodel: running... 1>&2 |
echo runmodel: running... 1>&2 |
207 |
|
rm -f output.txt |
208 |
( ./$2 > output.txt 2>&1 ) && return 0 |
( ./$2 > output.txt 2>&1 ) && return 0 |
209 |
return 1 |
return 1 |
210 |
else |
else |
285 |
-quick Skip "genmake" and "make depend" if the Makefile exists |
-quick Skip "genmake" and "make depend" if the Makefile exists |
286 |
-quiet Reduce the amount of output |
-quiet Reduce the amount of output |
287 |
-verbose Produce copious amounts of output |
-verbose Produce copious amounts of output |
288 |
|
-debug Produce even more output which will mean nothing to most |
289 |
|
-clean Do "make CLEAN" before compiling. This forces a complete rebuild. |
290 |
|
-longtest Compare numeric output for mean and s.d. of variables. |
291 |
|
-noieee By default, $0 uses the -ieee option for genmake. This turns it off. |
292 |
|
|
293 |
Normal usage: |
Normal usage: |
294 |
$0 * Configure, compile, run and analyze in all experiment directories |
$0 * Configure, compile, run and analyze in all experiment directories |
295 |
EOF |
EOF |
296 |
} |
} |
297 |
|
|
298 |
|
scandirs() |
299 |
|
{ |
300 |
|
if [ $# -eq 0 ]; then |
301 |
|
for arg in * |
302 |
|
do |
303 |
|
test -d $arg/input && echo $arg |
304 |
|
done |
305 |
|
else |
306 |
|
echo $* |
307 |
|
fi |
308 |
|
} |
309 |
|
|
310 |
############################################################################### |
############################################################################### |
311 |
|
|
312 |
# Main function |
# Main function |
315 |
debug=0 |
debug=0 |
316 |
verbose=1 |
verbose=1 |
317 |
quick=0 |
quick=0 |
318 |
testmore=0 |
clean=0 |
319 |
|
ieee=1 |
320 |
|
longtest=0 |
321 |
expts='' |
expts='' |
322 |
|
|
323 |
# Process arguments |
# Process arguments |
327 |
-quick) quick=1;; |
-quick) quick=1;; |
328 |
-verbose) verbose=2;; |
-verbose) verbose=2;; |
329 |
-debug) debug=1;; |
-debug) debug=1;; |
330 |
-testmore) testmore=1;; |
-clean) clean=1;; |
331 |
|
-noieee) ieee=0;; |
332 |
|
-longtest) longtest=1;; |
333 |
-quiet) verbose=0;; |
-quiet) verbose=0;; |
334 |
-help) show_help; exit 0;; |
-help) show_help; exit 0;; |
335 |
|
-*) echo Unrecognized option:$arg; exit 9;; |
336 |
*) test -d $arg && expts=`echo $expts $arg`;; |
*) test -d $arg && expts=`echo $expts $arg`;; |
337 |
esac |
esac |
338 |
done |
done |
339 |
|
|
340 |
if [ ${#expts} -eq 0 ]; then |
if [ $clean -gt 0 -a $quick -gt 0 ]; then |
341 |
echo Scanning all directories |
echo You specified -quick and -clean together which conflict. |
342 |
for arg in * |
echo Please specify either -quick or -clean or neither but not both. |
343 |
do |
exit 1 |
|
test -d $arg && expts=`echo $expts $arg` |
|
|
done |
|
344 |
fi |
fi |
345 |
|
|
346 |
|
#if [ ${#expts} -eq 0 ]; then |
347 |
|
# echo Scanning all directories |
348 |
|
# for arg in * |
349 |
|
# do |
350 |
|
# test -d $arg && expts=`echo $expts $arg` |
351 |
|
# done |
352 |
|
#fi |
353 |
|
expts=`scandirs $expts` |
354 |
|
|
355 |
createcodelet |
createcodelet |
356 |
|
|
357 |
if [ $testmore -gt 0 ]; then |
if [ $longtest -gt 0 ]; then |
358 |
cat << EOF > summary.txt |
cat << EOF > summary.txt |
359 |
T S U V |
T S U V |
360 |
C D M c m s m s m s m s |
C D M c m s m s m s m s |
383 |
echo Experiment: $dir |
echo Experiment: $dir |
384 |
echo |
echo |
385 |
unset genmake makedepend make run |
unset genmake makedepend make run |
386 |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
if [ $longtest -gt 0 ]; then |
387 |
results='-- -- -- -- -- -- -- -- --' |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
388 |
|
else |
389 |
|
results='-- -- -- -- -- -- -- -- --' |
390 |
|
fi |
391 |
genmakemodel $dir/input && genmake=Y \ |
genmakemodel $dir/input && genmake=Y \ |
392 |
|
&& makeclean $dir/input \ |
393 |
&& makedependmodel $dir/input && makedepend=Y \ |
&& makedependmodel $dir/input && makedepend=Y \ |
394 |
&& makemodel $dir/input && make=Y \ |
&& makemodel $dir/input && make=Y \ |
395 |
&& runmodel $dir/input mitgcmuv && run=Y \ |
&& runmodel $dir/input mitgcmuv && run=Y \ |