/[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.6 by jmc, Sun Nov 7 23:30:32 2004 UTC revision 1.14 by jmc, Sat Dec 26 23:44:03 2009 UTC
# Line 4  Line 4 
4  # $Name$  # $Name$
5    
6  Np=3  Np=3
7  Opt=' '  #- parse options:
8  Opt='-ieee'  MTH=
9  if [ $# -lt 1 ]  MTHo=
10  then  MTHa=
11    echo 'Usage:'`basename $0`' step '  if test $1 = '-mth' ; then
12    echo ' => test coupled set-up on myrinet cluster'    MTH='-omp' ; shift
13    echo 'step = 0 : clean all directories'    if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
14    echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'    if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
15    echo 'step = 2 : copy input files and dir(s)'  fi
16    echo "step = 3 : run on $Np processor"  if [ $# -ne 1 ]
17    echo 'step = 4 : check the results'  then
18      echo 'Usage:'`basename $0`' [opt] step'
19      echo ' => test coupled set-up on linux box (1.cpu)'
20      echo 'opt = -mth : compile and run (if eedata.mth) 2-threads for ocn & atm'
21      echo ' step = 0 : clean all directories'
22      echo ' step = 1 : compile the 3 executables (cpl,ocn,atm)'
23      echo ' step = 2 : copy input files and dir(s)'
24      echo " step = 3 : run with $Np mpi processes"
25      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
30  dir=`pwd`  dir=`pwd`
31    
 #- only works from a 3 nodes PBS bach session ( qsub -I -l nodes=3:p4 )  
 #  on myrinet cluster:  
 xx=`hostname | sed 's/[0-9]/X/g'`  
 if test $xx != 'myrinet-X-XX'  
 then  
   echo ' hostname='`hostname`  
   echo 'for now, works only on myrinet cluster'  
   exit 9  
 fi  
 if test 'dummy'$PBS_NODEFILE = 'dummy'  
 then  
   echo ' $PBS_NODEFILE not defined'  
   echo "for now, works only from a $Np nodes PBS bach session"  
   exit 8  
 else ncpus=`wc -l $PBS_NODEFILE | awk '{print $1}'`  
  if test $ncpus != $Np ; then  
   echo ' Nb of nodes from $PBS_NODEFILE =' $ncpus  
   echo "for now, works only from a $Np nodes PBS bach session"  
   exit 8  
  fi  
 fi  
   
32  #============================================================================  #============================================================================
33    
34  if test $kpr = 0  if test $kpr = 0
35  then  then
36   rm -f genmake_optfile pr_group std_outp   rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
37   rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*   rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*
38   /bin/rm -r -f rank_0 rank_1 rank_2   /bin/rm -r -f rank_0 rank_1 rank_2
39   if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi   if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi
40   if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi   if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi
41   if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi   if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi
42  fi  fi
43    if test $kpr = 5
44    then
45     echo 'remove output files in rank_0,1,2 dir.'
46     rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
47     if test -d rank_0 ; then cd rank_0 ; rm -f Coupler.0000.clog ; cd .. ; fi
48     if test -d rank_1
49     then cd rank_1 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
50     if test -d rank_2
51     then cd rank_2 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
52    fi
53    
54  if test $kpr = 1  if test $kpr = 1
55  then  then
56    
57   cp -p ../../tools/build_options/linux_ia32_ifc+mpi_cg01 genmake_optfile  #- choice of the optfile: take a local one in dir verification with sufix '+mpi'
58     nbOpF=`ls ../linux_*+mpi 2> /dev/null | wc -l`
59     if test $nbOpF = 1
60     then
61       OPTFILE=`ls ../linux_*+mpi`
62       zz=`grep '^FC=' $OPTFILE`
63       echo " Using optfile: $OPTFILE  (compiler=$zz) $MTH"
64     else echo 'Pb in finding optfile' ; exit;
65     fi
66     zz=`echo $OPTFILE | grep -c '^\/'`
67     if test $zz = 0 ; then OPTFILE="../$OPTFILE" ; fi
68    #---
69   echo '==== compile coupler:'   echo '==== compile coupler:'
70   cd build_cpl   cd build_cpl
71   echo ' --- genmake2 (cpl):'   echo ' --- genmake2 (cpl):'
72   ../../../tools/genmake2 -of ../genmake_optfile $Opt >  TTT.genmake.$$   ../../../tools/genmake2 -of $OPTFILE -mpi -ieee >  TTT.genmake.$$
73   tail -5 TTT.genmake.$$   tail -5 TTT.genmake.$$
74   echo ' --- make depend (cpl):'   echo ' --- make depend (cpl):'
75   make depend > TTT.mkdepend.$$   make depend > TTT.mkdepend.$$
# Line 74  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 ../genmake_optfile $Opt >  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 87  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 ../genmake_optfile $Opt >  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 103  fi Line 111  fi
111    
112  if test $kpr = 2  if test $kpr = 2
113  then  then
114      /bin/rm -r -f rank_0 rank_1 rank_2
115      echo 'CP dir:' input_cpl '->' rank_0
116    cp -p -r input_cpl rank_0    cp -p -r input_cpl rank_0
   cp -p -r input_ocn rank_1  
   cp -p -r input_atm rank_2  
117    
118      echo 'CP dir:' input_ocn '->' rank_1
119      cp -p -r input_ocn rank_1
120    cd rank_1    cd rank_1
121    ./IMPORT_INPUT_FILES    ./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
129      cp -p -r input_atm rank_2
130    cd rank_2    cd rank_2
131    ./SHARE_OCN_GRID '../rank_1'    ./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 124  then Line 144  then
144   echo $ROOTDIR   echo $ROOTDIR
145   tmpfil=TTT.$$   tmpfil=TTT.$$
146    
  echo $PBS_NODEFILE  
  list=`cat $PBS_NODEFILE`  
147   rm -f pr_group ; touch pr_group   rm -f pr_group ; touch pr_group
148   nc=0 ; dd1=cpl ;   nc=0; xx=`hostname`
149   for xx in $list   for dd1 in cpl ocn atm
150   do   do
151    echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group    echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
   if test $nc = 0 ; then dd1=ocn ; else dd1=atm ; fi  
152    nc=1    nc=1
153   done   done
154    
155   cd $ROOTDIR   cd $ROOTDIR
156   #  -wd $ROOTDIR   if test "x$MTH" != x ; then
157   /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group --gm-kill 5 -v  ./build_cpl/mitgcmuv > std_outp 2>&1     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
167     mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
168   tail -20 std_outp   tail -20 std_outp
169   ls -l rank_?/pickup*.ckptA.001.001.data   ls -l rank_?/pickup*.ckptA.001.001.data
170    
# Line 149  then Line 176  then
176   if test -f rank_1/STDOUT.0000   if test -f rank_1/STDOUT.0000
177   then echo '==> check Ocean output:'   then echo '==> check Ocean output:'
178      /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000      /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
179     echo ' '      mv -f comp_res.log comp_res.ocn
180        echo ' '
181   else echo 'No Ocean output file in rank_1' ; fi   else echo 'No Ocean output file in rank_1' ; fi
182    
183   if test -f rank_2/STDOUT.0000   if test -f rank_2/STDOUT.0000
184   then   then
185      echo '==> check Atmos output:'      echo '==> check Atmos output:'
186      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000
187        mv -f comp_res.log comp_res.atm
188      echo '==> check Land output:'      echo '==> check Land output:'
189      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L      /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L
190        mv -f comp_res.log comp_res.land
191      echo '==> check thSIce output:'      echo '==> check thSIce output:'
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     echo ' '      mv -f comp_res.log comp_res.sice
194   else echo 'No Atmos output file in rank_1' ; fi      echo ' '
195     else echo 'No Atmos output file in rank_2' ; fi
196    
197  fi  fi
198    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22