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=$? |
125 |
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
126 |
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
127 |
tail make.log |
tail make.log |
128 |
echo makemodel: genmake failed 1>&2 |
echo genmakemodel: genmake failed 1>&2 |
129 |
return 1 |
return 1 |
130 |
else |
else |
131 |
echo succesful 1>&2 |
echo succesful 1>&2 |
134 |
) |
) |
135 |
} |
} |
136 |
|
|
137 |
|
makeclean() |
138 |
|
{ |
139 |
|
# makedependmodel directory |
140 |
|
( cd $1; |
141 |
|
if [ $clean -gt 0 ]; then |
142 |
|
printf 'make clean ... ' 2>&1 |
143 |
|
make CLEAN >> make.log 2>&1 |
144 |
|
if [ $? -ne 0 ]; then |
145 |
|
tail make.log |
146 |
|
echo makeclean: make clean failed 1>&2 |
147 |
|
return 1 |
148 |
|
else |
149 |
|
echo succesful 1>&2 |
150 |
|
fi |
151 |
|
fi |
152 |
|
) |
153 |
|
} |
154 |
|
|
155 |
makedependmodel() |
makedependmodel() |
156 |
{ |
{ |
157 |
# makedependmodel directory |
# makedependmodel directory |
279 |
-quick Skip "genmake" and "make depend" if the Makefile exists |
-quick Skip "genmake" and "make depend" if the Makefile exists |
280 |
-quiet Reduce the amount of output |
-quiet Reduce the amount of output |
281 |
-verbose Produce copious amounts of output |
-verbose Produce copious amounts of output |
282 |
|
-debug Produce even more output which will mean nothing to most |
283 |
|
-clean Do "make CLEAN" before compiling. This forces a complete rebuild. |
284 |
|
-longtest Compare numeric output for mean and s.d. of variables. |
285 |
|
|
286 |
Normal usage: |
Normal usage: |
287 |
$0 * Configure, compile, run and analyze in all experiment directories |
$0 * Configure, compile, run and analyze in all experiment directories |
288 |
EOF |
EOF |
289 |
} |
} |
290 |
|
|
291 |
|
scandirs() |
292 |
|
{ |
293 |
|
if [ $# -eq 0 ]; then |
294 |
|
for arg in * |
295 |
|
do |
296 |
|
test -d $arg/input && echo $arg |
297 |
|
done |
298 |
|
else |
299 |
|
echo $* |
300 |
|
fi |
301 |
|
} |
302 |
|
|
303 |
############################################################################### |
############################################################################### |
304 |
|
|
305 |
# Main function |
# Main function |
308 |
debug=0 |
debug=0 |
309 |
verbose=1 |
verbose=1 |
310 |
quick=0 |
quick=0 |
311 |
testmore=0 |
clean=0 |
312 |
|
longtest=0 |
313 |
expts='' |
expts='' |
314 |
|
|
315 |
# Process arguments |
# Process arguments |
319 |
-quick) quick=1;; |
-quick) quick=1;; |
320 |
-verbose) verbose=2;; |
-verbose) verbose=2;; |
321 |
-debug) debug=1;; |
-debug) debug=1;; |
322 |
-testmore) testmore=1;; |
-clean) clean=1;; |
323 |
|
-longtest) longtest=1;; |
324 |
-quiet) verbose=0;; |
-quiet) verbose=0;; |
325 |
-help) show_help; exit 0;; |
-help) show_help; exit 0;; |
326 |
*) test -d $arg && expts=`echo $expts $arg`;; |
*) test -d $arg && expts=`echo $expts $arg`;; |
327 |
esac |
esac |
328 |
done |
done |
329 |
|
|
330 |
if [ ${#expts} -eq 0 ]; then |
#if [ ${#expts} -eq 0 ]; then |
331 |
echo Scanning all directories |
# echo Scanning all directories |
332 |
for arg in * |
# for arg in * |
333 |
do |
# do |
334 |
test -d $arg && expts=`echo $expts $arg` |
# test -d $arg && expts=`echo $expts $arg` |
335 |
done |
# done |
336 |
fi |
#fi |
337 |
|
expts=`scandirs $expts` |
338 |
|
|
339 |
createcodelet |
createcodelet |
340 |
|
|
341 |
if [ $testmore -gt 0 ]; then |
if [ $longtest -gt 0 ]; then |
342 |
cat << EOF > summary.txt |
cat << EOF > summary.txt |
343 |
T S U V |
T S U V |
344 |
C D M c m s m s m s m s |
C D M c m s m s m s m s |
367 |
echo Experiment: $dir |
echo Experiment: $dir |
368 |
echo |
echo |
369 |
unset genmake makedepend make run |
unset genmake makedepend make run |
370 |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
if [ $longtest -gt 0 ]; then |
371 |
results='-- -- -- -- -- -- -- -- --' |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
372 |
|
else |
373 |
|
results='-- -- -- -- -- -- -- -- --' |
374 |
|
fi |
375 |
genmakemodel $dir/input && genmake=Y \ |
genmakemodel $dir/input && genmake=Y \ |
376 |
|
&& makeclean $dir/input \ |
377 |
&& makedependmodel $dir/input && makedepend=Y \ |
&& makedependmodel $dir/input && makedepend=Y \ |
378 |
&& makemodel $dir/input && make=Y \ |
&& makemodel $dir/input && make=Y \ |
379 |
&& runmodel $dir/input mitgcmuv && run=Y \ |
&& runmodel $dir/input mitgcmuv && run=Y \ |