27 |
echo " (DEF=\"make output.txt\")" |
echo " (DEF=\"make output.txt\")" |
28 |
echo " (-m|-make) STRING command to use for \"make\"" |
echo " (-m|-make) STRING command to use for \"make\"" |
29 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
30 |
|
echo " (-odir) STRING used to build output directory name" |
31 |
|
echo " (DEF=\"hostname\")" |
32 |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
33 |
echo " (DEF=\"1 2 3 4 5\")" |
echo " (DEF=\"1 2 3 4 5\")" |
34 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
97 |
fi |
fi |
98 |
if [ -r $1/$4/output.txt ]; then |
if [ -r $1/$4/output.txt ]; then |
99 |
grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt |
grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt |
100 |
lncnt=`wc -l tmp1.txt | awk '{print $1}' ` |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
101 |
if [ $lncnt -lt 3 ]; then |
if [ $lncntA -lt 3 ]; then |
102 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
103 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
104 |
fi |
fi |
112 |
echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2 |
echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2 |
113 |
fi |
fi |
114 |
grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt |
grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt |
115 |
lncnt=`wc -l tmp2.txt | awk '{print $1}' ` |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
116 |
if [ $lncnt -lt 3 ]; then |
if [ $lncntB -lt 3 ]; then |
117 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
118 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
119 |
fi |
fi |
120 |
return 99 |
return 99 |
121 |
fi |
fi |
122 |
|
if [ $lncntA -ne $lncntB ]; then |
123 |
|
if [ $verbose -gt 0 ]; then |
124 |
|
echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2 |
125 |
|
fi |
126 |
|
return 99 |
127 |
|
fi |
128 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
129 |
echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 |
echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 |
130 |
fi |
fi |
302 |
if test "x$IEEE" != x ; then |
if test "x$IEEE" != x ; then |
303 |
command="$command -ieee" |
command="$command -ieee" |
304 |
fi |
fi |
305 |
|
if test "x$MPI" = xt ; then |
306 |
|
command="$command -mpi" |
307 |
|
fi |
308 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
309 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
310 |
RETVAL=$? |
RETVAL=$? |
350 |
fi |
fi |
351 |
} |
} |
352 |
|
|
353 |
|
postclean() |
354 |
|
{ |
355 |
|
# postclean directory |
356 |
|
if test "x$POSTCLEAN" = xt ; then |
357 |
|
( |
358 |
|
cd $1; |
359 |
|
if test -r Makefile ; then |
360 |
|
$MAKE CLEAN >> /dev/null 2>&1 |
361 |
|
fi |
362 |
|
exit 0 |
363 |
|
) |
364 |
|
fi |
365 |
|
} |
366 |
|
|
367 |
makedependmodel() |
makedependmodel() |
368 |
{ |
{ |
369 |
# makedependmodel directory |
# makedependmodel directory |
554 |
abave = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
555 |
if (abave > 0.0) { |
if (abave > 0.0) { |
556 |
relerr=fabs(a-b)/abave; |
relerr=fabs(a-b)/abave; |
557 |
if (relerr > 0.0) { linnum = (int)log10(relerr); } |
if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } |
558 |
else { linnum = -16 ; } |
else { linnum = -16 ; } |
559 |
best = (best > linnum) ? best : linnum; |
best = (best > linnum) ? best : linnum; |
560 |
} |
} |
652 |
NOGENMAKE=f |
NOGENMAKE=f |
653 |
NOCLEAN=f |
NOCLEAN=f |
654 |
NODEPEND=f |
NODEPEND=f |
655 |
|
POSTCLEAN=f |
656 |
|
|
657 |
BASH= |
BASH= |
658 |
OPTFILE=NONE |
OPTFILE=NONE |
670 |
fi |
fi |
671 |
JOBS= |
JOBS= |
672 |
MPI=f |
MPI=f |
673 |
|
OUTDIR= |
674 |
DELDIR= |
DELDIR= |
675 |
|
|
676 |
ADM= |
ADM= |
727 |
-make=* | --make=*) |
-make=* | --make=*) |
728 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
729 |
|
|
730 |
|
-odir | --odir) |
731 |
|
ac_prev=OUTDIR ;; |
732 |
|
-odir=* | --odir=*) |
733 |
|
OUTDIR=$ac_optarg ;; |
734 |
|
|
735 |
-ptracers | --ptracers | -ptr | --ptr) |
-ptracers | --ptracers | -ptr | --ptr) |
736 |
ac_prev=PTRACERS_NUM ;; |
ac_prev=PTRACERS_NUM ;; |
737 |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) |
741 |
-j=*) JOBS=$ac_optarg ;; |
-j=*) JOBS=$ac_optarg ;; |
742 |
|
|
743 |
-clean | --clean) |
-clean | --clean) |
744 |
CLEANUP=t ;; |
CLEANUP=t ; DELDIR=t ;; |
745 |
|
|
746 |
-quick | --quick | -q | --q) |
-quick | --quick | -q | --q) |
747 |
QUICK=t ;; |
QUICK=t ;; |
752 |
-nodepend | --nodepend | -nd | --nd) |
-nodepend | --nodepend | -nd | --nd) |
753 |
NODEPEND=t ;; |
NODEPEND=t ;; |
754 |
|
|
755 |
|
-postclean | --postclean | -pc | --pc) |
756 |
|
POSTCLEAN=t ;; |
757 |
|
|
758 |
-mpi) MPI=t ;; |
-mpi) MPI=t ;; |
759 |
|
|
760 |
-adm | -ad) ADM=t ;; |
-adm | -ad) ADM=t ;; |
821 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
822 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
823 |
BASE="tr_"$MACH"_"$DATE"_" |
BASE="tr_"$MACH"_"$DATE"_" |
824 |
|
if test "x$OUTDIR" != x ; then |
825 |
|
BASE="tr_"$OUTDIR"_"$DATE"_" |
826 |
|
fi |
827 |
DNUM=0 |
DNUM=0 |
828 |
DRESULTS="$BASE$DNUM" |
DRESULTS="$BASE$DNUM" |
829 |
while test -e $DRESULTS ; do |
while test -e $DRESULTS ; do |
913 |
if test -r $dir/input/Makefile ; then |
if test -r $dir/input/Makefile ; then |
914 |
( cd $dir/input ; make CLEAN ) |
( cd $dir/input ; make CLEAN ) |
915 |
fi |
fi |
916 |
|
( |
917 |
|
cd $dir |
918 |
|
rm -rf tr_run.* |
919 |
|
) |
920 |
continue |
continue |
921 |
fi |
fi |
922 |
|
|
1014 |
|
|
1015 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1016 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
1017 |
for ldir in build input input.$ex ; do |
for ldir in input.$ex input ; do |
1018 |
( |
( |
1019 |
cd "$dir/$ldir" > /dev/null 2>&1 |
cd "$dir/$ldir" > /dev/null 2>&1 |
1020 |
ls -1 2>/dev/null \ |
ls -1 2>/dev/null \ |
1024 |
cd "$dir/tr_run.$ex" |
cd "$dir/tr_run.$ex" |
1025 |
cat ../../tr_exrun_links | while read i ; do |
cat ../../tr_exrun_links | while read i ; do |
1026 |
if test ! "x$i" = x ; then |
if test ! "x$i" = x ; then |
1027 |
test -e $i && rm -f $i |
test ! -r $i && ln -s "../"$ldir"/"$i $i |
|
ln -s "../"$ldir"/"$i $i |
|
1028 |
fi |
fi |
1029 |
done |
done |
1030 |
) |
) |
1031 |
test -e tr_exrun_links && rm -f tr_exrun_links |
test -e tr_exrun_links && rm -f tr_exrun_links |
1032 |
done |
done |
1033 |
|
ldir=build |
1034 |
|
( |
1035 |
|
cd "$dir/$ldir" > /dev/null 2>&1 |
1036 |
|
ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ |
1037 |
|
| sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' |
1038 |
|
) > tr_exrun_links |
1039 |
|
( |
1040 |
|
cd "$dir/tr_run.$ex" |
1041 |
|
cat ../../tr_exrun_links | while read i ; do |
1042 |
|
if test ! "x$i" = x ; then |
1043 |
|
test ! -r $i && ln -s "../"$ldir"/"$i $i |
1044 |
|
fi |
1045 |
|
done |
1046 |
|
) |
1047 |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
1048 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1049 |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
1050 |
fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
1069 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
1070 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
1071 |
fi |
fi |
1072 |
|
|
1073 |
|
postclean $dir/$builddir |
1074 |
|
|
1075 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
1076 |
|
|
1112 |
rm -f tmp_cmpnum.c tmp_cmpnum |
rm -f tmp_cmpnum.c tmp_cmpnum |
1113 |
|
|
1114 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1115 |
cat $SUMMARY |
cat $SUMMARY | sed 's/ -- -- -- --//g' |
1116 |
if test -e tr_out.txt ; then |
if test -e tr_out.txt ; then |
1117 |
mv tr_out.txt tr_out.txt.old |
mv tr_out.txt tr_out.txt.old |
1118 |
fi |
fi |
1119 |
cat $SUMMARY > tr_out.txt |
cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt |
1120 |
fi |
fi |
1121 |
|
|
1122 |
if test "x$DELDIR" = xt ; then |
if test "x$DELDIR" = xt ; then |