/[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.13 by jmc, Sat Dec 26 01:59:17 2009 UTC
# Line 4  Line 4 
4  # $Name$  # $Name$
5    
6  Np=3  Np=3
7    MTH=
8    MTHo=
9    MTHa=
10  if [ $# -lt 1 ]  if [ $# -lt 1 ]
11  then  then
12    echo 'Usage:'`basename $0`' step '    echo 'Usage:'`basename $0`' step [-mth]'
13    echo ' => test coupled set-up on linux box (1.cpu)'    echo ' => test coupled set-up on linux box (1.cpu)'
14    echo 'step = 0 : clean all directories'    echo 'step = 0 : clean all directories'
15    echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'    echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'
# Line 14  then Line 17  then
17    echo "step = 3 : run with $Np mpi processes"    echo "step = 3 : run with $Np mpi processes"
18    echo 'step = 4 : check the results'    echo 'step = 4 : check the results'
19    echo 'step = 5 : remove output files in rank_0,1,2 dir.'    echo 'step = 5 : remove output files in rank_0,1,2 dir.'
20      echo '  -mth   : compile and run 2 threads for ocn & atm'
21    exit    exit
22    elif [ $# -eq 2 ] ; then
23      if test $2 = '-mth' ; then
24        MTH='-omp'
25        if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
26        if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
27      fi
28  fi  fi
29  kpr=$1  kpr=$1
30  dir=`pwd`  dir=`pwd`
# 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.13

  ViewVC Help
Powered by ViewVC 1.1.22