33 |
echo " (-adm|-ad) perform an adjoint run" |
echo " (-adm|-ad) perform an adjoint run" |
34 |
echo " (-oad) perform an OpenAD adjoint run" |
echo " (-oad) perform an OpenAD adjoint run" |
35 |
echo " (-command|-c) STRING command to run" |
echo " (-command|-c) STRING command to run" |
36 |
|
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
37 |
echo " (-make|-m) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
38 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
39 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
41 |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
42 |
echo " (DEF=\"1 2 3 4 5\")" |
echo " (DEF=\"1 2 3 4 5\")" |
43 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
44 |
echo " (DEF=\"12\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
45 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
46 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
47 |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
318 |
( |
( |
319 |
cd $1; |
cd $1; |
320 |
command="$GENMAKE2 -ds -m $MAKE" |
command="$GENMAKE2 -ds -m $MAKE" |
321 |
|
if test "x$MKDEPEND" != x ; then |
322 |
|
command="$command -makedepend=$MKDEPEND" |
323 |
|
fi |
324 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
325 |
command="$command --mods=../code_ad" |
command="$command --mods=../code_ad" |
326 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
358 |
fi |
fi |
359 |
fi |
fi |
360 |
printf 'genmake ... ' |
printf 'genmake ... ' |
361 |
eval $command > make.log 2>&1 |
eval $command > genmake.log 2>&1 |
362 |
RETVAL=$? |
RETVAL=$? |
363 |
# Reduce the size of the testing emails! |
# Reduce the size of the testing emails! |
364 |
head -100 Makefile > $CDIR/Makefile_head |
head -100 Makefile > $CDIR/Makefile_head |
365 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
366 |
tail make.log |
tail genmake.log |
367 |
echo "genmakemodel: genmake failed" |
echo "genmakemodel: genmake failed" |
368 |
cp genmake_* make.log $CDIR |
cp genmake_* genmake.log $CDIR |
369 |
return 1 |
return 1 |
370 |
else |
else |
371 |
echo "successful" |
echo "successful" |
377 |
makeclean() |
makeclean() |
378 |
{ |
{ |
379 |
# makeclean directory |
# makeclean directory |
380 |
|
if test "x$NODEPEND" = xf ; then rm -f $1/make.log ; fi |
381 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
382 |
echo "make Clean skipped!" |
echo "make Clean skipped!" |
383 |
else |
else |
386 |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
387 |
if test -r Makefile ; then |
if test -r Makefile ; then |
388 |
printf 'clean build-dir: make Clean ... ' |
printf 'clean build-dir: make Clean ... ' |
389 |
|
rm -f Makefile.old |
390 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.log 2>&1 |
391 |
RETVAL=$? |
RETVAL=$? |
392 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
418 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
419 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
420 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
421 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime |
422 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
423 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
424 |
echo successful |
echo successful |
835 |
HAVE_MPACK= |
HAVE_MPACK= |
836 |
MPACK= |
MPACK= |
837 |
COMMAND= |
COMMAND= |
838 |
|
MKDEPEND= |
839 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
840 |
MAKE=make |
MAKE=make |
841 |
fi |
fi |
910 |
-command=* | --command=* | -c=* | --c=*) |
-command=* | --command=* | -c=* | --c=*) |
911 |
COMMAND=$ac_optarg ;; |
COMMAND=$ac_optarg ;; |
912 |
|
|
913 |
|
-makedepend | --makedepend | -md | --md) |
914 |
|
ac_prev=MKDEPEND ;; |
915 |
|
-makedepend=* | --makedepend=* | -md=* | --md=*) |
916 |
|
MKDEPEND=$ac_optarg ;; |
917 |
|
|
918 |
-make | --make | -m | --m) |
-make | --make | -m | --m) |
919 |
ac_prev=MAKE ;; |
ac_prev=MAKE ;; |
920 |
-make=* | --make=* | -m=* | --m=*) |
-make=* | --make=* | -m=* | --m=*) |
1017 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1018 |
fi |
fi |
1019 |
|
|
1020 |
|
xx=`echo $TESTDIRS | awk '{print $1}'` |
1021 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1022 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
1023 |
|
elif test $xx = 'start_from' ; then |
1024 |
|
xx=`echo $TESTDIRS | awk '{print $2}'` |
1025 |
|
LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"` |
1026 |
else |
else |
1027 |
#- expand group of experiments: |
#- expand group of experiments: |
1028 |
LIST=" " |
LIST=" " |
1215 |
builddir="build" |
builddir="build" |
1216 |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1217 |
rundir="run" |
rundir="run" |
1218 |
|
pfxdir="tr_$rundir" |
1219 |
if test ! -d $dir/$rundir ; then |
if test ! -d $dir/$rundir ; then |
1220 |
rundir=$builddir |
rundir=$builddir |
1221 |
fi |
fi |
1226 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1227 |
echo -n ' --- dir:' $BUILD_DIR ': ' |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1228 |
makeclean $BUILD_DIR |
makeclean $BUILD_DIR |
1229 |
rm -f $BUILD_DIR/$EXECUTABLE |
( cd $BUILD_DIR |
1230 |
|
rm -f $EXECUTABLE *.bak |
1231 |
|
rm -f genmake_state genmake_*optfile genmake_warnings genmake_errors |
1232 |
|
rm -f genmake.log make.log |
1233 |
|
) |
1234 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1235 |
echo -n ' --- dir:' $dir/$rundir ': ' |
echo -n ' --- dir:' $dir/$rundir ': ' |
1236 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1237 |
fi |
fi |
1238 |
trdir=`( cd $dir ; find . -type d -name "tr_run.*" -print | sed 's/^.\///')` |
trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')` |
1239 |
ttd=`echo $trdir | wc -w` |
ttd=`echo $trdir | wc -w` |
1240 |
if test $ttd != 0 ; then |
if test $ttd != 0 ; then |
1241 |
echo ' --- rm dir:' $trdir |
echo ' --- rm dir:' $trdir |
1360 |
locDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1361 |
mkdir $locDIR |
mkdir $locDIR |
1362 |
CDIR=`pwd`"/$locDIR" |
CDIR=`pwd`"/$locDIR" |
1363 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1364 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1365 |
linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir |
linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir |
1366 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/$pfxdir.$ex && run=Y \ |
1367 |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
&& results=`testoutput_run $dir $pfxdir.$ex $refExOut` |
1368 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1369 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1370 |
echo 1>&2 |
echo 1>&2 |
1377 |
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
1378 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1379 |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
1380 |
grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \ |
1381 |
>> $locDIR"/summary.txt" |
>> $locDIR"/summary.txt" |
1382 |
fi |
fi |
1383 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1384 |
run_clean $dir/tr_run.$ex |
run_clean $dir/$pfxdir.$ex |
1385 |
fi |
fi |
1386 |
done |
done |
1387 |
|
|