/[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.11 by jmc, Tue Nov 27 00:54:58 2007 UTC revision 1.16 by jmc, Mon Nov 22 19:03:43 2010 UTC
# Line 3  Line 3 
3  # $Header$  # $Header$
4  # $Name$  # $Name$
5    
6    #- default:
7  Np=3  Np=3
8  if [ $# -lt 1 ]  MTH=
9    MTHo=
10    MTHa=
11    GMKopt='-ieee'
12    
13    #- parse options:
14    if [ $# -ge 1 ] ; then if test $1 = '-mth' ; then
15      MTH='-omp' ; shift
16      if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
17      if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
18    fi ; fi
19    if [ $# -ne 1 ]
20  then  then
21    echo 'Usage:'`basename $0`' step '    echo 'Usage:'`basename $0`' [opt] step'
22    echo ' => test coupled set-up on linux box (1.cpu)'    echo ' => test coupled set-up on linux box (1.cpu)'
23    echo 'step = 0 : clean all directories'    echo 'opt = -mth : compile and run (if eedata.mth) 2-threads for ocn & atm'
24    echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'    echo ' step = 0 : clean all directories'
25    echo 'step = 2 : copy input files and dir(s)'    echo ' step = 1 : compile the 3 executables (cpl,ocn,atm)'
26    echo "step = 3 : run with $Np mpi processes"    echo ' step = 2 : copy input files and dir(s)'
27    echo 'step = 4 : check the results'    echo " step = 3 : run with $Np mpi processes"
28    echo 'step = 5 : remove output files in rank_0,1,2 dir.'    echo ' step = 4 : check the results'
29      echo ' step = 5 : remove output files in rank_0,1,2 dir.'
30    exit    exit
31  fi  fi
32  kpr=$1  kpr=$1
# Line 44  fi Line 57  fi
57  if test $kpr = 1  if test $kpr = 1
58  then  then
59    
60  #- choice of the optfile: take a local one in dir verification with sufix '.mpi'  #- choice of the optfile: take a local one in dir verification with sufix '+mpi'
61   nbOpF=`ls ../linux_*.mpi 2> /dev/null | wc -l`   nbOpF=`ls ../linux_* | grep '+mpi' 2> /dev/null | wc -l`
62   if test $nbOpF = 1   if test $nbOpF = 1
63   then   then
64     OPTFILE=`ls ../linux_*.mpi`     OPTFILE=`ls ../linux_* | grep '+mpi'`
65     zz=`grep '^FC=' $OPTFILE`     zz=`grep '^FC=' $OPTFILE`
66     echo " Using optfile: $OPTFILE  (compiler=$zz)"     echo " Using optfile: $OPTFILE  (compiler=$zz) $MTH"
67   else echo 'Pb in finding optfile' ; exit;   else
68       echo "Pb in finding optfile: found $nbOpF :"
69       ls ../linux_* | grep '+mpi' ; exit
70   fi   fi
71   zz=`echo $OPTFILE | grep -c '^\/'`   zz=`echo $OPTFILE | grep -c '^\/'`
72   if test $zz = 0 ; then OPTFILE="../$OPTFILE" ; fi   if test $zz = 0 ; then OPTFILE="../$OPTFILE" ; fi
# Line 59  then Line 74  then
74   echo '==== compile coupler:'   echo '==== compile coupler:'
75   cd build_cpl   cd build_cpl
76   echo ' --- genmake2 (cpl):'   echo ' --- genmake2 (cpl):'
77   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi $GMKopt >  TTT.genmake.$$
78   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
79   echo ' --- make depend (cpl):'   echo ' --- make depend (cpl):'
80   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 72  then Line 87  then
87   echo '==== compile OGCM:'   echo '==== compile OGCM:'
88   cd build_ocn   cd build_ocn
89   echo ' --- genmake2 (ocn):'   echo ' --- genmake2 (ocn):'
90   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi $MTHo $GMKopt >  TTT.genmake.$$
91   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
92   echo ' --- make depend (ocn):'   echo ' --- make depend (ocn):'
93   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 85  then Line 100  then
100   echo '==== compile AGCM:'   echo '==== compile AGCM:'
101   cd build_atm   cd build_atm
102   echo ' --- genmake2 (atm):'   echo ' --- genmake2 (atm):'
103   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi $MTHa $GMKopt >  TTT.genmake.$$
104   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
105   echo ' --- make depend (atm):'   echo ' --- make depend (atm):'
106   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 109  then Line 124  then
124    cp -p -r input_ocn rank_1    cp -p -r input_ocn rank_1
125    cd rank_1    cd rank_1
126    ./prepare_run    ./prepare_run
127      if test "x$MTHo" != x ; then
128        echo " MTH run: mv -f eedata.mth eedata"
129        mv -f eedata.mth eedata
130      fi
131    cd $dir    cd $dir
132    
133    echo 'CP dir:' input_atm '->' rank_2    echo 'CP dir:' input_atm '->' rank_2
134    cp -p -r input_atm rank_2    cp -p -r input_atm rank_2
135    cd rank_2    cd rank_2
136    ./prepare_run    ./prepare_run
137      if test "x$MTHa" != x ; then
138        echo " MTH run: mv -f eedata.mth eedata"
139        mv -f eedata.mth eedata
140      fi
141    cd $dir    cd $dir
142    
143  fi  fi
# Line 135  then Line 158  then
158   done   done
159    
160   cd $ROOTDIR   cd $ROOTDIR
161     if test "x$MTH" != x ; then
162       export OMP_NUM_THREADS=2 ; export KMP_STACKSIZE=400m
163       if test "x$MTHo" != x ; then
164         echo -n " run OCN ($MTHo) with $OMP_NUM_THREADS threads ;"
165       fi
166       if test "x$MTHa" != x ; then
167         echo -n " run ATM ($MTHa) with $OMP_NUM_THREADS threads ;"
168       fi
169       echo ""
170     fi
171  # /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
172    #- on danton (mpich-1):
173   mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1   mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
174    #- on beagle:
175    #mpirun -pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
176   tail -20 std_outp   tail -20 std_outp
177   ls -l rank_?/pickup*.ckptA.001.001.data   ls -l rank_?/pickup*.ckptA.001.001.data
178    
# Line 164  then Line 200  then
200      /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
201      mv -f comp_res.log comp_res.sice      mv -f comp_res.log comp_res.sice
202      echo ' '      echo ' '
203   else echo 'No Atmos output file in rank_1' ; fi   else echo 'No Atmos output file in rank_2' ; fi
204    
205  fi  fi
206    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.22