#! /usr/bin/env bash # $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/example_scripts/csail/test_dickens,v 1.4 2009/04/16 19:06:45 jmc Exp $ # Ed Hill # Test script for MITgcm that should work on most of the csail.mit.edu # Linux machines. # defaults export PATH="$PATH:/usr/local/bin" TESTDIR="/tmp/jmc/test_"`hostname -s` MC=10 checkOut=1 sepDir=0 #tst_list='adm g77 pgi gfo ifc mth' tst_list='adm g77 gfo mth' # Turn off stack limit for FIZHI ulimit -s unlimited tdir=$TESTDIR if test $checkOut = '0' ; then if test -e $tdir/MITgcm/CVS ; then echo $tdir/MITgcm/CVS 'exist' echo -n "Update the MITgcm code from CVS pserver..." cd $tdir/MITgcm cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d > /dev/null echo " done" cd $tdir else echo -n $tdir/MITgcm 'missing ; ' checkOut=1 fi fi if test $checkOut = '1' ; then echo -n "Creating a temp directory ..." if test -e $tdir then test -e $tdir/MITgcm && rm -rf $tdir/MITgcm else mkdir $tdir fi echo " done" echo -n "Downloading the MITgcm code from CVS pserver..." cd $tdir #export CVSROOT='/u/gcmpack' #export CVSROOT=':ext:@mitgcm.org:/u/gcmpack' #export CVS_RSH='ssh' #cvs co -P MITgcm > /dev/null cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P MITgcm > /dev/null echo " done" fi #------------------------------------------------------------------------ for tt in $tst_list do echo "================================================================" typ=`echo $tt | sed 's/+rs//'` #- clean-up old output files rm -f $tdir/output_${typ}* if test $sepDir = 1 ; then new_dir="MITgcm_$typ" test -e $new_dir && rm -rf $new_dir mkdir $new_dir pushd $new_dir cp -ra ../MITgcm/* . else pushd MITgcm fi cd verification case $typ in 'g77') OPTFILE='../tools/build_options/linux_amd64_g77' ;; 'gfo') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; 'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; 'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort' ;; 'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; 'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' export GOMP_STACKSIZE=400m ;; *) OPTFILE= ;; esac if test $typ = 'g77' then echo "Running testreport using:" comm="./testreport -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo #-- also test restart (test 2+2=4) if test $tt != $typ then echo "testing restart using:" comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" echo " \"$comm\"" echo "======================" $comm > $tdir/output_2+2 2>&1 #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo fi fi if test $typ = 'gfo' then echo "Running testreport using:" comm="./testreport -match $MC -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo #-- also test restart (test 2+2=4) if test $tt != $typ then echo "testing restart using:" comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" echo " \"$comm\"" echo "======================" $comm > $tdir/output_2+2 2>&1 #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo fi fi if test $typ = 'adm' then echo "Running testreport using:" comm="./testreport -adm -match $MC -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_$typ 2>&1 tail -60 $tdir/output_$typ echo fi if test $typ = 'ifc' then echo "Running testreport using:" comm="./testreport -match $MC -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo #-- also test restart (test 2+2=4) if test $tt != $typ then echo "testing restart using:" comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" echo " \"$comm\"" echo "======================" $comm > $tdir/output_2+2 2>&1 #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo fi fi if test $typ = 'mth' then export OMP_NUM_THREADS=2 echo "Running testreport using:" comm="./testreport -mth -match $MC -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo #-- also test restart (test 2+2=4) if test $tt != $typ then echo "testing restart using:" comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" echo " \"$comm\"" echo "======================" $comm > $tdir/output_2+2 2>&1 #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo fi export OMP_NUM_THREADS=1 fi if test $typ = 'pgi' then export PGI=/usr/local/pkg/pgi/pgi-6.1-5 echo "Running testreport using:" comm="./testreport -match $MC -dd" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_${typ}_1 2>&1 tail -100 $tdir/output_${typ}_1 echo echo "Running testreport using:" comm="./testreport -match $MC -q -a jmc@mitgcm.org" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi echo " \"$comm\"" echo "======================" $comm > $tdir/output_${typ}_2 2>&1 tail -100 $tdir/output_${typ}_2 echo #-- also test restart (test 2+2=4) if test $tt != $typ then echo "testing restart using:" comm="../tools/do_tst_2+2 -a jmc@mitgcm.org" echo " \"$comm\"" echo "======================" $comm > $tdir/output_2+2 2>&1 #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo fi fi if test $sepDir = 0 ; then #-- cleaning: echo "======================" echo "Cleaning test directories:" ./testreport -clean > /dev/null 2>&1 echo "======================" echo fi popd done