19 |
echo " (-of=|-optfile=)STRING list of optfiles to use" |
echo " (-of=|-optfile=)STRING list of optfiles to use" |
20 |
echo " (-a|-addr) STRING list of email recipients" |
echo " (-a|-addr) STRING list of email recipients" |
21 |
echo " (DEF=\"\" no email is sent)" |
echo " (DEF=\"\" no email is sent)" |
22 |
|
echo " (-mpd|-mpackdir) DIR location of the mpack utility" |
23 |
|
echo " (DEF=\"../tools/mpack-1.6\")" |
24 |
echo " (-t|-tdir) STRING list of group and/or exp. dirs to test" |
echo " (-t|-tdir) STRING list of group and/or exp. dirs to test" |
25 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
26 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
67 |
build_mpack() |
build_mpack() |
68 |
{ |
{ |
69 |
printf "building the mpack utility... " |
printf "building the mpack utility... " |
70 |
if test ! -x "$MPACKDIR/mpack" ; then |
MPACK="$MPACKDIR/mpack" |
71 |
|
if test ! -x $MPACK ; then |
72 |
if test ! -d $MPACKDIR ; then |
if test ! -d $MPACKDIR ; then |
73 |
echo |
echo |
74 |
echo "Error: can't find \"$MPACKDIR\"" |
echo "Error: can't find \"$MPACKDIR\"" |
77 |
echo |
echo |
78 |
HAVE_MPACK=f |
HAVE_MPACK=f |
79 |
fi |
fi |
|
printf "building mpack... " |
|
80 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
81 |
export CC=cc |
export CC=cc |
82 |
fi |
fi |
83 |
|
printf "building mpack (using CC=$CC)... " |
84 |
( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1 |
( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1 |
85 |
RETVAL=$? |
RETVAL=$? |
86 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
91 |
else |
else |
92 |
rm -f tr_build_mpack.out |
rm -f tr_build_mpack.out |
93 |
HAVE_MPACK=t |
HAVE_MPACK=t |
94 |
|
echo "done" |
95 |
fi |
fi |
96 |
else |
else |
97 |
HAVE_MPACK=t |
HAVE_MPACK=t |
98 |
|
echo "already exist" |
99 |
fi |
fi |
|
echo "OK" |
|
100 |
} |
} |
101 |
|
|
102 |
testoutput_var() |
testoutput_var() |
179 |
return $digits_of_similarity |
return $digits_of_similarity |
180 |
} |
} |
181 |
|
|
|
check_for_add_mon_output() |
|
|
{ |
|
|
# Check for additional types of monitor output |
|
|
if test "x$1" = x ; then |
|
|
return |
|
|
fi |
|
|
|
|
|
for ii in $PTRACERS_NUM ; do |
|
|
eval "HAVE_PTR0"$ii"=f" |
|
|
done |
|
|
|
|
|
ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max" |
|
|
ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd" |
|
|
for ii in $PTRACERS_NUM ; do |
|
|
for jj in $ptr_add ; do |
|
|
name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"` |
|
|
tst=`grep $name $1 | wc -l | awk '{print $1}'` |
|
|
if test ! "x$tst" = x0 ; then |
|
|
eval "HAVE_PTR0"$ii"=t" |
|
|
fi |
|
|
done |
|
|
# eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"' |
|
|
done |
|
|
} |
|
|
|
|
182 |
testoutput_run() |
testoutput_run() |
183 |
{ |
{ |
184 |
# testoutput_run directory subdir reference_output |
# testoutput_run directory subdir reference_output |
196 |
listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \ |
listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \ |
197 |
| sed 's/+//g' | sed "s/^$sVar//"` |
| sed 's/+//g' | sed "s/^$sVar//"` |
198 |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi |
199 |
for ii in 1 2 3 4 5 6 7 8 9 ; do |
# check for ptracer output in reference_output file : |
200 |
tst=`eval 'echo "$HAVE_PTR0'$ii'"'` |
outpref=$1/results/$3 |
201 |
#echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2 |
ptr_mon="trcstat_ptracerXX_min trcstat_ptracerXX_max" |
202 |
if test "x$tst" != xt ; then listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` ; fi |
ptr_mon="$ptr_mon trcstat_ptracerXX_mean trcstat_ptracerXX_sd" |
203 |
done |
for ii in $PTRACERS_NUM ; do |
204 |
tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){t+=($i==$1)}; print t }'` |
ptrfound=0 |
205 |
|
for jj in $ptr_mon ; do |
206 |
|
name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"` |
207 |
|
tst=`grep $name $outpref | wc -l | awk '{print $1}'` |
208 |
|
if test ! "x$tst" = x0 ; then ptrfound=1 ; fi |
209 |
|
done |
210 |
|
if test $ptrfound = '1' ; then |
211 |
|
eval "HAVE_PTR0"$ii"=t" |
212 |
|
else |
213 |
|
eval "HAVE_PTR0"$ii"=f" |
214 |
|
if test "x$ADM" = x ; then |
215 |
|
# remove this ptr from the list of output variable to check |
216 |
|
# echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2 |
217 |
|
listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` |
218 |
|
fi |
219 |
|
fi |
220 |
|
# eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"' 1>&2 |
221 |
|
done |
222 |
|
tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){if($i==$1)t+=1}; print t }'` |
223 |
if test $tst != 1 ; then |
if test $tst != 1 ; then |
224 |
if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2 |
if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2 |
225 |
else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi |
else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi |
471 |
CODE_DIR=$dir/$code_dir |
CODE_DIR=$dir/$code_dir |
472 |
|
|
473 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
474 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")` |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)` |
475 |
|
|
476 |
# Is this an MPI run? |
# Is this an MPI run? |
477 |
if test "x$MPI" = xt ; then |
if test "x$MPI" = xt ; then |
622 |
{ |
{ |
623 |
# create codelet for comparing model output |
# create codelet for comparing model output |
624 |
|
|
625 |
printf "creating the comparison code... " |
printf "creating the comparison code (using CC=$CC)... " |
626 |
cat > tr_cmpnum.c <<EOF |
cat > tr_cmpnum.c <<EOF |
627 |
#include <stdio.h> |
#include <stdio.h> |
628 |
#include <math.h> |
#include <math.h> |
740 |
SKIPDIRS= |
SKIPDIRS= |
741 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
742 |
HAVE_MPACK= |
HAVE_MPACK= |
743 |
MPACK="$MPACKDIR/mpack" |
MPACK= |
744 |
COMMAND= |
COMMAND= |
745 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
746 |
MAKE=make |
MAKE=make |
756 |
|
|
757 |
ADM= |
ADM= |
758 |
|
|
759 |
# Additional monitor types |
# list of pTracers to check for monitor output |
760 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
761 |
|
|
762 |
MATCH_CRIT=13 |
MATCH_CRIT=13 |
789 |
ac_prev=ADDRESSES ;; |
ac_prev=ADDRESSES ;; |
790 |
-addr=* | --addr=*) |
-addr=* | --addr=*) |
791 |
ADDRESSES=$ac_optarg ;; |
ADDRESSES=$ac_optarg ;; |
792 |
|
-mpackdir | --mpackdir | -mpd | --mpd) |
793 |
|
ac_prev=MPACKDIR ;; |
794 |
|
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) |
795 |
|
MPACKDIR=$ac_optarg ;; |
796 |
|
|
797 |
-tdir | --tdir | -t | --t) |
-tdir | --tdir | -t | --t) |
798 |
ac_prev=TESTDIRS ;; |
ac_prev=TESTDIRS ;; |
979 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
980 |
createcodelet |
createcodelet |
981 |
|
|
982 |
# build the mpack utility |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
983 |
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x ; then |
984 |
echo "skipping mpack build" |
echo "skipping mpack build" |
985 |
else |
else |
986 |
build_mpack |
build_mpack |
988 |
|
|
989 |
# Create a uniquely named directory to store results |
# Create a uniquely named directory to store results |
990 |
CMDLINE=$0 |
CMDLINE=$0 |
991 |
for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done |
for xx in "$@" ; do nw=`echo $xx | wc -w` |
992 |
|
if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" |
993 |
|
else CMDLINE="$CMDLINE '$xx'" ; fi |
994 |
|
done |
995 |
|
#for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done |
996 |
MACH=`hostname` |
MACH=`hostname` |
997 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
998 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
1056 |
line_3="N n k u 2 i a a d i a a d i a a d i a a d" |
line_3="N n k u 2 i a a d i a a d i a a d i a a d" |
1057 |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
1058 |
for ii in $PTRACERS_NUM ; do |
for ii in $PTRACERS_NUM ; do |
|
# tst=`eval 'echo $HAVE_PTR0'$ii` |
|
|
# if test "x$tst" = xt ; then |
|
1059 |
line_0="$line_0 --PTR 0"$ii"--" |
line_0="$line_0 --PTR 0"$ii"--" |
1060 |
line_1="$line_1 m s" |
line_1="$line_1 m s" |
1061 |
line_2="$line_2 m m e ." |
line_2="$line_2 m m e ." |
1062 |
line_3="$line_3 i a a d" |
line_3="$line_3 i a a d" |
1063 |
line_4="$line_4 n x n ." |
line_4="$line_4 n x n ." |
|
# fi |
|
1064 |
done |
done |
1065 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1066 |
echo "$line_1" | tee -a $SUMMARY |
echo "$line_1" | tee -a $SUMMARY |
1100 |
# Cleanup only! |
# Cleanup only! |
1101 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1102 |
if test -r $BUILD_DIR/Makefile ; then |
if test -r $BUILD_DIR/Makefile ; then |
1103 |
echo ' ------ clean dir:' $dir/build |
echo ' ------ clean dir:' $dir/$builddir |
1104 |
( cd $BUILD_DIR ; make CLEAN ) |
( cd $BUILD_DIR ; make CLEAN ) |
1105 |
fi |
fi |
1106 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1121 |
echo "can't read \"$fout\" -- skipping $dir" |
echo "can't read \"$fout\" -- skipping $dir" |
1122 |
continue |
continue |
1123 |
fi |
fi |
|
if test "x$ADM" = x ; then |
|
|
check_for_add_mon_output $fout |
|
|
fi |
|
1124 |
|
|
1125 |
# Check for additional types of monitor output |
# Check for specific files for particular type of run |
1126 |
|
|
1127 |
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 |
1128 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1246 |
done |
done |
1247 |
|
|
1248 |
printf "Start time: " >> $SUMMARY |
printf "Start time: " >> $SUMMARY |
1249 |
echo $start_date >> $SUMMARY |
echo "$start_date" >> $SUMMARY |
1250 |
printf "End time: " >> $SUMMARY |
printf "End time: " >> $SUMMARY |
1251 |
date >> $SUMMARY |
date >> $SUMMARY |
1252 |
|
|