15 |
echo " (-mpi) use MPI to compile and run on 2 processors" |
echo " (-mpi) use MPI to compile and run on 2 processors" |
16 |
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" |
17 |
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" |
18 |
echo " (-ieee/-noieee) if possible, use IEEE compiler flags" |
echo " (-fast) use optfile default for compiler flags (no '-ieee')" |
19 |
echo " (DEF=\"-ieee\")" |
echo " DEF=off => use IEEE numerics option (if available)" |
20 |
|
echo " (-devel) use optfile developement flags (if available)" |
21 |
echo " (-gsl) compile with \"-gsl\" flag" |
echo " (-gsl) compile with \"-gsl\" flag" |
22 |
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" |
23 |
echo " (-optfile|-of) STRING list of optfiles to use" |
echo " (-optfile|-of) STRING list of optfiles to use" |
48 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
49 |
echo " (DEF=\"$MATCH_CRIT\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
50 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
51 |
|
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
52 |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
53 |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
54 |
|
echo " (-obj) only produces objects (=norun & no executable)" |
55 |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
56 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
57 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
241 |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"` |
242 |
fi |
fi |
243 |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi |
if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi |
|
#- report to this experiment local summary file --- |
|
|
echo "MACH='$MACH'" > $locDIR"/summary.txt" |
|
|
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
|
|
echo "DATE='$DATE'" >> $locDIR"/summary.txt" |
|
|
grep '(PID\.TID 0000\.0001) n.. =' $1/$2/$OUTPUTFILE \ |
|
|
| sed 's/(PID.TID 0000.0001) //' >> $locDIR"/summary.txt" |
|
244 |
echo "listVar='$listVar'" >> $locDIR"/summary.txt" |
echo "listVar='$listVar'" >> $locDIR"/summary.txt" |
245 |
#--- |
#--- |
246 |
allargs="" |
allargs="" |
251 |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
252 |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
253 |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
254 |
'Cost') testoutput_var $1 "ADM precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;; |
'Cost') testoutput_var $1 "ADM ref_cost_function" "ADM CostFct" $2 $3; yy=$? ;; |
255 |
'Grad') testoutput_var $1 "ADM precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;; |
'AdGrd') testoutput_var $1 "ADM adjoint_gradient" "ADM Ad Grad" $2 $3; yy=$? ;; |
256 |
|
'FDGrd') testoutput_var $1 "ADM finite-diff_grad" "ADM FD Grad" $2 $3; yy=$? ;; |
257 |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
258 |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
259 |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
342 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
343 |
command="$command -optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
344 |
fi |
fi |
345 |
if test "x$IEEE" != x ; then |
if test $OptLev = 1 ; then |
346 |
command="$command -ieee" |
command="$command -ieee" |
347 |
|
fi |
348 |
|
if test $OptLev = 0 ; then |
349 |
|
command="$command -devel" |
350 |
fi |
fi |
351 |
if test "x$GSL" = xt ; then |
if test "x$GSL" = xt ; then |
352 |
command="$command -gsl" |
command="$command -gsl" |
361 |
if test "x$USE_R4" = xt ; then |
if test "x$USE_R4" = xt ; then |
362 |
command="$command -use_r4" |
command="$command -use_r4" |
363 |
fi |
fi |
364 |
|
if test "x$EXTRFLG" != x ; then |
365 |
|
command="$command -extra_flag $EXTRFLG" |
366 |
|
fi |
367 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
368 |
command="$command -ts" |
command="$command -ts" |
369 |
fi |
fi |
434 |
find . -name "*.data" -exec rm {} \; |
find . -name "*.data" -exec rm {} \; |
435 |
find . -name "fort.*" -exec rm {} \; |
find . -name "fort.*" -exec rm {} \; |
436 |
find . -type l -exec rm {} \; |
find . -type l -exec rm {} \; |
437 |
rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime |
#- should remove executable only if sym-link (alredy done above) |
438 |
|
rm -f $RUNLOG *.txt STD* *diagnostics.log datetime |
439 |
rm -rf mnc_test_* |
rm -rf mnc_test_* |
440 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
rm -f *_MIT_CE_000.opt0000 costfunction*0000 |
441 |
echo successful |
echo successful |
471 |
{ |
{ |
472 |
# makemodel directory |
# makemodel directory |
473 |
( |
( |
474 |
|
mk_fail=0 |
475 |
if test "x$NOMAKE" = xt ; then |
if test "x$NOMAKE" = xt ; then |
476 |
cd $1; |
cd $1; |
477 |
if test -x $EXECUTABLE ; then |
if test -x $EXECUTABLE ; then |
478 |
echo "make skipped!" |
echo "make skipped!" |
479 |
else |
else |
480 |
echo "no executable!" |
echo "no executable!" |
481 |
return 2 |
mk_fail=3 |
482 |
fi |
fi |
483 |
else |
else |
484 |
cd $1; |
cd $1; |
485 |
if test -r Makefile ; then |
if test -r Makefile ; then |
486 |
printf 'make ... ' |
printf 'make ... ' |
487 |
if test "x$ADM" = xt ; then |
$MAKE $TARG >> make.tr_log 2>&1 |
|
$MAKE adall >> make.tr_log 2>&1 |
|
|
elif test "x$OADM" = xt ; then |
|
|
$MAKE adAll >> make.tr_log 2>&1 |
|
|
else |
|
|
if test "x$JOBS" = x ; then |
|
|
$MAKE >> make.tr_log 2>&1 |
|
|
else |
|
|
$MAKE -j $JOBS >> make.tr_log 2>&1 |
|
|
fi |
|
|
fi |
|
488 |
RETVAL=$? |
RETVAL=$? |
489 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
490 |
tail make.tr_log |
tail make.tr_log |
491 |
echo failed |
echo failed |
492 |
cp make.tr_log genmake.log genmake.tr_log $CDIR |
cp genmake.log genmake.tr_log $CDIR |
493 |
|
tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail" |
494 |
rm -f $EXECUTABLE |
rm -f $EXECUTABLE |
495 |
return 1 |
mk_fail=1 |
496 |
else |
else |
497 |
echo successful |
echo successful |
498 |
fi |
fi |
499 |
|
else |
500 |
|
echo "no Makefile !" |
501 |
|
mk_fail=2 |
502 |
fi |
fi |
503 |
fi |
fi |
504 |
|
if test "x$ADM" = xt -a -f taf_ad.log ; then |
505 |
|
head -1 taf_ad.log >> $CDIR"/summary.txt" |
506 |
|
nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` |
507 |
|
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` |
508 |
|
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
509 |
|
>> $CDIR"/summary.txt" |
510 |
|
fi |
511 |
|
if test $mk_fail != 0 ; then return $mk_fail ; fi |
512 |
) |
) |
513 |
} |
} |
514 |
|
|
515 |
mk_mpi_size() |
mk_mpi_size() |
516 |
{ |
{ |
517 |
# mk_mpi_size input_file output_file proc_Nb |
# mk_mpi_size input_file output_file proc_Nb prefer_to_split_X |
518 |
# |
# |
519 |
# make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file) |
# make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file) |
520 |
# for an MPI build with no more than proc_Nb processors ; |
# for an MPI build with no more than proc_Nb processors ; |
523 |
inp=$1 |
inp=$1 |
524 |
out=$2 |
out=$2 |
525 |
np=$3 |
np=$3 |
526 |
|
dirX=$4 |
527 |
tmp=TTT.$$ |
tmp=TTT.$$ |
528 |
|
|
529 |
px=`grep "^ & *nPx *=" $inp | sed "s/^ & *nPx *= *//" | sed 's/, *$//'` |
px=`grep "^ & *nPx *=" $inp | sed "s/^ & *nPx *= *//" | sed 's/, *$//'` |
541 |
if [ `expr $py % $j` -eq 0 ] ; then |
if [ `expr $py % $j` -eq 0 ] ; then |
542 |
ij=`expr $i \* $j` |
ij=`expr $i \* $j` |
543 |
if [ $ij -gt $pp ] ; then |
if [ $ij -gt $pp ] ; then |
544 |
|
flag=1 |
545 |
|
elif [ $ij -eq $pp ] ; then |
546 |
|
flag=$dirX |
547 |
|
else |
548 |
|
flag=0 |
549 |
|
fi |
550 |
|
if test $flag = 1 ; then |
551 |
if [ $ij -le $np ] ; then |
if [ $ij -le $np ] ; then |
552 |
ix=$i ; jy=$j ; pp=$ij |
ix=$i ; jy=$j ; pp=$ij |
553 |
#echo " ix,jy= $ix,$jy" |
#echo " ix,jy= $ix,$jy" |
698 |
( |
( |
699 |
cd $1 |
cd $1 |
700 |
printf 'runmodel in %s ... ' $1 |
printf 'runmodel in %s ... ' $1 |
701 |
|
if test "x$MPI" != x0 ; then |
702 |
|
#- adjust the MPI run command with the right number of Procs |
703 |
|
#echo '' ; echo " COMMAND='$COMMAND'" |
704 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
705 |
|
if test "x$MPI_MFILE" != x ; then |
706 |
|
COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
707 |
|
fi |
708 |
|
#echo " COMMAND='$COMMAND'" |
709 |
|
fi |
710 |
if test -L $EXECUTABLE ; then |
if test -L $EXECUTABLE ; then |
711 |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
if test -x "../"$builddir"/"$EXECUTABLE ; then |
712 |
cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
718 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
719 |
ln -sf "../"$builddir"/"$EXECUTABLE . |
ln -sf "../"$builddir"/"$EXECUTABLE . |
720 |
fi |
fi |
|
if test "x$MPI" != x0 ; then |
|
|
#- adjust the MPI run command with the right number of Procs |
|
|
#echo '' ; echo " COMMAND='$COMMAND'" |
|
|
COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"` |
|
|
if test "x$MPI_MFILE" != x ; then |
|
|
COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"` |
|
|
fi |
|
|
#echo " COMMAND='$COMMAND'" |
|
|
fi |
|
721 |
if test ! -x $EXECUTABLE ; then |
if test ! -x $EXECUTABLE ; then |
722 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $RUNLOG ; touch $RUNLOG |
723 |
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 |
727 |
else |
else |
728 |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then |
729 |
# output do not exist or is older than executable: |
# output do not exist or is older than executable: |
730 |
rm -f $RUNLOG ; touch $RUNLOG |
rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG |
731 |
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 |
732 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
( eval $COMMAND ) >> $RUNLOG 2>&1 |
733 |
RETVAL=$? |
RETVAL=$? |
746 |
fi |
fi |
747 |
fi |
fi |
748 |
rm -f run.log_tmp |
rm -f run.log_tmp |
749 |
|
#- in all cases where OutputFile exists, report SIZE (and AD time) |
750 |
|
if test -f $OUTPUTFILE ; then |
751 |
|
grep '(PID\.TID 0000\.0001) n.. =' $OUTPUTFILE \ |
752 |
|
| sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" |
753 |
|
if test "x$ADM" = xt ; then |
754 |
|
grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt" |
755 |
|
fi |
756 |
|
fi |
757 |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
758 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
759 |
echo successful |
echo successful |
760 |
printf '=> output from running in %s :\n' $1 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
761 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
|
# === Reduce the size of the testing emails! |
|
|
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
|
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
762 |
return 0 |
return 0 |
763 |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
764 |
#-- for some weird cases (run is finihed but with error code) |
#-- for some weird cases (run is finihed but with error code) |
771 |
printf '=> output from running in %s :\n' $1 1>&2 |
printf '=> output from running in %s :\n' $1 1>&2 |
772 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
tail $RUNLOG | sed 's/^.*/> &/g' 1>&2 |
773 |
cp $RUNLOG $CDIR"/"$RUNLOG |
cp $RUNLOG $CDIR"/"$RUNLOG |
|
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
|
774 |
return 1 |
return 1 |
775 |
fi |
fi |
776 |
) |
) |
872 |
|
|
873 |
check_eedata() |
check_eedata() |
874 |
{ |
{ |
875 |
# check_eedata size.h eedata |
# check_eedata eedata size.h |
876 |
if [ $# -eq 2 ] ; then |
if [ $# -eq 2 ] ; then |
877 |
if test -f $1 -a -f $2 ; then |
if test -f $1 -a -f $2 ; then |
878 |
sx=`grep "^ & *nSx *=" $1 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
879 |
nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
sx=`grep "^ & *nSx *=" $2 | sed "s/^ & *nSx *=//" | sed 's/, *$//'` |
880 |
if test "x$nx" = x ; then |
if test "x$nx" = x ; then |
881 |
rx=10 |
rx=10 |
882 |
else |
else |
883 |
rx=`expr $sx % $nx` |
rx=`expr $sx % $nx` |
884 |
fi |
fi |
885 |
sy=`grep "^ & *nSy *=" $1 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
886 |
ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
sy=`grep "^ & *nSy *=" $2 | sed "s/^ & *nSy *=//" | sed 's/, *$//'` |
887 |
if test "x$ny" = x ; then |
if test "x$ny" = x ; then |
888 |
ry=20 |
ry=20 |
889 |
else |
else |
890 |
ry=`expr $sy % $ny` |
ry=`expr $sy % $ny` |
891 |
fi |
fi |
892 |
echo `expr $rx + $ry` |
echo `expr $rx + $ry` |
893 |
else |
else |
894 |
echo '-1' |
echo '-1' |
895 |
fi |
fi |
896 |
|
elif [ $# -eq 1 ] ; then |
897 |
|
if test -f $1 ; then |
898 |
|
nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"` |
899 |
|
if test "x$nx" = x ; then nx=1 ; fi |
900 |
|
ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"` |
901 |
|
if test "x$ny" = x ; then ny=1 ; fi |
902 |
|
#echo $nx $ny |
903 |
|
echo $nx |
904 |
|
else |
905 |
|
echo '-1' |
906 |
|
fi |
907 |
else |
else |
908 |
echo '-2' |
echo '-2' |
909 |
fi |
fi |
916 |
# Default properties |
# Default properties |
917 |
debug=0 |
debug=0 |
918 |
verbose=1 |
verbose=1 |
919 |
|
NBLINES_MKLOG=16000 |
920 |
|
|
921 |
IEEE=true |
IEEE=true |
922 |
if test "x$MITGCM_IEEE" != x ; then |
if test "x$MITGCM_IEEE" != x ; then |
923 |
IEEE=$MITGCM_IEEE |
IEEE=$MITGCM_IEEE |
924 |
fi |
fi |
925 |
|
OptLev=1 |
926 |
GSL=f |
GSL=f |
927 |
|
|
928 |
CLEANUP=f |
CLEANUP=f |
951 |
CC=cc |
CC=cc |
952 |
fi |
fi |
953 |
JOBS= |
JOBS= |
954 |
|
TARG= |
955 |
MPI=0 |
MPI=0 |
956 |
MPI_MFILE= |
MPI_MFILE= |
957 |
MULTI_THREAD=f |
MULTI_THREAD=f |
958 |
OUTDIR= |
OUTDIR= |
959 |
DELDIR= |
DELDIR= |
960 |
USE_R4= |
USE_R4= |
961 |
|
EXTRFLG= |
962 |
|
|
963 |
ADM= |
ADM= |
964 |
OADM= |
OADM= |
1023 |
-j | --j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
1024 |
-j=* | --j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
1025 |
|
|
1026 |
|
-ef | --ef) ac_prev=EXTRFLG ;; |
1027 |
|
-ef=* | --ef=*) EXTRFLG=$ac_optarg ;; |
1028 |
|
|
1029 |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
1030 |
|
|
1031 |
-norun | --norun | -nr | --nr) NORUN=t ;; |
-norun | --norun | -nr | --nr) NORUN=t ;; |
1032 |
|
-obj | --obj ) TARG='obj' ; NORUN=t ;; |
1033 |
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
1034 |
-quick | --quick | -q | --q) QUICK=t ;; |
-quick | --quick | -q | --q) QUICK=t ;; |
1035 |
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
1051 |
-adm | -ad) ADM=t ;; |
-adm | -ad) ADM=t ;; |
1052 |
-oad) OADM=t; NODEPEND=t ;; |
-oad) OADM=t; NODEPEND=t ;; |
1053 |
|
|
1054 |
-ieee) IEEE=true ;; |
-ieee) echo "Warning: ignore option '-ieee' (already the default)" |
1055 |
-noieee) IEEE= ;; |
printf " ... " ;; |
1056 |
|
-noieee) echo "Warning: will use option '-fast' instead of '-noieee' (obsolete)" |
1057 |
|
printf " ... " ; OptLev=`expr $OptLev \* 2` ;; |
1058 |
|
-fast) OptLev=`expr $OptLev \* 2` ;; |
1059 |
|
-devel) OptLev=0 ;; |
1060 |
-gsl) GSL=t ;; |
-gsl) GSL=t ;; |
1061 |
|
|
1062 |
-verbose) verbose=2 ;; |
-verbose) verbose=2 ;; |
1105 |
|
|
1106 |
#- setting for forward or ADM testing |
#- setting for forward or ADM testing |
1107 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1108 |
|
if test "x$TARG" = xobj ; then TARG=adobj ; else TARG=adall ; fi |
1109 |
code_dir=code_ad |
code_dir=code_ad |
1110 |
inputdir=input_ad |
inputdir=input_ad |
1111 |
ref_outp="output_adm.txt" |
ref_outp="output_adm.txt" |
1112 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1113 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
1114 |
|
TARG=adAll |
1115 |
code_dir=code_oad |
code_dir=code_oad |
1116 |
inputdir=input_oad |
inputdir=input_oad |
1117 |
ref_outp="output_oadm.txt" |
ref_outp="output_oadm.txt" |
1118 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1119 |
else |
else |
1120 |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
1121 |
code_dir=code |
code_dir=code |
1122 |
inputdir=input |
inputdir=input |
1123 |
ref_outp="output.txt" |
ref_outp="output.txt" |
1196 |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
1197 |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
1198 |
else |
else |
1199 |
DEF_CHECK_LIST='Grad Cost Grad' |
DEF_CHECK_LIST='AdGrd Cost AdGrd FDGrd' |
1200 |
EMPTY_RESULTS='.. ..' |
EMPTY_RESULTS='.. ..' |
1201 |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
1202 |
fi |
fi |
1283 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1284 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
1285 |
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" |
1286 |
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 ." |
1287 |
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" |
1288 |
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 ." |
1289 |
for ii in $PTRACERS_NUM ; do |
for ii in $PTRACERS_NUM ; do |
1290 |
line_0="$line_0 --PTR 0"$ii"--" |
line_0="$line_0 --PTR 0"$ii"--" |
1307 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1308 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1309 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1310 |
G D M C G |
G D M C A F |
1311 |
E p a R o r |
e p a R o d D |
1312 |
N n k u s a |
n n k u s G G |
1313 |
2 d e n t d |
2 d e n t r r |
1314 |
|
|
1315 |
EOF |
EOF |
1316 |
fi |
fi |
1362 |
|
|
1363 |
# Check for specific files for particular type of run |
# Check for specific files for particular type of run |
1364 |
|
|
1365 |
|
if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" != "x0" ; then |
1366 |
|
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
1367 |
|
continue |
1368 |
|
fi |
1369 |
|
if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then |
1370 |
|
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
1371 |
|
continue |
1372 |
|
fi |
1373 |
|
|
1374 |
if test "x$MPI" != "x0" ; then |
if test "x$MPI" != "x0" ; then |
1375 |
if test -r $CODE_DIR"/SIZE.h_mpi" ; then |
prefer_X=0 |
1376 |
#- create new SIZE.h with no more than '$MPI' Procs |
if test "x$MULTI_THREAD" = "xt" ; then |
1377 |
mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI |
retv=`check_eedata $dir"/input/eedata.mth"` |
1378 |
LOC_NPROC=$? |
if test $retv = 1 ; then prefer_X=1 ; fi |
1379 |
( cd $BUILD_DIR |
fi |
1380 |
if test -r SIZE.h.mpi ; then |
#- create new SIZE.h with no more than '$MPI' Procs |
1381 |
cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$? |
mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI $prefer_X |
1382 |
else RETVAL=1 |
LOC_NPROC=$? |
1383 |
fi |
( cd $BUILD_DIR |
1384 |
if test "x$RETVAL" = x0 ; then |
if test -r SIZE.h.mpi ; then |
1385 |
rm -f tr_size.mpi |
cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$? |
1386 |
else |
else RETVAL=1 |
1387 |
rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi |
fi |
1388 |
fi |
if test "x$RETVAL" = x0 ; then |
1389 |
) |
rm -f tr_size.mpi |
1390 |
else |
else |
1391 |
echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir" |
rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi |
1392 |
continue |
fi |
1393 |
fi |
) |
1394 |
if test "x$MPI_MFILE" != x ; then |
if test "x$MPI_MFILE" != x ; then |
1395 |
#- create new MPI machine-file with the right number of Procs |
#- create new MPI machine-file with the right number of Procs |
1396 |
rm -f $LOC_MFILE |
rm -f $LOC_MFILE |
1406 |
echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC" |
echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC" |
1407 |
fi |
fi |
1408 |
fi |
fi |
1409 |
fi |
if test "x$MULTI_THREAD" = "xt" ; then |
1410 |
if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then |
retv=`check_eedata $dir"/input/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1411 |
echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir" |
if test $retv != 0 ; then |
1412 |
continue |
echo "input/eedata.mth tiling misfit -- skipping $dir" |
1413 |
fi |
continue |
1414 |
if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then |
fi |
|
retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"` |
|
|
if test $retv != 0 ; then |
|
|
echo "input/eedata.mth tiling misfit -- skipping $dir" |
|
|
continue |
|
1415 |
fi |
fi |
1416 |
fi |
fi |
1417 |
|
|
1431 |
if test "x$MPI" = "x0" ; then |
if test "x$MPI" = "x0" ; then |
1432 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1433 |
else |
else |
1434 |
retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"` |
retv=`check_eedata $dir"/"$exd"/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"` |
1435 |
if test $retv = 0 ; then |
if test $retv = 0 ; then |
1436 |
extra_runs="$extra_runs $name" |
extra_runs="$extra_runs $name" |
1437 |
else |
else |
1456 |
unset genmake makedepend make run |
unset genmake makedepend make run |
1457 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1458 |
|
|
1459 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir & summary.txt file for each tested experiment (tdir) |
1460 |
locDIR=$DRESULTS"/"$dir |
locDIR=$DRESULTS"/"$dir |
1461 |
mkdir $locDIR |
mkdir $locDIR |
1462 |
|
#- report to this experiment local summary file --- |
1463 |
|
echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt" |
1464 |
|
echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1465 |
|
echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1466 |
CDIR=`pwd`"/$locDIR" |
CDIR=`pwd`"/$locDIR" |
1467 |
|
|
1468 |
if test "x$NORUN" = xt ; then |
if test "x$NORUN" = xt ; then |
1488 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1489 |
echo 1>&2 |
echo 1>&2 |
1490 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
|
touch $locDIR"/summary.txt" |
|
1491 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
|
echo "tdir='$dir'" >> $locDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt" |
|
|
nerr=`grep -c 'TAF *.* ERROR ' $dir/$builddir/taf_ad.log` |
|
|
nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' $dir/$builddir/taf_ad.log` |
|
|
echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ |
|
|
>> $locDIR"/summary.txt" |
|
|
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
|
|
>> $locDIR"/summary.txt" |
|
|
fi |
|
1492 |
|
|
1493 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1494 |
unset run |
unset run |
1495 |
results=$EMPTY_RESULTS |
results=$EMPTY_RESULTS |
1496 |
# reference output file |
# reference output file |
1497 |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"` |
1498 |
# Create an output dir for each OPTFILE/tdir.ex combination |
# Create an output dir & summary.txt file for each extra run (tdir.ex) |
1499 |
locDIR=$DRESULTS"/"$dir"."$ex |
locDIR=$DRESULTS"/"$dir"."$ex |
1500 |
mkdir $locDIR |
mkdir $locDIR |
1501 |
|
#- report to this experiment local summary file --- |
1502 |
|
echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt" |
1503 |
|
#echo "MACH='$MACH'" >> $locDIR"/summary.txt" |
1504 |
|
#echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt" |
1505 |
CDIR=`pwd`"/$locDIR" |
CDIR=`pwd`"/$locDIR" |
1506 |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex" |
1507 |
run_clean $dir/$pfxdir.$ex |
run_clean $dir/$pfxdir.$ex |
1512 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1513 |
echo 1>&2 |
echo 1>&2 |
1514 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
|
touch $locDIR"/summary.txt" |
|
1515 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" |
|
echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt" |
|
|
if test "x$ADM" = xt ; then |
|
|
grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \ |
|
|
>> $locDIR"/summary.txt" |
|
|
fi |
|
1516 |
if test "x$POSTCLEAN" = x2 ; then |
if test "x$POSTCLEAN" = x2 ; then |
1517 |
run_clean $dir/$pfxdir.$ex |
run_clean $dir/$pfxdir.$ex |
1518 |
fi |
fi |
1540 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1541 |
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1542 |
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1543 |
| grep -v '^... compiler version ' > tr_1.tmp_log |
| grep -v '^... compiler version ' > tr_1.tmp_log |
1544 |
sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state |
1545 |
|
sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1546 |
>> $DRESULTS/genmake_state |
>> $DRESULTS/genmake_state |
1547 |
rm -f tr_1.tmp_log |
rm -f tr_1.tmp_log |
1548 |
fi |
fi |