/[MITgcm]/MITgcm/verification/cpl_aim+ocn/run_cpl_test
ViewVC logotype

Diff of /MITgcm/verification/cpl_aim+ocn/run_cpl_test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.12 by jmc, Wed Apr 29 19:25:29 2009 UTC revision 1.15 by jmc, Wed Jan 13 00:25:37 2010 UTC
# Line 4  Line 4 
4  # $Name$  # $Name$
5    
6  Np=3  Np=3
7  if [ $# -lt 1 ]  #- parse options:
8    MTH=
9    MTHo=
10    MTHa=
11    if [ $# -ge 1 ] ; then if test $1 = '-mth' ; then
12      MTH='-omp' ; shift
13      if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
14      if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
15    fi ; fi
16    if [ $# -ne 1 ]
17  then  then
18    echo 'Usage:'`basename $0`' step '    echo 'Usage:'`basename $0`' [opt] step'
19    echo ' => test coupled set-up on linux box (1.cpu)'    echo ' => test coupled set-up on linux box (1.cpu)'
20    echo 'step = 0 : clean all directories'    echo 'opt = -mth : compile and run (if eedata.mth) 2-threads for ocn & atm'
21    echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'    echo ' step = 0 : clean all directories'
22    echo 'step = 2 : copy input files and dir(s)'    echo ' step = 1 : compile the 3 executables (cpl,ocn,atm)'
23    echo "step = 3 : run with $Np mpi processes"    echo ' step = 2 : copy input files and dir(s)'
24    echo 'step = 4 : check the results'    echo " step = 3 : run with $Np mpi processes"
25    echo 'step = 5 : remove output files in rank_0,1,2 dir.'    echo ' step = 4 : check the results'
26      echo ' step = 5 : remove output files in rank_0,1,2 dir.'
27    exit    exit
28  fi  fi
29  kpr=$1  kpr=$1
# Line 50  then Line 60  then
60   then   then
61     OPTFILE=`ls ../linux_*+mpi`     OPTFILE=`ls ../linux_*+mpi`
62     zz=`grep '^FC=' $OPTFILE`     zz=`grep '^FC=' $OPTFILE`
63     echo " Using optfile: $OPTFILE  (compiler=$zz)"     echo " Using optfile: $OPTFILE  (compiler=$zz) $MTH"
64   else echo 'Pb in finding optfile' ; exit;   else echo 'Pb in finding optfile' ; exit;
65   fi   fi
66   zz=`echo $OPTFILE | grep -c '^\/'`   zz=`echo $OPTFILE | grep -c '^\/'`
# Line 72  then Line 82  then
82   echo '==== compile OGCM:'   echo '==== compile OGCM:'
83   cd build_ocn   cd build_ocn
84   echo ' --- genmake2 (ocn):'   echo ' --- genmake2 (ocn):'
85   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi $MTHo -ieee >  TTT.genmake.$$
86   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
87   echo ' --- make depend (ocn):'   echo ' --- make depend (ocn):'
88   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 85  then Line 95  then
95   echo '==== compile AGCM:'   echo '==== compile AGCM:'
96   cd build_atm   cd build_atm
97   echo ' --- genmake2 (atm):'   echo ' --- genmake2 (atm):'
98   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi $MTHa -ieee >  TTT.genmake.$$
99   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
100   echo ' --- make depend (atm):'   echo ' --- make depend (atm):'
101   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 109  then Line 119  then
119    cp -p -r input_ocn rank_1    cp -p -r input_ocn rank_1
120    cd rank_1    cd rank_1
121    ./prepare_run    ./prepare_run
122      if test "x$MTHo" != x ; then
123        echo " MTH run: mv -f eedata.mth eedata"
124        mv -f eedata.mth eedata
125      fi
126    cd $dir    cd $dir
127    
128    echo 'CP dir:' input_atm '->' rank_2    echo 'CP dir:' input_atm '->' rank_2
129    cp -p -r input_atm rank_2    cp -p -r input_atm rank_2
130    cd rank_2    cd rank_2
131    ./prepare_run    ./prepare_run
132      if test "x$MTHa" != x ; then
133        echo " MTH run: mv -f eedata.mth eedata"
134        mv -f eedata.mth eedata
135      fi
136    cd $dir    cd $dir
137    
138  fi  fi
# Line 135  then Line 153  then
153   done   done
154    
155   cd $ROOTDIR   cd $ROOTDIR
156     if test "x$MTH" != x ; then
157       export OMP_NUM_THREADS=2 ; export KMP_STACKSIZE=400m
158       if test "x$MTHo" != x ; then
159         echo -n " run OCN ($MTHo) with $OMP_NUM_THREADS threads ;"
160       fi
161       if test "x$MTHa" != x ; then
162         echo -n " run ATM ($MTHa) with $OMP_NUM_THREADS threads ;"
163       fi
164       echo ""
165     fi
166  # /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group -wd $ROOTDIR --gm-kill 5 -v  ./build_cpl/mitgcmuv > std_outp 2>&1  # /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group -wd $ROOTDIR --gm-kill 5 -v  ./build_cpl/mitgcmuv > std_outp 2>&1
167   mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1   mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
168   tail -20 std_outp   tail -20 std_outp
# Line 164  then Line 192  then
192      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
193      mv -f comp_res.log comp_res.sice      mv -f comp_res.log comp_res.sice
194      echo ' '      echo ' '
195   else echo 'No Atmos output file in rank_1' ; fi   else echo 'No Atmos output file in rank_2' ; fi
196    
197  fi  fi
198    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22