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 " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
39 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
42 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
43 |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
echo " (-nodepend|-nd) skip the \"make depend\" stage" |
44 |
echo " (-deldir|-dd) on success, delete the output directory" |
echo " (-deldir|-dd) on success, delete the output directory" |
45 |
|
echo " (-ts) provide timing information per timestep" |
46 |
|
echo " (-papis) provide MFlop/s per timestep using PAPI" |
47 |
|
echo " (-pcls) provide MFlop/s per timestep using PCL" |
48 |
echo |
echo |
49 |
echo "and where STRING can be a whitespace-delimited list" |
echo "and where STRING can be a whitespace-delimited list" |
50 |
echo "such as:" |
echo "such as:" |
321 |
if test "x$MPI" = xt ; then |
if test "x$MPI" = xt ; then |
322 |
command="$command -mpi" |
command="$command -mpi" |
323 |
fi |
fi |
324 |
|
if test "x$TS" = xt ; then |
325 |
|
command="$command -ts" |
326 |
|
fi |
327 |
|
if test "x$PAPIS" = xt ; then |
328 |
|
command="$command -papis" |
329 |
|
else |
330 |
|
if test "x$PCLS" = xt ; then |
331 |
|
command="$command -pcls" |
332 |
|
fi |
333 |
|
fi |
334 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
335 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
336 |
RETVAL=$? |
RETVAL=$? |
666 |
|
|
667 |
} |
} |
668 |
|
|
|
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 |
|
|
} |
|
|
|
|
669 |
scandirs() |
scandirs() |
670 |
{ |
{ |
671 |
if [ $# -eq 1 ]; then |
if [ $# -eq 1 ]; then |
705 |
OPTFILE=NONE |
OPTFILE=NONE |
706 |
ADDRESSES= |
ADDRESSES= |
707 |
TESTDIRS= |
TESTDIRS= |
708 |
|
SKIPDIRS= |
709 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
710 |
HAVE_MPACK= |
HAVE_MPACK= |
711 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
761 |
-tdir=* | --tdir=*) |
-tdir=* | --tdir=*) |
762 |
TESTDIRS=$ac_optarg ;; |
TESTDIRS=$ac_optarg ;; |
763 |
|
|
764 |
|
-skipdir | --skipdir | -skd | --skd) |
765 |
|
ac_prev=SKIPDIRS ;; |
766 |
|
-skipdir=* | --skipdir=*) |
767 |
|
SKIPDIRS=$ac_optarg ;; |
768 |
|
|
769 |
-bash | --bash | -b | --b) |
-bash | --bash | -b | --b) |
770 |
ac_prev=BASH ;; |
ac_prev=BASH ;; |
771 |
-bash=* | --bash=*) |
-bash=* | --bash=*) |
824 |
|
|
825 |
-deldir | -dd) DELDIR=t ;; |
-deldir | -dd) DELDIR=t ;; |
826 |
|
|
827 |
|
-ts) TS=t;; |
828 |
|
|
829 |
|
-papis) PAPIS=t;; |
830 |
|
|
831 |
|
-pcls) PCL=t;; |
832 |
|
|
833 |
-*) |
-*) |
834 |
echo "Error: unrecognized option: "$ac_option |
echo "Error: unrecognized option: "$ac_option |
835 |
usage |
usage |
852 |
|
|
853 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
854 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
855 |
TESTDIRS=`scandirs results_ad` |
LIST=`scandirs results_ad` |
856 |
else |
else |
857 |
TESTDIRS=`scandirs results` |
LIST=`scandirs results` |
858 |
fi |
fi |
859 |
else |
else |
860 |
#- expand group of experiments: |
#- expand group of experiments: |
871 |
*) LIST=${LIST}" "$xx ;; |
*) LIST=${LIST}" "$xx ;; |
872 |
esac |
esac |
873 |
done |
done |
874 |
#echo 'LIST='${LIST}'<' |
fi |
875 |
#- remove duplicate and non-directory: |
#echo 'LIST='${LIST}'<' |
876 |
TESTDIRS=" " |
#- skip dirs, remove duplicate and non-directory: |
877 |
for xx in $LIST |
TESTDIRS=" " |
878 |
do |
count=0 |
879 |
|
for xx in $LIST |
880 |
|
do |
881 |
|
yy=`echo $SKIPDIRS | grep -c $xx` |
882 |
|
if test $yy = 0 ; then |
883 |
if test -d $xx ; then |
if test -d $xx ; then |
884 |
yy=`echo $TESTDIRS | grep -c $xx` |
yy=`echo $TESTDIRS | grep -c $xx` |
885 |
if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi |
if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi |
886 |
else |
else count=1 ; |
887 |
echo " -- skip \"$xx\" : not a directory !" |
echo ""; echo -n " -- skip \"$xx\" (not a directory !)" |
888 |
fi |
fi |
889 |
done |
else |
890 |
fi |
if test $count = 1 ; then echo -n ", \"$xx\"" |
891 |
|
else count=1 ; echo "" ; echo -n " skip: \"$xx\"" |
892 |
|
fi |
893 |
|
fi |
894 |
|
done |
895 |
|
if test $count = 1 ; then echo "" ; echo -n " ... " ; fi |
896 |
#echo 'TESTDIRS='${TESTDIRS}'<' |
#echo 'TESTDIRS='${TESTDIRS}'<' |
897 |
|
|
898 |
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |
if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then |