189 |
done |
done |
190 |
} |
} |
191 |
|
|
|
testoutput_ad() |
|
|
{ |
|
|
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt |
|
|
grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt |
|
|
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt |
|
|
grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt |
|
|
join t05.txt t15.txt > t5.txt |
|
|
join t06.txt t16.txt > t6.txt |
|
|
echo "-1" >> t5.txt |
|
|
echo "-1" >> t6.txt |
|
|
digits_5=`./tr_cmpnum < t5.txt` |
|
|
digits_6=`./tr_cmpnum < t6.txt` |
|
|
dashnum $digits_5 $digits_6 |
|
|
rm -f t[01][56].txt t[56].txt |
|
|
} |
|
|
|
|
192 |
check_for_add_mon_output() |
check_for_add_mon_output() |
193 |
{ |
{ |
194 |
# Check for additional types of monitor output |
# Check for additional types of monitor output |
219 |
# testoutput_run directory subdir reference_output |
# testoutput_run directory subdir reference_output |
220 |
# |
# |
221 |
# test output from 1 run in "directory" |
# test output from 1 run in "directory" |
222 |
# if test "x$ADM" = x ; then |
# --> same processing for adjoint & forward test |
223 |
# default list of output variables to be checked: |
# default list of output variables to be checked: |
224 |
# 1rst : main variable used to decide if it pass or FAIL |
# 1rst : main variable used to decide if it pass or FAIL |
225 |
# others : number of matching digits to be printed in summary.txt |
# others : number of matching digits to be printed in summary.txt |
314 |
else |
else |
315 |
echo $allargs |
echo $allargs |
316 |
fi |
fi |
317 |
|
# <-- same processing for adjoint & forward test |
|
# else |
|
|
# testoutput_ad $1 $2 "precision_grdchk_result" |
|
|
# fi |
|
318 |
} |
} |
319 |
|
|
320 |
genmakemodel() |
genmakemodel() |
414 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
415 |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime |
416 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
417 |
|
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
418 |
echo successful 1>&2 |
echo successful 1>&2 |
419 |
exit 0 |
exit 0 |
420 |
) |
) |
576 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ...' $1 1>&2 |
577 |
# make output.txt |
# make output.txt |
578 |
echo |
echo |
579 |
|
if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
580 |
|
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
581 |
|
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; rm -f run.log ; fi |
582 |
|
fi |
583 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
584 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00 |
585 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
915 |
fi |
fi |
916 |
|
|
917 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
918 |
# if test "x$ADM" = xt ; then |
LIST=`scandirs results/$ref_outp` |
|
# LIST=`scandirs results_ad/$ref_outp` |
|
|
# else |
|
|
LIST=`scandirs results/$ref_outp` |
|
|
# fi |
|
919 |
else |
else |
920 |
#- expand group of experiments: |
#- expand group of experiments: |
921 |
LIST=" " |
LIST=" " |
967 |
OUTPUTFILE="STDOUT.0000" |
OUTPUTFILE="STDOUT.0000" |
968 |
fi |
fi |
969 |
|
|
|
#echo "OK" |
|
970 |
echo "OK (COMMAND= $COMMAND )" |
echo "OK (COMMAND= $COMMAND )" |
971 |
|
|
972 |
# set the Default List of output variables to be checked: |
# set the Default List of output variables to be checked: |
980 |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
981 |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
982 |
else |
else |
983 |
DEF_CHECK_LIST='Cost Cost Grad' |
DEF_CHECK_LIST='Grad Cost Grad' |
984 |
EMPTY_RESULTS='.. ..' |
EMPTY_RESULTS='.. ..' |
985 |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
986 |
fi |
fi |
1077 |
echo "ADJOINT=true" >> $SUMMARY |
echo "ADJOINT=true" >> $SUMMARY |
1078 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1079 |
if [ $MATCH_CRIT -lt 10 ] ; |
if [ $MATCH_CRIT -lt 10 ] ; |
1080 |
then line_0="default "$MATCH_CRIT ; |
then line_0="default "$MATCH_CRIT ; |
1081 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1082 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1083 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1084 |
G D M C G |
G D M C G |
1092 |
# ...and each test directory... |
# ...and each test directory... |
1093 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
1094 |
|
|
1095 |
|
# set builddir & rundir: |
1096 |
|
builddir="build" |
1097 |
|
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
1098 |
|
rundir="run" |
1099 |
|
if test ! -d $dir/$rundir ; then |
1100 |
|
rundir=$builddir |
1101 |
|
fi |
1102 |
|
CODE_DIR=$dir/$code_dir |
1103 |
|
BUILD_DIR=$dir/$builddir |
1104 |
|
|
1105 |
# Cleanup only! |
# Cleanup only! |
1106 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1107 |
if test -r $dir/build/Makefile ; then |
if test -r $BUILD_DIR/Makefile ; then |
1108 |
echo ' ------ clean dir:' $dir/build |
echo ' ------ clean dir:' $dir/build |
1109 |
( cd $dir/build ; make CLEAN ) |
( cd $BUILD_DIR ; make CLEAN ) |
1110 |
fi |
fi |
1111 |
if test -d $dir/run/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1112 |
echo ' ------ clean dir:' $dir/run |
echo ' ------ clean dir:' $dir/$rundir |
1113 |
run_clean $dir/run |
run_clean $dir/$rundir |
1114 |
fi |
fi |
1115 |
( |
( |
1116 |
cd $dir |
cd $dir |
1121 |
|
|
1122 |
# Verify that the testdir exists and contains previous |
# Verify that the testdir exists and contains previous |
1123 |
# results in the correct location--or skip this directory! |
# results in the correct location--or skip this directory! |
1124 |
fout= |
fout=$dir"/results/"$ref_outp |
|
if test "x$ADM" = x ; then |
|
|
fout=$dir"/results/"$ref_outp |
|
|
else |
|
|
fout=$dir"/results_ad/"$ref_outp |
|
|
fi |
|
1125 |
if test ! -r $fout ; then |
if test ! -r $fout ; then |
1126 |
echo "can't read \"$fout\" -- skipping $dir" |
echo "can't read \"$fout\" -- skipping $dir" |
1127 |
continue |
continue |
1132 |
|
|
1133 |
# Check for additional types of monitor output |
# Check for additional types of monitor output |
1134 |
|
|
|
builddir="build" |
|
|
if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi |
|
|
rundir="run" |
|
|
if test ! -d $dir/$rundir ; then |
|
|
rundir=$builddir |
|
|
fi |
|
|
CODE_DIR=$dir/$code_dir |
|
|
BUILD_DIR=$dir/$builddir |
|
|
|
|
1135 |
if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then |
if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then |
1136 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1137 |
continue |
continue |
1195 |
fi |
fi |
1196 |
|
|
1197 |
echo |
echo |
1198 |
# if test "x$ADM" = x ; then |
# --> same processing for adjoint & forward test |
1199 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1200 |
echo |
echo |
1201 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1209 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1210 |
unset run |
unset run |
1211 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1212 |
|
# reference output file |
1213 |
|
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1214 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir for each OPTFILE/tdir.ex combination |
1215 |
rel_CDIR=$DRESULTS"/"$dir"."$ex |
rel_CDIR=$DRESULTS"/"$dir"."$ex |
1216 |
mkdir $rel_CDIR |
mkdir $rel_CDIR |
1217 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$rel_CDIR" |
1218 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
1219 |
run_clean $dir/tr_run.$ex |
run_clean $dir/tr_run.$ex |
1220 |
linkdata $dir/tr_run.$ex input.$ex input |
linkdata $dir/tr_run.$ex input.$ex input |
1221 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1222 |
&& results=`testoutput_run $dir tr_run.$ex "output.${ex}.txt"` |
&& results=`testoutput_run $dir tr_run.$ex $refExOut` |
1223 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1224 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1225 |
echo |
echo |
1234 |
run_clean $dir/tr_run.$ex |
run_clean $dir/tr_run.$ex |
1235 |
fi |
fi |
1236 |
done |
done |
1237 |
# else |
# <-- same processing for adjoint & forward test |
|
# fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
|
|
# fres=$fres"$results $dir" |
|
|
# echo |
|
|
# echo "$fres" >> $SUMMARY |
|
|
# touch $CDIR"/summary.txt" |
|
|
# echo "fresults='$fres'" >> $CDIR"/summary.txt" |
|
|
# echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
|
|
# echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
|
|
# echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
|
|
# echo "tdir='$dir'" >> $CDIR"/summary.txt" |
|
|
# fi |
|
1238 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1239 |
|
head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt" |
1240 |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
1241 |
>> $CDIR"/summary.txt" |
>> $CDIR"/summary.txt" |
1242 |
fi |
fi |
1290 |
if test -e tr_out.txt ; then |
if test -e tr_out.txt ; then |
1291 |
mv tr_out.txt tr_out.txt.old |
mv tr_out.txt tr_out.txt.old |
1292 |
fi |
fi |
1293 |
cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \.//g' > tr_out.txt |
cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > tr_out.txt |
1294 |
fi |
fi |
1295 |
|
|
1296 |
if test "x$DELDIR" = xt ; then |
if test "x$DELDIR" = xt ; then |