11 |
echo |
echo |
12 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
13 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
14 |
|
echo " ---- type of test : ----" |
15 |
|
echo " (-tlm) perform a Tangent Linear run" |
16 |
|
echo " (-adm|-ad) perform an adjoint run" |
17 |
|
echo " (-oad) perform an OpenAD adjoint run" |
18 |
echo " (-mth) run multi-threaded (using eedata.mth)" |
echo " (-mth) run multi-threaded (using eedata.mth)" |
19 |
echo " (-mpi) use MPI to compile and run on 2 processors" |
echo " (-mpi) use MPI to compile and run on 2 processors" |
20 |
echo " (-MPI) NUMBER use MPI to compile and run on max NUMBER procs" |
echo " (-MPI) NUMBER use MPI to compile and run on max NUMBER procs" |
21 |
echo " (-mfile|-mf) STRING MPI: file with list of possible machines to run on" |
echo " (-mfile|-mf) STRING MPI: file with list of possible machines to run on" |
22 |
|
echo " (-command|-c) STRING command to run (e.g., if non-standard MPI setting)" |
23 |
|
echo " DEF='mitgcmuv' or ='mpirun -np TR_NPROC mitgcmuv'" |
24 |
|
echo " ---- testing options : ----" |
25 |
|
echo " (-optfile|-of) STRING list of optfiles to use" |
26 |
echo " (-fast) use optfile default for compiler flags (no '-ieee')" |
echo " (-fast) use optfile default for compiler flags (no '-ieee')" |
27 |
echo " DEF=off => use IEEE numerics option (if available)" |
echo " DEF=off => use IEEE numerics option (if available)" |
28 |
echo " (-devel) use optfile developement flags (if available)" |
echo " (-devel) use optfile developement flags (if available)" |
29 |
echo " (-gsl) compile with \"-gsl\" flag" |
echo " (-gsl) compile with \"-gsl\" flag" |
30 |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" |
|
echo " (-optfile|-of) STRING list of optfiles to use" |
|
|
echo " (-addr|-a) STRING list of email recipients" |
|
|
echo " (DEF=\"\" no email is sent)" |
|
|
echo " (-mpackdir|-mpd) DIR location of the mpack utility" |
|
|
echo " (DEF=\"../tools/mpack-1.6\")" |
|
31 |
echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" |
echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" |
32 |
echo " (recognized groups: basic, tutorials)" |
echo " (recognized groups: basic, tutorials)" |
33 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
35 |
echo " test THIS_EXP + all the following)" |
echo " test THIS_EXP + all the following)" |
36 |
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
echo " (-skipdir|-skd) STRING list of exp. dirs to skip" |
37 |
echo " (DEF=\"\" which test all)" |
echo " (DEF=\"\" which test all)" |
38 |
echo " (-bash|-b) STRING preferred location of a \"bash\" or" |
echo " (-ts) provide timing information per timestep" |
39 |
echo " Bourne-compatible \"sh\" shell" |
echo " (-papis) provide MFlop/s per timestep using PAPI" |
40 |
|
echo " (-pcls) provide MFlop/s per timestep using PCL" |
41 |
|
echo " ---- system options : ----" |
42 |
|
echo " (-bash|-b) STRING preferred location of a \"bash\" or \"sh\" shell" |
43 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
44 |
echo " (-tlm) perform a Tangent Linear run" |
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
|
echo " (-adm|-ad) perform an adjoint run" |
|
|
echo " (-oad) perform an OpenAD adjoint run" |
|
|
echo " (-command|-c) STRING command to run" |
|
45 |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
46 |
echo " (-make|-m) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
47 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
48 |
echo " (-odir) STRING used to build output directory name" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
49 |
echo " (DEF=\"hostname\")" |
echo " ---- output options : ----" |
|
# echo " (-ptracers|-ptr) STRING specify which ptracers to test" |
|
|
# echo " (DEF=\"1 2 3 4 5\")" |
|
50 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
51 |
echo " (DEF=\"$MATCH_CRIT\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
52 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-odir) STRING used to build output directory name" |
53 |
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
echo " (DEF=\"hostname\")" |
54 |
|
echo " (-addr|-a) STRING list of email recipients" |
55 |
|
echo " (DEF=\"\" no email is sent)" |
56 |
|
echo " (-send) STRING sending command (instead of using mpack)" |
57 |
|
echo " (-savdir|-sd) STRING location to save output tar file to send (DEF='$SAVDIR')" |
58 |
|
echo " (-mpackdir|-mpd) DIR location of the mpack utility" |
59 |
|
echo " (DEF=\"../tools/mpack-1.6\")" |
60 |
|
echo " -- do only some parts: --" |
61 |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
62 |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
63 |
echo " (-obj) only produces objects (=norun & no executable)" |
echo " (-obj) only produces objects (=norun & no executable)" |
69 |
echo " (-postclean|-pc) after each exp. test, clean build-dir & run-dir" |
echo " (-postclean|-pc) after each exp. test, clean build-dir & run-dir" |
70 |
echo " (-deloutp|-do) delete output files after successful run" |
echo " (-deloutp|-do) delete output files after successful run" |
71 |
echo " (-deldir|-dd) on success, delete the output directory" |
echo " (-deldir|-dd) on success, delete the output directory" |
|
echo " (-ts) provide timing information per timestep" |
|
|
echo " (-papis) provide MFlop/s per timestep using PAPI" |
|
|
echo " (-pcls) provide MFlop/s per timestep using PCL" |
|
72 |
echo |
echo |
73 |
echo "and where STRING can be a whitespace-delimited list" |
echo "and where STRING can be a whitespace-delimited list" |
74 |
echo "such as:" |
echo "such as:" |
130 |
echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2 |
echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2 |
131 |
fi |
fi |
132 |
if [ -r $1/$4/$OUTPUTFILE ]; then |
if [ -r $1/$4/$OUTPUTFILE ]; then |
133 |
grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt |
grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > ${TMP}a.txt |
134 |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' ` |
135 |
if [ $lncntA -lt 2 ]; then |
if [ $lncntA -lt 2 ]; then |
136 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
137 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
138 |
fi |
fi |
139 |
rm -f tmp1.txt ; return 99 |
rm -f ${TMP}a.txt ; return 99 |
140 |
fi |
fi |
141 |
else |
else |
142 |
echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2 |
echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2 |
145 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
146 |
echo testoutput_var: grep "$2" $1/$5 1>&2 |
echo testoutput_var: grep "$2" $1/$5 1>&2 |
147 |
fi |
fi |
148 |
grep "$2" $1/$5 | sed 's/.*=//' | cat -n > tmp2.txt |
grep "$2" $1/$5 | sed 's/.*=//' | cat -n > ${TMP}b.txt |
149 |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' ` |
150 |
if [ $lncntB -lt 2 ]; then |
if [ $lncntB -lt 2 ]; then |
151 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
152 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
153 |
fi |
fi |
154 |
rm -f tmp1.txt tmp2.txt ; return 99 |
rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 |
155 |
fi |
fi |
156 |
if [ $lncntA -ne $lncntB ]; then |
if [ $lncntA -ne $lncntB ]; then |
157 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
158 |
echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2 |
echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2 |
159 |
fi |
fi |
160 |
rm -f tmp1.txt tmp2.txt ; return 99 |
rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 |
161 |
fi |
fi |
162 |
has_nan=`cat tmp1.txt | grep -i nan | wc -l` |
has_nan=`cat ${TMP}a.txt | grep -i nan | wc -l` |
163 |
if [ $has_nan -gt 0 ] ; then |
if [ $has_nan -gt 0 ] ; then |
164 |
echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values 1>&2 |
echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values 1>&2 |
165 |
rm -f tmp1.txt tmp2.txt ; return 99 |
rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 |
166 |
fi |
fi |
167 |
has_inf=`cat tmp1.txt | grep -i inf | wc -l` |
has_inf=`cat ${TMP}a.txt | grep -i inf | wc -l` |
168 |
if [ $has_inf -gt 0 ] ; then |
if [ $has_inf -gt 0 ] ; then |
169 |
echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values 1>&2 |
echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values 1>&2 |
170 |
rm -f tmp1.txt tmp2.txt ; return 99 |
rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 |
171 |
fi |
fi |
172 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
173 |
echo testoutput_var: join tmp1.txt tmp2.txt 1>&2 |
echo testoutput_var: join ${TMP}a.txt ${TMP}b.txt 1>&2 |
174 |
fi |
fi |
175 |
join tmp1.txt tmp2.txt | awk '{print $1 " " $2 " " $3}' > tmp3.txt |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
176 |
|
join ${TMP}a.txt ${TMP}b.txt | awk '{print $1 " " $2 " " $3}' | sed -e 's|:||g' > ${TMP}c.txt |
177 |
if [ $debug -gt 0 ]; then |
if [ $debug -gt 0 ]; then |
178 |
echo testoutput_var: compare_lines 1>&2 |
echo testoutput_var: compare_lines 1>&2 |
179 |
fi |
fi |
180 |
if [ $verbose -gt 1 ]; then |
if [ $verbose -gt 1 ]; then |
181 |
cat tmp3.txt 1>&2 |
cat ${TMP}c.txt 1>&2 |
182 |
fi |
fi |
183 |
echo "-1" >> tmp3.txt |
echo "-1" >> ${TMP}c.txt |
184 |
# On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number |
digits_of_similarity=`./tr_cmpnum < ${TMP}c.txt` |
|
cat tmp3.txt | sed -e 's|:||g' > tmp4.txt |
|
|
digits_of_similarity=`./tr_cmpnum < tmp4.txt` |
|
185 |
if [ $digits_of_similarity -eq 99 ]; then |
if [ $digits_of_similarity -eq 99 ]; then |
186 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
187 |
echo testoutput_var: No comparison was available for \"$3\" 1>&2 |
echo testoutput_var: No comparison was available for \"$3\" 1>&2 |
192 |
echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2 |
echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2 |
193 |
fi |
fi |
194 |
fi |
fi |
195 |
rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt |
rm -f ${TMP}a.txt ${TMP}b.txt ${TMP}c.txt |
196 |
|
|
197 |
return $digits_of_similarity |
return $digits_of_similarity |
198 |
} |
} |
331 |
'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; |
'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; |
332 |
'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; |
'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; |
333 |
'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; |
'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; |
334 |
|
'sbo_M') testoutput_var $1 "sbo_mass" "SBO mass" $2 $refoutp ; yy=$? ;; |
335 |
|
'sboFW') testoutput_var $1 "sbo_mass_fw" "SBO m-FW" $2 $refoutp ; yy=$? ;; |
336 |
|
'sboAc') testoutput_var $1 "sbo_zoamc" "SBO AM-C" $2 $refoutp ; yy=$? ;; |
337 |
|
'sboAp') testoutput_var $1 "sbo_zoamp" "SBO AM-P" $2 $refoutp ; yy=$? ;; |
338 |
'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; |
'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; |
339 |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
340 |
esac |
esac |
372 |
if test "x$MKDEPEND" != x ; then |
if test "x$MKDEPEND" != x ; then |
373 |
command="$command -makedepend=$MKDEPEND" |
command="$command -makedepend=$MKDEPEND" |
374 |
fi |
fi |
375 |
if test $KIND = 1 -o $KIND = 2 ; then |
if test $KIND = 4 ; then |
376 |
command="$command --mods=../code_ad" |
command="$command -oad -mods=../$code_dir" |
|
elif test $KIND = 4 ; then |
|
|
command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'" |
|
377 |
else |
else |
378 |
command="$command -mods=../code" |
command="$command -mods=../$code_dir" |
379 |
fi |
fi |
380 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
381 |
command="$command -optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
432 |
makeclean() |
makeclean() |
433 |
{ |
{ |
434 |
# makeclean directory |
# makeclean directory |
435 |
if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi |
if test "x$NOGENMAKE" = xf ; then rm -f $1/make.tr_log ; fi |
436 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
437 |
echo "make Clean skipped!" |
echo "make Clean skipped!" |
438 |
else |
else |
464 |
if test "x$NOCLEAN" = xt ; then |
if test "x$NOCLEAN" = xt ; then |
465 |
echo "run_clean skipped!" |
echo "run_clean skipped!" |
466 |
else |
else |
467 |
( |
( |
468 |
cd $1; |
cd $1; |
469 |
printf 'clean run-dir ... ' |
printf 'clean run-dir ... ' |
470 |
# part of what is done after "make clean" when doing "make CLEAN" |
# part of what is done after "make clean" when doing "make CLEAN" |
471 |
find . -name "*.meta" -exec rm {} \; |
find . -name "*.meta" -exec rm {} \; |
472 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
473 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
474 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
475 |
#- should remove executable only if sym-link (alredy done above) |
#- should remove executable only if sym-link (already done above) |
476 |
rm -f $RUNLOG *.txt STD* w2_tile_topology.????.log *diagnostics.log datetime |
rm -f $RUNLOG *.txt STDOUT.* STDERR.* *diagnostics.log *.[0-9][0-9][0-9][0-9].log |
477 |
rm -rf mnc_test_* |
rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_* |
478 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
479 |
rm -f oad_cp.000.[0-9][0-9][0-9][0-9][0-9] |
rm -f oad_cp.[0-9][0-9][0-9].????? |
480 |
echo successful |
rm -rf mnc_test_* |
481 |
exit 0 |
echo successful |
482 |
) |
exit 0 |
483 |
|
) |
484 |
fi |
fi |
485 |
} |
} |
486 |
|
|
554 |
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` |
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` |
555 |
if test -f taf_output ; then |
if test -f taf_output ; then |
556 |
n2er=`grep -c 'TAF *.* ERROR ' taf_output` |
n2er=`grep -c 'TAF *.* ERROR ' taf_output` |
557 |
nerr=`expr $nerr + $n2er` |
n3er=`grep -c '\*ERROR\* ' taf_output` |
558 |
|
nerr=`expr $nerr + $n2er + $n3er` |
559 |
fi |
fi |
560 |
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
561 |
>> $CDIR"/summary.txt" |
>> $CDIR"/summary.txt" |
804 |
# output do not exist or is older than executable: |
# output do not exist or is older than executable: |
805 |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
806 |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi |
807 |
#--a quick and dirty trick to run with Divided Adjoint (DIVA): |
#- Divided Adjoint Run: |
808 |
if test $KIND = 2 -a -x dorun.sh ; then |
# get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA" |
809 |
./dorun.sh >> $RUNLOG 2>&1 |
if test $KIND = 2 -a -f run_ADM_DIVA ; then |
810 |
else |
adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'` |
811 |
|
echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG |
812 |
|
eval "let $adm_diva_nb" |
813 |
|
if [ $add_DIVA_runs -ge 1 ] ; then |
814 |
|
rm -f costf* divided.ctrl snapshot* |
815 |
|
echo -n "(add_DIVA_runs=$add_DIVA_runs) ... " |
816 |
|
for ii in `seq 1 $add_DIVA_runs` ; do |
817 |
|
( eval $COMMAND ) >> $RUNLOG 2>&1 |
818 |
|
echo " additional DIVA run # $ii : done" >> $RUNLOG |
819 |
|
mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii} |
820 |
|
done |
821 |
|
fi |
822 |
|
fi |
823 |
|
#- special DIVA processing ends here |
824 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
|
fi |
|
|
#---------- |
|
825 |
RETVAL=$? |
RETVAL=$? |
826 |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` |
827 |
if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then |
if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then |
1037 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
1038 |
HAVE_MPACK= |
HAVE_MPACK= |
1039 |
MPACK= |
MPACK= |
1040 |
|
SENDCMD= |
1041 |
|
SAVDIR='.' |
1042 |
COMMAND= |
COMMAND= |
1043 |
MKDEPEND= |
MKDEPEND= |
1044 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
1094 |
-mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; |
-mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; |
1095 |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; |
-mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; |
1096 |
|
|
1097 |
|
-send | --send ) ac_prev=SENDCMD ;; |
1098 |
|
-send=* | --send=* ) SENDCMD=$ac_optarg ;; |
1099 |
|
-savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;; |
1100 |
|
-savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;; |
1101 |
|
|
1102 |
-tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; |
-tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; |
1103 |
-tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; |
-tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; |
1104 |
-skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; |
-skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; |
1296 |
|
|
1297 |
LOC_MFILE='tr_mpi_mfile' |
LOC_MFILE='tr_mpi_mfile' |
1298 |
RUNLOG="run.tr_log" |
RUNLOG="run.tr_log" |
1299 |
OUTPUTFILE=$ref_outp |
if test "x$MPI" = x0 ; then |
1300 |
if test "x$COMMAND" = x ; then |
OUTPUTFILE=$ref_outp |
1301 |
COMMAND="./$EXECUTABLE > $OUTPUTFILE" |
if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi |
1302 |
fi |
else |
1303 |
if test "x$MPI" != x0 ; then |
OUTPUTFILE="STDOUT.0000" |
1304 |
OUTPUTFILE="STDOUT.0000" |
if test "x$COMMAND" = x ; then COMMAND="mpirun -v -np TR_NPROC ./$EXECUTABLE" ; fi |
1305 |
fi |
fi |
1306 |
|
|
1307 |
echo "OK (COMMAND= $COMMAND )" |
echo "OK (COMMAND='$COMMAND')" |
1308 |
|
|
1309 |
|
TMP=./tr_$$ |
1310 |
|
#- try to put temporary files in system-local /tmp dir |
1311 |
|
#TMP=/tmp/tr_$$ |
1312 |
|
#touch $TMP ; retVal=$? |
1313 |
|
#if [ $retVal -eq 0 ] ; then |
1314 |
|
# if test ! -r $TMP ; then TMP=./tr_$$ ; fi |
1315 |
|
#else |
1316 |
|
# TMP=./tr_$$ |
1317 |
|
#fi |
1318 |
|
#rm -f $TMP |
1319 |
|
#if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi |
1320 |
|
|
1321 |
# set the Default List of output variables to be checked: |
# set the Default List of output variables to be checked: |
1322 |
# (use default or load experiment-specific list from file "tr_checklist") |
# (use default or load experiment-specific list from file "tr_checklist") |
1346 |
fi |
fi |
1347 |
|
|
1348 |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
1349 |
if test "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then |
1350 |
echo "skipping mpack build" |
echo "skipping mpack build" |
1351 |
else |
else |
1352 |
build_mpack |
build_mpack |
1353 |
|
if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi |
1354 |
fi |
fi |
1355 |
|
|
1356 |
# Create a uniquely named directory to store results |
# Create a uniquely named directory to store results |
1489 |
rm -f $EXECUTABLE *.bak |
rm -f $EXECUTABLE *.bak |
1490 |
rm -f genmake_state genmake_*optfile genmake.log |
rm -f genmake_state genmake_*optfile genmake.log |
1491 |
rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
rm -f SIZE.h.mpi genmake.tr_log make.tr_log |
1492 |
|
rm -rf mpi_headers |
1493 |
) |
) |
1494 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1495 |
echo -n ' --- dir:' $dir/$rundir ': ' |
echo -n ' --- dir:' $dir/$rundir ': ' |
1684 |
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1685 |
$SUMMARY > tmp.tr_log |
$SUMMARY > tmp.tr_log |
1686 |
RETVAL=$? |
RETVAL=$? |
1687 |
if test "x$RETVAL" = x0 ; then rm -f $SUMMARY |
if test "x$RETVAL" = x0 ; then |
1688 |
cp tmp.tr_log $SUMMARY |
cp -f tmp.tr_log $SUMMARY |
|
else rm -f tmp.tr_log |
|
1689 |
fi |
fi |
1690 |
|
rm -f tmp.tr_log |
1691 |
fi |
fi |
1692 |
gmkLog=$dir/$builddir/genmake.log |
gmkLog=$dir/$builddir/genmake.log |
1693 |
if test -r $gmkLog ; then |
if test -r $gmkLog ; then |
1731 |
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
1732 |
echo "No results email was sent." |
echo "No results email was sent." |
1733 |
else |
else |
1734 |
if test "x$HAVE_MPACK" = xt ; then |
if test "x$SENDCMD" != x ; then |
1735 |
tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ |
if [ $verbose -gt 1 ]; then |
1736 |
&& gzip $DRESULTS".tar" \ |
echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES" |
1737 |
&& $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES |
fi |
1738 |
|
tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \ |
1739 |
|
&& gzip ${SAVDIR}/${DRESULTS}".tar" \ |
1740 |
|
&& $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES |
1741 |
RETVAL=$? |
RETVAL=$? |
1742 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
1743 |
echo |
echo |
1750 |
echo "An email containing results was sent to the following addresses:" |
echo "An email containing results was sent to the following addresses:" |
1751 |
echo " \"$ADDRESSES\"" |
echo " \"$ADDRESSES\"" |
1752 |
echo |
echo |
1753 |
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
test -f ${SAVDIR}/${DRESULTS}".tar" && rm -f ${SAVDIR}/${DRESULTS}".tar" |
1754 |
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
test -f ${SAVDIR}/${DRESULTS}".tar.gz" && rm -f ${SAVDIR}/${DRESULTS}".tar.gz" |
1755 |
fi |
fi |
1756 |
fi |
fi |
1757 |
fi |
fi |