15 |
echo " (-mpi) compile and run using MPI" |
echo " (-mpi) compile and run using MPI" |
16 |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
17 |
echo " (DEF=\"-ieee\")" |
echo " (DEF=\"-ieee\")" |
18 |
echo " (-optfile=|-of=)STRING list of optfiles to use" |
echo " (-of=|-optfile=)STRING list of optfiles to use" |
19 |
echo " (-a|-addr) STRING list of email recipients" |
echo " (-a|-addr) STRING list of email recipients" |
20 |
echo " (DEF=\"edhill@mitgcm.org\")" |
echo " (DEF=\"edhill@mitgcm.org\")" |
21 |
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" |
22 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
23 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
24 |
|
echo " (-skd|-skipdir) STRING list of exp. dirs to skip" |
25 |
|
echo " (DEF=\"\" which test all)" |
26 |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
27 |
echo " Bourne-compatible \"sh\" shell" |
echo " Bourne-compatible \"sh\" shell" |
28 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
33 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
34 |
echo " (-odir) STRING used to build output directory name" |
echo " (-odir) STRING used to build output directory name" |
35 |
echo " (DEF=\"hostname\")" |
echo " (DEF=\"hostname\")" |
36 |
echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
echo " (-ptr|-ptracers) STRING specify which ptracers to test" |
37 |
echo " (DEF=\"1 2 3 4 5\")" |
echo " (DEF=\"1 2 3 4 5\")" |
38 |
|
echo " (-match) NUMBER Matching Criteria (number of digits)" |
39 |
|
echo " (DEF=\"12\")" |
40 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
41 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
42 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
44 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
45 |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
46 |
echo " (-deldir|-dd) on success, delete the output directory" |
echo " (-deldir|-dd) on success, delete the output directory" |
47 |
|
echo " (-ts) provide timing information per timestep" |
48 |
|
echo " (-papis) provide MFlop/s per timestep using PAPI" |
49 |
|
echo " (-pcls) provide MFlop/s per timestep using PCL" |
50 |
echo |
echo |
51 |
echo "and where STRING can be a whitespace-delimited list" |
echo "and where STRING can be a whitespace-delimited list" |
52 |
echo "such as:" |
echo "such as:" |
98 |
{ |
{ |
99 |
# testoutput_for_prop dir s1 label subdir extension |
# testoutput_for_prop dir s1 label subdir extension |
100 |
# |
# |
101 |
# compares files in $dir/$subdir/output.txt and $dir/results/output.txt |
# compares files $dir/$subdir/$OUTPUTFILE and $dir/results/output.txt |
102 |
# using search strings s1 and text label |
# using search strings s1 and text label |
103 |
|
|
104 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
105 |
echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2 |
echo testoutput_for_prop: grep "$2" $1/$4/$OUTPUTFILE 1>&2 |
106 |
fi |
fi |
107 |
if [ -r $1/$4/output.txt ]; then |
if [ -r $1/$4/$OUTPUTFILE ]; then |
108 |
grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt |
grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt |
109 |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
110 |
if [ $lncntA -lt 3 ]; then |
if [ $lncntA -lt 3 ]; then |
111 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
114 |
return 99 |
return 99 |
115 |
fi |
fi |
116 |
else |
else |
117 |
echo testoutput_for_prop: output.txt from model run was not readable 1>&2 |
echo testoutput_for_prop: $OUTPUTFILE from model run was not readable 1>&2 |
118 |
return 99 |
return 99 |
119 |
fi |
fi |
120 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
121 |
echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2 |
echo testoutput_for_prop: grep "$2" $1/results/output.$5 1>&2 |
122 |
fi |
fi |
123 |
grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt |
grep "$2" $1/results/output.$5 | sed 's/.*=//' | cat -n > tmp2.txt |
124 |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
125 |
if [ $lncntB -lt 3 ]; then |
if [ $lncntB -lt 3 ]; then |
126 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
136 |
fi |
fi |
137 |
has_nan=`cat tmp1.txt | grep -i nan | wc -l` |
has_nan=`cat tmp1.txt | grep -i nan | wc -l` |
138 |
if [ $has_nan -gt 0 ] ; then |
if [ $has_nan -gt 0 ] ; then |
139 |
echo testoutput_for_prop: output.txt contains $has_nan NaN values 1>&2 |
echo testoutput_for_prop: $OUTPUTFILE contains $has_nan NaN values 1>&2 |
140 |
return 99 |
return 99 |
141 |
fi |
fi |
142 |
has_inf=`cat tmp1.txt | grep -i inf | wc -l` |
has_inf=`cat tmp1.txt | grep -i inf | wc -l` |
143 |
if [ $has_inf -gt 0 ] ; then |
if [ $has_inf -gt 0 ] ; then |
144 |
echo testoutput_for_prop: output.txt contains $has_inf Inf values 1>&2 |
echo testoutput_for_prop: $OUTPUTFILE contains $has_inf Inf values 1>&2 |
145 |
return 99 |
return 99 |
146 |
fi |
fi |
147 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
157 |
echo "-1" >> tmp3.txt |
echo "-1" >> tmp3.txt |
158 |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
159 |
cat tmp3.txt | sed -e 's|:||g' > tmp4.txt |
cat tmp3.txt | sed -e 's|:||g' > tmp4.txt |
160 |
digits_of_similarity=`./tmp_cmpnum < tmp4.txt` |
digits_of_similarity=`./tr_cmpnum < tmp4.txt` |
161 |
if [ $digits_of_similarity -eq 99 ]; then |
if [ $digits_of_similarity -eq 99 ]; then |
162 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
163 |
echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2 |
echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2 |
191 |
testoutput_ad() |
testoutput_ad() |
192 |
{ |
{ |
193 |
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt |
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt |
194 |
grep $3 $1/$2/output_adm.txt | awk '{print NR " " $5}' > t15.txt |
grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt |
195 |
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt |
grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt |
196 |
grep $3 $1/$2/output_adm.txt | awk '{print NR " " $6}' > t16.txt |
grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt |
197 |
join t05.txt t15.txt > t5.txt |
join t05.txt t15.txt > t5.txt |
198 |
join t06.txt t16.txt > t6.txt |
join t06.txt t16.txt > t6.txt |
199 |
echo "-1" >> t5.txt |
echo "-1" >> t5.txt |
200 |
echo "-1" >> t6.txt |
echo "-1" >> t6.txt |
201 |
digits_5=`./tmp_cmpnum < t5.txt` |
digits_5=`./tr_cmpnum < t5.txt` |
202 |
digits_6=`./tmp_cmpnum < t6.txt` |
digits_6=`./tr_cmpnum < t6.txt` |
203 |
dashnum $digits_5 $digits_6 |
dashnum $digits_5 $digits_6 |
204 |
rm -f t[01][56].txt t[56].txt |
rm -f t[01][56].txt t[56].txt |
205 |
} |
} |
323 |
if test "x$MPI" = xt ; then |
if test "x$MPI" = xt ; then |
324 |
command="$command -mpi" |
command="$command -mpi" |
325 |
fi |
fi |
326 |
|
if test "x$TS" = xt ; then |
327 |
|
command="$command -ts" |
328 |
|
fi |
329 |
|
if test "x$PAPIS" = xt ; then |
330 |
|
command="$command -papis" |
331 |
|
else |
332 |
|
if test "x$PCLS" = xt ; then |
333 |
|
command="$command -pcls" |
334 |
|
fi |
335 |
|
fi |
336 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
337 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
338 |
RETVAL=$? |
RETVAL=$? |
358 |
else |
else |
359 |
( |
( |
360 |
cd $1; |
cd $1; |
361 |
#if test -e output.txt ; then rm -f output.txt ; fi |
#if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi |
362 |
if test -r Makefile ; then |
if test -r Makefile ; then |
363 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
printf 'clean build-dir: make Clean ... ' 2>&1 |
364 |
$MAKE Clean >> make.log 2>&1 |
$MAKE Clean >> make.log 2>&1 |
553 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ...' $1 1>&2 |
554 |
# make output.txt |
# make output.txt |
555 |
echo |
echo |
|
rm -f run.log |
|
556 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
557 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00 |
558 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
|
else |
|
|
touch run.log |
|
559 |
fi |
fi |
560 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
561 |
|
rm -f run.log ; touch run.log |
562 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
563 |
echo " no executable:" $EXECUTABLE >> run.log |
echo " no executable:" $EXECUTABLE >> run.log |
564 |
RETVAL=8 |
RETVAL=8 |
565 |
|
ENDVAL=-1 |
566 |
else |
else |
567 |
if test $OUTPUTFILE -ot $EXECUTABLE ; then |
if test $OUTPUTFILE -ot $EXECUTABLE ; then |
568 |
|
rm -f run.log ; touch run.log |
569 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
570 |
( eval $COMMAND ) >> run.log 2>&1 |
( eval $COMMAND ) >> run.log 2>&1 |
571 |
RETVAL=$? |
RETVAL=$? |
572 |
else |
else |
|
echo " $OUTPUTFILE is up to date " >> run.log 2>&1 |
|
573 |
RETVAL=0 |
RETVAL=0 |
574 |
|
if test -f run.log ; then |
575 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
576 |
|
echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1 |
577 |
|
else |
578 |
|
touch run.log |
579 |
|
if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi |
580 |
|
echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1 |
581 |
|
echo " no previous run.log: assume NORMAL END" >> run.log 2>&1 |
582 |
|
fi |
583 |
fi |
fi |
584 |
|
ENDVAL=`cat run.log | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
585 |
fi |
fi |
586 |
# echo "COMMAND='$COMMAND'" |
rm -f run.log_00 |
587 |
# echo "pwd='"`pwd`"'" |
#if test "x$RETVAL" = x0 ; then |
588 |
if test "x$RETVAL" = x0 ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
589 |
tail run.log |
tail run.log |
590 |
echo successful 1>&2 |
echo successful 1>&2 |
591 |
# === Reduce the size of the testing emails! |
# === Reduce the size of the testing emails! |
592 |
# if test "x$ADM" = x ; then |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
|
# cp output.txt $CDIR"/output.txt" |
|
|
# else |
|
|
# cp output_adm.txt $CDIR"/output_adm.txt" |
|
|
# fi |
|
593 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
594 |
return 0 |
return 0 |
595 |
else |
else |
596 |
tail run.log |
tail run.log |
597 |
echo failed 1>&2 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
598 |
cp run.log $CDIR"/run.log" |
cp run.log $CDIR"/run.log" |
599 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
600 |
return 1 |
return 1 |
607 |
# create codelet for comparing model output |
# create codelet for comparing model output |
608 |
|
|
609 |
printf "creating the comparison code... " |
printf "creating the comparison code... " |
610 |
cat > tmp_cmpnum.c <<EOF |
cat > tr_cmpnum.c <<EOF |
611 |
#include <stdio.h> |
#include <stdio.h> |
612 |
#include <math.h> |
#include <math.h> |
613 |
int main( int argc, char** argv ) { |
int main( int argc, char** argv ) { |
614 |
int linnum,best,lncnt; |
int linnum,cmplin,best,lncnt; |
615 |
double a,b,abave,relerr; |
double a,b,abave,relerr; |
616 |
best = -22; |
best = -22; |
617 |
lncnt = 0; |
lncnt = 0; |
620 |
if (linnum == -1) break; |
if (linnum == -1) break; |
621 |
scanf("%lf", &a); scanf("%lf", &b); |
scanf("%lf", &a); scanf("%lf", &b); |
622 |
abave = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
623 |
if (abave > 0.0) { |
if ( abave == abave ) { |
624 |
relerr=fabs(a-b)/abave; |
if (abave > 0.0) { |
625 |
if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } |
relerr=fabs(a-b)/abave; |
626 |
else { linnum = -16 ; } |
if (relerr > 0.0) { cmplin = (int)rint(log10(relerr)); } |
627 |
best = (best > linnum) ? best : linnum; |
else { cmplin = -16 ; } |
628 |
} |
best = (best > cmplin) ? best : cmplin; } |
629 |
|
else { cmplin = -22 ; } |
630 |
|
/* printf("%d ; %lf ; %lf\n",cmplin,a,b); */ |
631 |
|
} |
632 |
|
else { |
633 |
|
/* printf("%lf ; %lf ; %lf\n",abave,a,b); */ |
634 |
|
break; } |
635 |
} |
} |
636 |
if (lncnt == 999) best=-29; |
if (lncnt == 999) best=-29; |
637 |
|
if (linnum != -1) best=-99; |
638 |
printf("%d\n", -best); |
printf("%d\n", -best); |
639 |
return 0; |
return 0; |
640 |
} |
} |
641 |
EOF |
EOF |
642 |
$CC -o tmp_cmpnum tmp_cmpnum.c -lm |
$CC -o tr_cmpnum tr_cmpnum.c -lm |
643 |
|
|
644 |
if [ -x ./tmp_cmpnum ]; then |
if [ -x ./tr_cmpnum ]; then |
645 |
echo "OK" |
echo "OK" |
646 |
return 0 |
return 0 |
647 |
else |
else |
664 |
if [ $1 = '--' ]; then |
if [ $1 = '--' ]; then |
665 |
printf ' N/O ' |
printf ' N/O ' |
666 |
else |
else |
667 |
if [ $1 -gt 12 ]; then |
if [ $1 -ge $MATCH_CRIT ]; then |
668 |
printf ' pass' |
printf ' pass' |
669 |
else |
else |
670 |
printf ' FAIL' |
printf ' FAIL' |
675 |
|
|
676 |
} |
} |
677 |
|
|
|
show_help() |
|
|
{ |
|
|
cat - << EOF |
|
|
$0 [-help] [-quick] [-verbose] dir1 [dir2] [...] |
|
|
|
|
|
-help|-h Show this help message |
|
|
-quiet Reduce the amount of output |
|
|
-verbose Produce copious amounts of output |
|
|
-debug Produce even more output which will mean nothing to most |
|
|
-force Do "make CLEAN" before compiling. This forces a complete rebuild. |
|
|
-clean Do "make CLEAN" after compiling and testing. |
|
|
-cleanup Aggresively removes all model output, executables and object files |
|
|
and then exits. Use with care. |
|
|
|
|
|
Normal usage: |
|
|
$0 * Configure, compile, run and analyze in all experiment directories |
|
|
EOF |
|
|
} |
|
|
|
|
678 |
scandirs() |
scandirs() |
679 |
{ |
{ |
680 |
if [ $# -eq 1 ]; then |
if [ $# -eq 1 ]; then |
714 |
OPTFILE=NONE |
OPTFILE=NONE |
715 |
ADDRESSES= |
ADDRESSES= |
716 |
TESTDIRS= |
TESTDIRS= |
717 |
|
SKIPDIRS= |
718 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
719 |
HAVE_MPACK= |
HAVE_MPACK= |
720 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
736 |
# Additional monitor types |
# Additional monitor types |
737 |
PTRACERS_NUM="1 2 3 4 5" |
PTRACERS_NUM="1 2 3 4 5" |
738 |
|
|
739 |
|
MATCH_CRIT=13 |
740 |
|
|
741 |
printf "parsing options... " |
printf "parsing options... " |
742 |
|
|
743 |
ac_prev= |
ac_prev= |
772 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=*) |
773 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
774 |
|
|
775 |
|
-skipdir | --skipdir | -skd | --skd) |
776 |
|
ac_prev=SKIPDIRS ;; |
777 |
|
-skipdir=* | --skipdir=*) |
778 |
|
SKIPDIRS=$ac_optarg ;; |
779 |
|
|
780 |
-bash | --bash | -b | --b) |
-bash | --bash | -b | --b) |
781 |
ac_prev=BASH ;; |
ac_prev=BASH ;; |
782 |
-bash=* | --bash=*) |
-bash=* | --bash=*) |
802 |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) |
-ptracers=* | --ptracers=* | -ptr=* | --ptr=*) |
803 |
PTRACERS_NUM=$ac_optarg ;; |
PTRACERS_NUM=$ac_optarg ;; |
804 |
|
|
805 |
|
-match | --match ) ac_prev=MATCH_CRIT ;; |
806 |
|
-match=* | --match=* ) MATCH_CRIT=$ac_optarg ;; |
807 |
|
|
808 |
-j) ac_prev=JOBS ;; |
-j) ac_prev=JOBS ;; |
809 |
-j=*) JOBS=$ac_optarg ;; |
-j=*) JOBS=$ac_optarg ;; |
810 |
|
|
838 |
|
|
839 |
-deldir | -dd) DELDIR=t ;; |
-deldir | -dd) DELDIR=t ;; |
840 |
|
|
841 |
|
-ts) TS=t;; |
842 |
|
|
843 |
|
-papis) PAPIS=t;; |
844 |
|
|
845 |
|
-pcls) PCL=t;; |
846 |
|
|
847 |
-*) |
-*) |
848 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
849 |
usage |
usage |
866 |
|
|
867 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
868 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
869 |
TESTDIRS=`scandirs results_ad` |
LIST=`scandirs results_ad` |
870 |
else |
else |
871 |
TESTDIRS=`scandirs results` |
LIST=`scandirs results` |
872 |
fi |
fi |
873 |
else |
else |
874 |
#- expand group of experiments: |
#- expand group of experiments: |
876 |
for xx in $TESTDIRS |
for xx in $TESTDIRS |
877 |
do |
do |
878 |
case $xx in |
case $xx in |
879 |
'basic') LIST=${LIST}" aim.5l_cs front_relax global_ocean.90x40x15" |
'basic') LIST=${LIST}" aim.5l_cs hs94.128x64x5 ideal_2D_oce" |
880 |
LIST=${LIST}" hs94.128x64x5 tutorial_barotropic_gyre" |
LIST=${LIST}" lab_sea tutorial_baroclinic_gyre" |
881 |
LIST=${LIST}" tutorial_global_oce_biogeo tutorial_plume_on_slope" |
LIST=${LIST}" tutorial_global_oce_latlon tutorial_plume_on_slope" |
882 |
;; |
;; |
883 |
'tutorials') |
'tutorials') |
884 |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
LIST=${LIST}" "`ls | grep 'tutorial_'` ;; |
885 |
*) LIST=${LIST}" "$xx ;; |
*) LIST=${LIST}" "$xx ;; |
886 |
esac |
esac |
887 |
done |
done |
888 |
#echo 'LIST='${LIST}'<' |
fi |
889 |
#- remove duplicate and non-directory: |
#echo 'LIST='${LIST}'<' |
890 |
TESTDIRS=" " |
#- skip dirs, remove duplicate and non-directory: |
891 |
for xx in $LIST |
TESTDIRS=" " |
892 |
do |
count=0 |
893 |
|
for xx in $LIST |
894 |
|
do |
895 |
|
yy=`echo $SKIPDIRS | grep -c $xx` |
896 |
|
if test $yy = 0 ; then |
897 |
if test -d $xx ; then |
if test -d $xx ; then |
898 |
yy=`echo $TESTDIRS | grep -c $xx` |
yy=`echo $TESTDIRS | grep -c $xx` |
899 |
if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi |
if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi |
900 |
else |
else count=1 ; |
901 |
echo " -- skip \"$xx\" : not a directory !" |
echo ""; echo -n " -- skip \"$xx\" (not a directory !)" |
902 |
fi |
fi |
903 |
done |
else |
904 |
fi |
if test $count = 1 ; then echo -n ", \"$xx\"" |
905 |
|
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
906 |
|
fi |
907 |
|
fi |
908 |
|
done |
909 |
|
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
910 |
#echo 'TESTDIRS='${TESTDIRS}'<' |
#echo 'TESTDIRS='${TESTDIRS}'<' |
911 |
|
|
912 |
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |
921 |
OUTPUTFILE="output.txt" |
OUTPUTFILE="output.txt" |
922 |
fi |
fi |
923 |
|
|
|
if test "x$ADM" = xt -a "x$COMMAND" = x ; then |
|
|
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
|
|
fi |
|
|
|
|
924 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
925 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
926 |
fi |
fi |
927 |
|
if test "x$MPI" = xt ; then |
928 |
|
OUTPUTFILE="STDOUT.0000" |
929 |
|
fi |
930 |
|
|
931 |
#echo "OK" |
#echo "OK" |
932 |
echo "OK (COMMAND= $COMMAND )" |
echo "OK (COMMAND= $COMMAND )" |
994 |
echo |
echo |
995 |
echo >> $SUMMARY |
echo >> $SUMMARY |
996 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x ; then |
997 |
line_0=" ----T----- ----S----- ----U----- ----V-----" |
if [ $MATCH_CRIT -lt 10 ] ; |
998 |
|
then line_0=" "$MATCH_CRIT ; |
999 |
|
else line_0=" "$MATCH_CRIT ; fi |
1000 |
|
line_0=" $line_0 ----T----- ----S----- ----U----- ----V-----" |
1001 |
|
# line_0=" ----T----- ----S----- ----U----- ----V-----" |
1002 |
line_1="G D M c m s m s m s m s" |
line_1="G D M c m s m s m s m s" |
1003 |
line_2="E p a R g m m e . m m e . m m e . m m e ." |
line_2="E p a R g m m e . m m e . m m e . m m e ." |
1004 |
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" |
1104 |
#echo "ex_run_dirs='$ex_run_dirs'" |
#echo "ex_run_dirs='$ex_run_dirs'" |
1105 |
for exd in $ex_run_dirs ; do |
for exd in $ex_run_dirs ; do |
1106 |
name=`echo $exd | sed -e 's/input.//g'` |
name=`echo $exd | sed -e 's/input.//g'` |
1107 |
outf="$dir/results/output.txt.$name" |
outf="$dir/results/output.$name.txt" |
1108 |
if test -f $outf -a -r $outf ; then |
if test -f $outf -a -r $outf ; then |
1109 |
if test "x$MULTI_THREAD" = "xt" ; then |
if test "x$MULTI_THREAD" = "xt" ; then |
1110 |
if test -r $dir"/"$exd"/eedata.mth" ; then |
if test -r $dir"/"$exd"/eedata.mth" ; then |
1147 |
&& makemodel $dir/$builddir && make=Y \ |
&& makemodel $dir/$builddir && make=Y \ |
1148 |
&& linkdata $dir/$rundir $input_dirs \ |
&& linkdata $dir/$rundir $input_dirs \ |
1149 |
&& runmodel $dir/$rundir && run=Y \ |
&& runmodel $dir/$rundir && run=Y \ |
1150 |
&& results=`testoutput $dir $rundir` |
&& results=`testoutput $dir $rundir "txt"` |
1151 |
fi |
fi |
1152 |
|
|
1153 |
echo |
echo |
1172 |
run_clean $dir/tr_run.$ex |
run_clean $dir/tr_run.$ex |
1173 |
linkdata $dir/tr_run.$ex input.$ex input |
linkdata $dir/tr_run.$ex input.$ex input |
1174 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1175 |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
&& results=`testoutput $dir tr_run.$ex ${ex}".txt"` |
1176 |
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}` |
1177 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1178 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1243 |
fi |
fi |
1244 |
fi |
fi |
1245 |
|
|
1246 |
# rm -f tmp_cmpnum.f a.out |
rm -f tr_cmpnum.c tr_cmpnum |
|
rm -f tmp_cmpnum.c tmp_cmpnum |
|
1247 |
|
|
1248 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1249 |
cat $SUMMARY | sed 's/ -- -- -- --//g' |
cat $SUMMARY | sed 's/ -- -- -- --//g' |