--- MITgcm/tools/example_scripts/csail/test_baudelaire 2010/11/03 19:44:49 1.3 +++ MITgcm/tools/example_scripts/csail/test_baudelaire 2010/12/26 17:02:44 1.4 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/example_scripts/csail/test_baudelaire,v 1.3 2010/11/03 19:44:49 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/example_scripts/csail/test_baudelaire,v 1.4 2010/12/26 17:02:44 jmc Exp $ # Ed Hill @@ -14,6 +14,12 @@ export LC_ALL="en_US.UTF-8" # Turn off stack limit for FIZHI & AD-tests ulimit -s unlimited +# MPI test (for now, only with gfortran) +#if test $MPI = 1 ; then + export MPI_GCC_DIR=/srv/software/gcc/gcc-packages/gcc-4.4.5/mpich2/mpich2-1.3 + export MPI_INC_DIR=$MPI_GCC_DIR/include + export PATH="$PATH:$MPI_GCC_DIR/bin" +#fi #- method to acces CVS: # export CVSROOT='/u/gcmpack' @@ -28,7 +34,7 @@ checkOut=1 sepDir=1 option= -tst_list='g7a adm g77 gfo+rs mth ifc' +tst_list='g7a adm mpa g77 gfo+rs mth mp2+rs mpi ifc' #tst_list='g77 adm gfo ifc mth pgi+rs' #tst_list='g77 gfo+rs mth' @@ -109,15 +115,23 @@ fi cd verification + MPI=0 case $typ in - 'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; - 'gfo'|'adm') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; - 'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; - 'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; - 'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' - export GOMP_STACKSIZE=400m ;; - *) OPTFILE= ;; + 'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; + 'gfo'|'adm'|'mth') OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; + 'ifc') OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; + 'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; + 'mpa'|'mpi'|'mp2') OPTFILE='../tools/build_options/linux_amd64_gfortran+mpi_generic' + MPI=1 ;; + *) OPTFILE= ;; esac + if test $typ = 'mth' -o $typ = 'mp2' ; then + export GOMP_STACKSIZE=400m + fi + if test $MPI = 1 ; then + export MPI_INC_DIR=$MPI_GCC_DIR/include + EXE="mpirun -np 2 ./mitgcmuv" + fi if test $sepDir = 0 -a $checkOut = '1' -a $tt = $firstTst ; then #-- cleaning: @@ -133,16 +147,19 @@ if test $typ = 'g77' then - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -a jmc@mitgcm.org" # comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo @@ -151,16 +168,19 @@ if test $typ = 'gfo' then - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -a jmc@mitgcm.org" comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo @@ -169,16 +189,19 @@ if test $typ = 'g7a' then - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -adm -a jmc@mitgcm.org" # comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -60 $tdir/output_$typ echo @@ -187,16 +210,19 @@ if test $typ = 'adm' then - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -adm -a jmc@mitgcm.org" comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -60 $tdir/output_$typ echo @@ -206,16 +232,19 @@ then source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -a jmc@mitgcm.org" # comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo @@ -225,16 +254,19 @@ then export OMP_NUM_THREADS=2 - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -mth -a jmc@mitgcm.org" comm="$comm -match $MC" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_$typ 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_$typ echo @@ -244,32 +276,107 @@ then export PGI=/srv/software/pgi/pgi-10.9 - export PATH=$PGI/linux86-64/10.9/bin:$PATH + export PATH="$PATH:$PGI/linux86-64/10.9/bin" export LM_LICENSE_FILE=$PGI/license.dat - echo "Running testreport using:" + echo -n "Running testreport using:" comm="./testreport -a jmc@mitgcm.org" # comm="$comm -match $MC" #comm="$comm -skd tutorial_advection_in_gyre" if test "x$OPTFILE" != x ; then comm="$comm -of=$OPTFILE" fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi if test "x$option" != x ; then comm="$comm $option" ; fi - echo " \"$comm\"" + echo " \"eval $comm\"" echo "======================" - $comm > $tdir/output_${typ} 2>&1 + eval $comm > $tdir/output_$typ 2>&1 tail -100 $tdir/output_${typ} echo fi +#-- MPI tests --- + if test $typ = 'mpa' + then + + EXE="mpirun -np 2 ./mitgcmuv_ad" + echo -n "Running testreport using:" + comm="./testreport -adm -a jmc@mitgcm.org" + comm="$comm -match $MC" + if test "x$OPTFILE" != x ; then + comm="$comm -of=$OPTFILE" + fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi + if test "x$option" != x ; then comm="$comm $option" ; fi + echo " \"eval $comm\"" + echo "======================" + eval $comm > $tdir/output_$typ 2>&1 + tail -60 $tdir/output_$typ + echo + + fi + + if test $typ = 'mpi' + then + + echo -n "Running testreport using:" + comm="./testreport -a jmc@mitgcm.org" + comm="$comm -match $MC" + if test "x$OPTFILE" != x ; then + comm="$comm -of=$OPTFILE" + fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi + if test "x$option" != x ; then comm="$comm $option" ; fi + echo " \"eval $comm\"" + echo "======================" + eval $comm > $tdir/output_$typ 2>&1 + tail -100 $tdir/output_$typ + echo + + fi + + if test $typ = 'mp2' + then + + export OMP_NUM_THREADS=2 + echo -n "Running testreport using:" + comm="./testreport -mth -a jmc@mitgcm.org" + comm="$comm -match $MC" + if test "x$OPTFILE" != x ; then + comm="$comm -of=$OPTFILE" + fi + if test $MPI = 1 ; then echo " (EXE='$EXE')" + comm="$comm -mpi -command \"\$EXE\"" + else echo '' ; fi + if test "x$option" != x ; then comm="$comm $option" ; fi + echo " \"eval $comm\"" + echo "======================" + eval $comm > $tdir/output_$typ 2>&1 + tail -100 $tdir/output_$typ + echo + + fi + #-- 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 + if test $MPI = 1 ; then + echo " \"$comm -mpi -exe $EXE\"" + echo "======================" + $comm -mpi -exe "$EXE" > $tdir/output_2+2 2>&1 + else + echo " \"$comm\"" + echo "======================" + $comm > $tdir/output_2+2 2>&1 + fi #tail -100 $tdir/output_2+2 echo ; cat tst_2+2_out.txt echo