13 |
echo " (-help|-h) print usage" |
echo " (-help|-h) print usage" |
14 |
echo " (-mpi) use MPI input files" |
echo " (-mpi) use MPI input files" |
15 |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
echo " (-ieee|-noieee) if possible, use IEEE compiler flags" |
16 |
echo " (DEF=\"noieee\")" |
echo " (DEF=\"-ieee\")" |
17 |
echo " (-optfile=|-of=)STRING list of optfiles to use" |
echo " (-optfile=|-of=)STRING list of optfiles to use" |
18 |
echo " (-a|-addr) STRING list of email recipients" |
echo " (-a|-addr) STRING list of email recipients" |
19 |
echo " (DEF=\"edhill@mitgcm.org\")" |
echo " (DEF=\"edhill@mitgcm.org\")" |
27 |
echo " (DEF=\"make output.txt\")" |
echo " (DEF=\"make output.txt\")" |
28 |
echo " (-m|-make) STRING command to use for \"make\"" |
echo " (-m|-make) STRING command to use for \"make\"" |
29 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
30 |
|
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
31 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
32 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
33 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
236 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
237 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
238 |
RETVAL=$? |
RETVAL=$? |
239 |
cp Makefile $CDIR |
# Reduce the size of the testing emails! |
240 |
|
# cp Makefile $CDIR |
241 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
242 |
tail make.log |
tail make.log |
243 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" 1>&2 |
309 |
if test -r Makefile ; then |
if test -r Makefile ; then |
310 |
printf 'make ... ' 1>&2 |
printf 'make ... ' 1>&2 |
311 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x ; then |
312 |
$MAKE >> make.log 2>&1 |
if test "x$JOBS" = x ; then |
313 |
|
$MAKE >> make.log 2>&1 |
314 |
|
else |
315 |
|
$MAKE -j $JOBS >> make.log 2>&1 |
316 |
|
fi |
317 |
else |
else |
318 |
$MAKE adall >> make.log 2>&1 |
$MAKE adall >> make.log 2>&1 |
319 |
fi |
fi |
340 |
code_dir=$2 |
code_dir=$2 |
341 |
BUILD_DIR=$dir/$3 |
BUILD_DIR=$dir/$3 |
342 |
CODE_DIR=$dir/$code_dir |
CODE_DIR=$dir/$code_dir |
343 |
|
|
344 |
# These are files that should replace their counter-part when using -mpi |
# These are files that should replace their counter-part when using -mpi |
345 |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")` |
MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")` |
346 |
|
|
355 |
RETVAL=$? |
RETVAL=$? |
356 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
357 |
if ! test -f $BUILD_DIR/$i ; then |
if ! test -f $BUILD_DIR/$i ; then |
358 |
#echo Linking $name to $i |
#echo Linking $name to $i |
359 |
(cd $BUILD_DIR; ln -sf ../$code_dir/$i $name) |
(cd $BUILD_DIR; ln -sf ../$code_dir/$i $name) |
360 |
fi |
fi |
361 |
fi |
fi |
362 |
done |
done |
363 |
else |
else |
364 |
# NO: We undo any _mpi symbolically linked files |
# NO: We undo any _mpi symbolically linked files |
365 |
for ii in $MPI_FILES ; do |
for ii in $MPI_FILES ; do |
366 |
i=`echo $ii | sed 's:^\./::'` |
i=`echo $ii | sed 's:^\./::'` |
367 |
name=`echo $i | sed 's:_mpi::' ` |
name=`echo $i | sed 's:_mpi::' ` |
368 |
if test -L $BUILD_DIR/$name ; then |
if test -L $BUILD_DIR/$name ; then |
369 |
linktarg=`(cd $BUILD_DIR; readlink $name)` |
cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1 |
370 |
if test $linktarg = "../$code_dir/$name"_mpi ; then |
RETVAL=$? |
371 |
#echo Un-linking $name from $linktarg |
if test "x$RETVAL" = x0 ; then |
372 |
|
#echo Un-linking $name from $linktarg |
373 |
rm -f $BUILD_DIR/$name |
rm -f $BUILD_DIR/$name |
374 |
fi |
fi |
375 |
fi |
fi |
422 |
printf 'runmodel ... ' 1>&2 |
printf 'runmodel ... ' 1>&2 |
423 |
# make output.txt |
# make output.txt |
424 |
echo |
echo |
425 |
|
rm -f run.log |
426 |
# echo "COMMAND='$COMMAND'" |
# echo "COMMAND='$COMMAND'" |
427 |
# echo "pwd='"`pwd`"'" |
# echo "pwd='"`pwd`"'" |
428 |
( eval $COMMAND ) >> run.log 2>&1 |
( eval $COMMAND ) > run.log 2>&1 |
429 |
RETVAL=$? |
RETVAL=$? |
430 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
431 |
|
tail run.log |
432 |
echo successful 1>&2 |
echo successful 1>&2 |
433 |
if test "x$ADM" = x ; then |
# === Reduce the size of the testing emails! |
434 |
cp output.txt $CDIR"/output.txt" |
# if test "x$ADM" = x ; then |
435 |
else |
# cp output.txt $CDIR"/output.txt" |
436 |
cp output.txt_adm $CDIR"/output.txt_adm" |
# else |
437 |
fi |
# cp output.txt_adm $CDIR"/output.txt_adm" |
438 |
|
# fi |
439 |
return 0 |
return 0 |
440 |
else |
else |
441 |
tail run.log |
tail run.log |
577 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
578 |
COMMAND= |
COMMAND= |
579 |
MAKE=make |
MAKE=make |
580 |
|
JOBS= |
581 |
MPI=f |
MPI=f |
582 |
DELDIR= |
DELDIR= |
583 |
|
|
632 |
-make=* | --make=*) |
-make=* | --make=*) |
633 |
MAKE=$ac_optarg ;; |
MAKE=$ac_optarg ;; |
634 |
|
|
635 |
|
-j) ac_prev=JOBS ;; |
636 |
|
-j=*) JOBS=$ac_optarg ;; |
637 |
|
|
638 |
-clean | --clean) |
-clean | --clean) |
639 |
CLEANUP=t ;; |
CLEANUP=t ;; |
640 |
|
|
693 |
fi |
fi |
694 |
|
|
695 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
696 |
COMMAND="make output.txt" |
COMMAND="$MAKE output.txt" |
697 |
fi |
fi |
698 |
|
|
699 |
echo "OK" |
echo "OK" |
882 |
OLD_COMMAND=$COMMAND |
OLD_COMMAND=$COMMAND |
883 |
COMMAND="./mitgcmuv > output.txt" |
COMMAND="./mitgcmuv > output.txt" |
884 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
885 |
test -e "$dir/tr_run" && rm -rf "$dir/tr_run" |
test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex" |
886 |
mkdir "$dir/tr_run" |
mkdir "$dir/tr_run.$ex" |
887 |
links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
888 |
( |
( |
889 |
cd "$dir/tr_run" |
cd "$dir/tr_run.$ex" |
890 |
for i in $links; do |
for i in $links; do |
891 |
ln -s ../input/$i $i |
ln -s ../input/$i $i |
892 |
done |
done |
893 |
) |
) |
894 |
links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
895 |
( |
( |
896 |
cd "$dir/tr_run" |
cd "$dir/tr_run.$ex" |
897 |
for i in $links; do |
for i in $links; do |
898 |
test -e $i && rm -f $i |
test -e $i && rm -f $i |
899 |
ln -s ../input.$ex/$i $i |
ln -s ../input.$ex/$i $i |
900 |
done |
done |
901 |
ln -s ../$builddir/mitgcmuv mitgcmuv |
ln -s ../$builddir/mitgcmuv mitgcmuv |
902 |
) |
) |
903 |
runmodel $dir/tr_run && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
904 |
&& results=`testoutput $dir tr_run "."$ex` |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
905 |
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}` |
906 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
907 |
fres="$fres.$ex" |
fres="$fres.$ex" |
943 |
if test "x$HAVE_MPACK" = xt ; then |
if test "x$HAVE_MPACK" = xt ; then |
944 |
tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ |
tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ |
945 |
&& gzip $DRESULTS".tar" \ |
&& gzip $DRESULTS".tar" \ |
946 |
&& $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES |
&& $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES |
947 |
RETVAL=$? |
RETVAL=$? |
948 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
949 |
echo |
echo |