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\")" |
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\")" |
20 |
echo " (-t|-tdir)STRING list of test dirs to use" |
echo " (-t|-tdir) STRING list of test dirs to use" |
21 |
echo " (DEF=\"\" which builds all)" |
echo " (DEF=\"\" which builds all)" |
22 |
echo " (-b|-bash)STRING location of \"bash\" executable" |
echo " (-b|-bash) STRING preferred location of a \"bash\" or" |
23 |
echo " (DEF=\"\" for \"/bin/bash\")" |
echo " Bourne-compatible \"sh\" shell" |
24 |
echo " (-command)STRING command to run" |
echo " (DEF=\"\" for \"bash\")" |
25 |
|
echo " (-command) STRING command to run" |
26 |
echo " (DEF=\"make output.txt\")" |
echo " (DEF=\"make output.txt\")" |
27 |
echo " (-m|-make)STRING command to use for \"make\"" |
echo " (-m|-make) STRING command to use for \"make\"" |
28 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
29 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
30 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
46 |
echo -n "building the mpack utility... " |
echo -n "building the mpack utility... " |
47 |
if test ! -x "$MPACKDIR/mpack" ; then |
if test ! -x "$MPACKDIR/mpack" ; then |
48 |
if test ! -d $MPACKDIR ; then |
if test ! -d $MPACKDIR ; then |
49 |
|
echo |
50 |
echo "Error: can't find \"$MPACKDIR\"" |
echo "Error: can't find \"$MPACKDIR\"" |
51 |
echo " are you sure this program is being run in the correct " |
echo " are you sure this program is being run in the correct " |
52 |
echo " (that is, \"MITGCM_ROOT\verification\") directory?" |
echo " (that is, \"MITGCM_ROOT\verification\") directory?" |
53 |
exit 1 |
echo |
54 |
|
HAVE_MPACK=f |
55 |
fi |
fi |
56 |
echo -n "building mpack... " |
echo -n "building mpack... " |
57 |
( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1 |
( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1 |
59 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
60 |
echo |
echo |
61 |
echo "Error building the mpack tools at: $MPACK_DIR" |
echo "Error building the mpack tools at: $MPACK_DIR" |
62 |
exit 1 |
echo |
63 |
|
HAVE_MPACK=f |
64 |
|
else |
65 |
|
HAVE_MPACK=t |
66 |
fi |
fi |
67 |
|
else |
68 |
|
HAVE_MPACK=t |
69 |
fi |
fi |
70 |
echo "OK" |
echo "OK" |
71 |
} |
} |
198 |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
command="$GENMAKE2 -ds -m $MAKE --mods=../code" |
199 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
200 |
command="$command --optfile=$OPTFILE" |
command="$command --optfile=$OPTFILE" |
|
# echo " command=\"$command\"" |
|
201 |
fi |
fi |
202 |
if test "x$IEEE" != x ; then |
if test "x$IEEE" != x ; then |
203 |
command="$command -ieee" |
command="$command -ieee" |
204 |
fi |
fi |
|
# echo "command: \"$command\"" |
|
205 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
206 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
207 |
RETVAL=$? |
RETVAL=$? |
208 |
for i in genmake_state genmake_optfile genmake_local Makefile ; do |
cp Makefile $CDIR |
|
if test -r $i ; then |
|
|
cp $i $CDIR |
|
|
fi |
|
|
done |
|
209 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
210 |
tail make.log |
tail make.log |
211 |
echo "genmakemodel: genmake failed" 1>&2 |
echo "genmakemodel: genmake failed" 1>&2 |
212 |
cp make.log $CDIR |
cp genmake_* make.log $CDIR |
213 |
return 1 |
return 1 |
214 |
else |
else |
215 |
echo "succesful" 1>&2 |
echo "successful" 1>&2 |
216 |
fi |
fi |
217 |
) |
) |
218 |
fi |
fi |
240 |
return 1 |
return 1 |
241 |
fi |
fi |
242 |
fi |
fi |
243 |
echo succesful 1>&2 |
echo successful 1>&2 |
244 |
exit 0 |
exit 0 |
245 |
) |
) |
246 |
fi |
fi |
263 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
264 |
return 1 |
return 1 |
265 |
else |
else |
266 |
echo succesful 1>&2 |
echo successful 1>&2 |
267 |
fi |
fi |
268 |
) |
) |
269 |
fi |
fi |
284 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
285 |
return 1 |
return 1 |
286 |
else |
else |
287 |
echo succesful 1>&2 |
echo successful 1>&2 |
288 |
fi |
fi |
289 |
fi |
fi |
290 |
) |
) |
316 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
317 |
( |
( |
318 |
cd $1 |
cd $1 |
319 |
printf 'runmodel: ' 1>&2 |
printf 'runmodel ... ' 1>&2 |
320 |
# make output.txt |
# make output.txt |
321 |
$COMMAND |
$COMMAND >> run.log 2>&1 |
322 |
RETVAL=$? |
RETVAL=$? |
323 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
324 |
|
echo successful 1>&2 |
325 |
cp output.txt $CDIR"/output.txt" |
cp output.txt $CDIR"/output.txt" |
326 |
return 0 |
return 0 |
327 |
else |
else |
328 |
|
tail run.log |
329 |
|
echo failed 1>&2 |
330 |
|
cp run.log $CDIR"/run.log" |
331 |
return 1 |
return 1 |
332 |
fi |
fi |
333 |
) |
) |
363 |
end |
end |
364 |
EOFA |
EOFA |
365 |
|
|
366 |
f77 tmp_cmpnum.f |
f77 -o a.out tmp_cmpnum.f |
367 |
if [ -x ./a.out ]; then |
if [ -x ./a.out ]; then |
368 |
echo "OK" |
echo "OK" |
369 |
return 0 |
return 0 |
370 |
else |
else |
371 |
echo |
echo |
372 |
echo "createcodelet: failed to compile codelet" |
echo "ERROR: failed to compile comparison code" |
373 |
exit 1 |
exit 1 |
374 |
fi |
fi |
375 |
} |
} |
429 |
|
|
430 |
|
|
431 |
############################################################################### |
############################################################################### |
|
############################################################################### |
|
|
############################################################################### |
|
432 |
|
|
433 |
|
|
434 |
# Default properties |
# Default properties |
455 |
ADDRESSES= |
ADDRESSES= |
456 |
TESTDIRS= |
TESTDIRS= |
457 |
MPACKDIR="../tools/mpack-1.6" |
MPACKDIR="../tools/mpack-1.6" |
458 |
|
HAVE_MPACK= |
459 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
460 |
COMMAND="make output.txt" |
COMMAND="make output.txt" |
461 |
MAKE=make |
MAKE=make |
581 |
mkdir $DRESULTS |
mkdir $DRESULTS |
582 |
RETVAL=$? |
RETVAL=$? |
583 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
584 |
echo "Error: can't create results directory \"./$DRESULTS\"" |
echo "ERROR: Can't create results directory \"./$DRESULTS\"" |
585 |
exit 1 |
exit 1 |
586 |
fi |
fi |
587 |
SUMMARY="$DRESULTS/summary.txt" |
SUMMARY="$DRESULTS/summary.txt" |
588 |
echo -n "Start time: " >> $SUMMARY |
echo -n "Start time: " >> $SUMMARY |
589 |
start_date=`date` |
start_date=`date` |
590 |
echo $start_date > $SUMMARY |
echo $start_date > $SUMMARY |
|
cat << EOF >> $SUMMARY |
|
|
T S U V |
|
|
G D M c m s m s m s m s |
|
|
E p a R g m m e . m m e . m m e . m m e . |
|
|
N n k u 2 i a a d i a a d i a a d i a a d |
|
|
2 d e n d n x n . n x n . n x n . n x n . |
|
|
|
|
|
EOF |
|
|
|
|
|
NDIR=0 |
|
591 |
|
|
592 |
of_path= |
of_path= |
593 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
601 |
fi |
fi |
602 |
file=${OPTFILE##*/} |
file=${OPTFILE##*/} |
603 |
OPTFILE=$of_path/$file |
OPTFILE=$of_path/$file |
604 |
|
cp $OPTFILE $DRESULTS |
605 |
|
echo >> $SUMMARY |
606 |
|
echo " OPTFILE=$OPTFILE" >> $SUMMARY |
607 |
else |
else |
608 |
echo |
echo | tee $SUMMARY |
609 |
echo "WARNING: can't read OPTFILE=\"$OPTFILE\" but will try to use it..." |
echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY |
610 |
|
exit 1 |
611 |
fi |
fi |
612 |
|
else |
613 |
|
echo >> $SUMMARY |
614 |
|
echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY |
615 |
|
echo " so the genmake default will be used." >> $SUMMARY |
616 |
fi |
fi |
617 |
echo |
echo |
|
echo "OPTFILE=$OPTFILE" >> $SUMMARY |
|
618 |
echo >> $SUMMARY |
echo >> $SUMMARY |
619 |
|
cat << EOF | tee -a $SUMMARY |
620 |
|
T S U V |
621 |
|
G D M c m s m s m s m s |
622 |
|
E p a R g m m e . m m e . m m e . m m e . |
623 |
|
N n k u 2 i a a d i a a d i a a d i a a d |
624 |
|
2 d e n d n x n . n x n . n x n . n x n . |
625 |
|
|
626 |
|
EOF |
627 |
|
|
628 |
# ...and each test directory... |
# ...and each test directory... |
629 |
for dir in $TESTDIRS ; do |
for dir in $TESTDIRS ; do |
704 |
fi |
fi |
705 |
|
|
706 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir for each OPTFILE/tdir combination |
707 |
CDIR=$DRESULTS"/"$DRESULTS"_"$NDIR |
rel_CDIR=$DRESULTS"/"$dir |
708 |
mkdir $CDIR |
mkdir $rel_CDIR |
709 |
CDIR=`pwd`"/$CDIR" |
CDIR=`pwd`"/$rel_CDIR" |
710 |
|
|
711 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
712 |
makeclean $dir/$builddir |
makeclean $dir/$builddir |
721 |
fi |
fi |
722 |
|
|
723 |
echo |
echo |
724 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
|
${run:-N} $results |
|
725 |
echo |
echo |
726 |
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
echo "$fres" >> $SUMMARY |
727 |
${run:-N} $results >> $SUMMARY |
echo "fresults='$fres'" > $CDIR"/summary.txt" |
|
echo "fresults='" > $CDIR"/summary.txt" |
|
|
formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} \ |
|
|
${run:-N} $results >> $CDIR"/summary.txt" |
|
|
echo "'" >> $CDIR"/summary.txt" |
|
728 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
729 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
730 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
731 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
732 |
|
|
|
( |
|
|
cd $DRESULTS |
|
|
tar -cf $NDIR".tar" $DRESULTS"_"$NDIR > /dev/null 2>&1 |
|
|
gzip $NDIR".tar" |
|
|
) |
|
|
|
|
|
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
|
|
echo "No mail sent" |
|
|
else |
|
|
$MPACK -s MITgcm-test -m 1000000 $DRESULTS"/"$NDIR".tar.gz" $ADDRESSES |
|
|
RETVAL=$? |
|
|
if test "x$RETVAL" != x0 ; then |
|
|
echo "Warning: \"$MPACK\" failed -- please contact <edhill@mitgcm.org>" |
|
|
else |
|
|
rm -f $DRESULTS"/"$NDIR".tar*" |
|
|
fi |
|
|
fi |
|
|
|
|
733 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
734 |
|
|
|
NDIR=$(( $NDIR + 1 )) |
|
|
|
|
735 |
done |
done |
736 |
|
|
737 |
echo -n "Start time: " >> $SUMMARY |
echo -n "Start time: " >> $SUMMARY |
739 |
echo -n "End time: " >> $SUMMARY |
echo -n "End time: " >> $SUMMARY |
740 |
date >> $SUMMARY |
date >> $SUMMARY |
741 |
|
|
742 |
|
# If addresses were supplied and mpack built successfully, then try |
743 |
|
# to send email using mpack. |
744 |
|
if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then |
745 |
|
echo "No results email was sent." |
746 |
|
else |
747 |
|
if test "x$HAVE_MPACK" = xt ; then |
748 |
|
tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ |
749 |
|
&& gzip $DRESULTS".tar" \ |
750 |
|
&& $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES |
751 |
|
RETVAL=$? |
752 |
|
if test "x$RETVAL" != x0 ; then |
753 |
|
echo |
754 |
|
echo "Warning: The tar, gzip, & mpack step failed. Please send email" |
755 |
|
echo " to <MITgcm-support@mitgcm.org> for help. You may copy the " |
756 |
|
echo " summary of results from the directory \"$DRESULTS\"." |
757 |
|
echo |
758 |
|
else |
759 |
|
echo |
760 |
|
echo "An email containing results was sent to the following addresses:" |
761 |
|
echo " \"$ADDRESSES\"" |
762 |
|
echo |
763 |
|
fi |
764 |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
765 |
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
766 |
|
fi |
767 |
|
fi |
768 |
|
|
769 |
rm tmp_cmpnum.f a.out |
rm tmp_cmpnum.f a.out |
770 |
|
|
771 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |