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:" |
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 |
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=$? |
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: |
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 |
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" |
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' |