13 |
echo " (-optfile=|-of=)STRING list of genmake2 \"optfiles\"" |
echo " (-optfile=|-of=)STRING list of genmake2 \"optfiles\"" |
14 |
echo " (-a|-addr)STRING list of email recipients" |
echo " (-a|-addr)STRING list of email recipients" |
15 |
echo " (-t|-tdir)STRING list of \"test\" dirs" |
echo " (-t|-tdir)STRING list of \"test\" dirs" |
16 |
|
echo " (-b|-bash)STRING the \"bash\" executable" |
17 |
|
echo " (-m|-make)STRING the \"make\" executable" |
18 |
echo |
echo |
19 |
exit 1 |
exit 1 |
20 |
} |
} |
31 |
exit 1 |
exit 1 |
32 |
fi |
fi |
33 |
echo -n "building mpack... " |
echo -n "building mpack... " |
34 |
( cd $MPACKDIR && ./configure && make ) > build_mpack.out 2>&1 |
( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1 |
35 |
RETVAL=$? |
RETVAL=$? |
36 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
37 |
echo |
echo |
162 |
genmakemodel() |
genmakemodel() |
163 |
{ |
{ |
164 |
# genmakemodel directory |
# genmakemodel directory |
165 |
GENMAKE2="../../../tools/genmake2" |
GENMAKE2="$BASH ../../../tools/genmake2" |
166 |
( |
( |
167 |
cd $1; |
cd $1; |
168 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
169 |
# ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
# ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 |
170 |
$GENMAKE2 -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 |
$GENMAKE2 -make $MAKE -ds --mods=../code "--optfile="$OPTFILE > make.log 2>&1 |
171 |
RETVAL=$? |
RETVAL=$? |
172 |
for i in gm_state gm_optfile gm_local Makefile ; do |
for i in gm_state gm_optfile gm_local Makefile ; do |
173 |
if test -r $i ; then |
if test -r $i ; then |
193 |
rm -f output.txt |
rm -f output.txt |
194 |
printf 'make CLEAN ... ' 2>&1 |
printf 'make CLEAN ... ' 2>&1 |
195 |
if test -r Makefile ; then |
if test -r Makefile ; then |
196 |
make CLEAN >> make.log 2>&1 |
$MAKE CLEAN >> make.log 2>&1 |
197 |
RETVAL=$? |
RETVAL=$? |
198 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
199 |
tail make.log |
tail make.log |
213 |
( |
( |
214 |
cd $1; |
cd $1; |
215 |
printf 'make depend ... ' 1>&2 |
printf 'make depend ... ' 1>&2 |
216 |
make depend >> make.log 2>&1 |
$MAKE depend >> make.log 2>&1 |
217 |
RETVAL=$? |
RETVAL=$? |
218 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
219 |
tail make.log |
tail make.log |
233 |
cd $1; |
cd $1; |
234 |
if test -r Makefile ; then |
if test -r Makefile ; then |
235 |
printf 'make ... ' 1>&2 |
printf 'make ... ' 1>&2 |
236 |
make >> make.log 2>&1 |
$MAKE >> make.log 2>&1 |
237 |
RETVAL=$? |
RETVAL=$? |
238 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
239 |
tail make.log |
tail make.log |
269 |
rm -f output.txt |
rm -f output.txt |
270 |
fi |
fi |
271 |
printf 'runmodel: ' 1>&2 |
printf 'runmodel: ' 1>&2 |
272 |
make output.txt |
$MAKE output.txt |
273 |
RETVAL=$? |
RETVAL=$? |
274 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
275 |
cp output.txt $CDIR"/output.txt" |
cp output.txt $CDIR"/output.txt" |
317 |
return 0 |
return 0 |
318 |
else |
else |
319 |
echo |
echo |
320 |
echo "createcodelet: failed to compile codelet" | tee |
echo "createcodelet: failed to compile codelet" |
321 |
exit 1 |
exit 1 |
322 |
fi |
fi |
323 |
} |
} |
390 |
ieee=1 |
ieee=1 |
391 |
expts='' |
expts='' |
392 |
|
|
393 |
|
BASH= |
394 |
OPTFILES= |
OPTFILES= |
395 |
ADDRESSES=edhill@mitgcm.org |
ADDRESSES=edhill@mitgcm.org |
396 |
TESTDIRS= |
TESTDIRS= |
397 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
398 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
399 |
|
MAKE=make |
400 |
|
|
401 |
echo -n "parsing options... " |
echo -n "parsing options... " |
402 |
|
|
417 |
-help | --help | -h | --h) |
-help | --help | -h | --h) |
418 |
usage ;; |
usage ;; |
419 |
|
|
420 |
-optfile | --optfile | -f | --f) |
-optfile | --optfile | -of | --of) |
421 |
ac_prev=OPTFILES ;; |
ac_prev=OPTFILES ;; |
422 |
-optfile=* | --optfile=*) |
-optfile=* | --optfile=* | -of=* | --of=*) |
423 |
OPTFILES=$ac_optarg ;; |
OPTFILES=$ac_optarg ;; |
424 |
|
|
425 |
-addr | --addr | -a | --a) |
-addr | --addr | -a | --a) |
432 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=*) |
433 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
434 |
|
|
435 |
|
-bash | --bash | -b | --b) |
436 |
|
ac_prev=BASH ;; |
437 |
|
-bash=* | --bash=*) |
438 |
|
BASH=$ac_optarg ;; |
439 |
|
|
440 |
|
-make | --make | -m | --m) |
441 |
|
ac_prev=MAKE ;; |
442 |
|
-make=* | --make=*) |
443 |
|
MAKE=$ac_optarg ;; |
444 |
|
|
445 |
-quick) quick=1 ;; |
-quick) quick=1 ;; |
446 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
447 |
-debug) debug=1 ;; |
-debug) debug=1 ;; |
477 |
|
|
478 |
# Create a uniquely named directory to store results |
# Create a uniquely named directory to store results |
479 |
MACH=`hostname` |
MACH=`hostname` |
480 |
|
UNAMEA=`uname -a` |
481 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
482 |
BASE=$MACH"_"$DATE"_" |
BASE=$MACH"_"$DATE"_" |
483 |
DNUM=0 |
DNUM=0 |
519 |
|
|
520 |
# ...and each test directory... |
# ...and each test directory... |
521 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
522 |
|
|
523 |
|
# Verify that the testdir exists and contains previous |
524 |
|
# results in the correct location--or skip this directory! |
525 |
|
if test ! -r $dir"/results/output.txt" ; then |
526 |
|
echo | tee -a $SUMMARY |
527 |
|
echo "can't read \"$dir/results/output.txt\" -- skipping $dir" \ |
528 |
|
| tee -a $SUMMARY |
529 |
|
continue |
530 |
|
fi |
531 |
|
|
532 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir for each OPTFILE/tdir combination |
533 |
CDIR=$DRESULTS"/"$NDIR |
CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR |
534 |
mkdir $CDIR |
mkdir $CDIR |
535 |
CDIR=`pwd`"/$CDIR" |
CDIR=`pwd`"/$CDIR" |
536 |
|
|
552 |
builddir=input |
builddir=input |
553 |
rundir=input |
rundir=input |
554 |
fi |
fi |
555 |
|
|
556 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
557 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
558 |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
&& makedependmodel $dir/$builddir && makedepend=Y \ |
561 |
&& runmodel $dir/$builddir mitgcmuv && run=Y \ |
&& runmodel $dir/$builddir mitgcmuv && run=Y \ |
562 |
&& results=`testoutput $dir $rundir` |
&& results=`testoutput $dir $rundir` |
563 |
echo |
echo |
564 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
565 |
|
${run:-N} $results |
566 |
echo |
echo |
567 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> $SUMMARY |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
568 |
|
${run:-N} $results >> $SUMMARY |
569 |
( cd $DRESULTS"/"$NDIR ; gzip * ) |
echo "fresults='" > $CDIR"/summary.txt" |
570 |
|
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
571 |
|
${run:-N} $results >> $CDIR"/summary.txt" |
572 |
|
echo "'" >> $CDIR"/summary.txt" |
573 |
|
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
574 |
|
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
575 |
|
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
576 |
|
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
577 |
|
|
578 |
|
( |
579 |
|
cd $DRESULTS |
580 |
|
tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1 |
581 |
|
gzip $NDIR".tar" |
582 |
|
) |
583 |
|
|
584 |
tar -cf $DRESULTS"/"$NDIR".tar" $DRESULTS"/"$NDIR |
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES |
585 |
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar" $ADDRESSES |
RETVAL=$? |
586 |
|
if test "x$RETVAL" != x0 ; then |
587 |
|
echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>" |
588 |
|
else |
589 |
|
rm -f $DRESULTS"/"$NDIR".tar*" |
590 |
|
fi |
591 |
|
|
592 |
NDIR=$(( $NDIR + 1 )) |
NDIR=$(( $NDIR + 1 )) |
593 |
|
|
594 |
done |
done |
595 |
done |
done |
596 |
|
|
597 |
# rm tmp_cmpnum.f a.out |
rm tmp_cmpnum.f a.out |
598 |
|
|
|
echo ------------------------------------------------------------------------------- |
|
|
echo |
|
|
echo >> $SUMMARY |
|
|
date >> $SUMMARY |
|
599 |
cat $SUMMARY |
cat $SUMMARY |
600 |
|
|
|
# tar -cf $DRESULTS".tar" $DRESULTS |
|
|
# |
|
|
# $MPACK -s MITgcm-test -m 1000000 $DRESULTS".tar" $ADDRESSES |
|
|
|
|