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

Contents of /MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda

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


Revision 1.12 - (show annotations) (download)
Tue Jul 7 00:55:51 2009 UTC (12 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.11: +3 -2 lines
update comments (after changing aces intel optfile)

1 #! /bin/sh
2
3 # $Header: /u/gcmpack/MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda,v 1.11 2007/11/27 00:54:58 jmc Exp $
4 # $Name: $
5
6 Np=3
7 if [ $# -lt 1 ]
8 then
9 echo 'Usage:'`basename $0`' step '
10 echo ' => test coupled set-up on myrinet cluster'
11 echo 'step = 0 : clean all directories'
12 echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'
13 echo 'step = 2 : copy input files and dir(s)'
14 echo "step = 3 : run on $Np processor"
15 echo 'step = 4 : check the results'
16 echo 'step = 5 : remove output files in rank_0,1,2 dir.'
17 exit
18 fi
19 kpr=$1
20 dir=`pwd`
21
22 #- only works from a 3 (or more) nodes PBS bach session ( qsub -I -l nodes=3 )
23 # on ACES cluster (tested on itrda).
24 # need to be on one computer node,
25 # and with the correct module loaded (i.e, one of the 3):
26 # > module load mpich/gnu
27 # > module load mpich/intel netcdf/3.6.1/icc
28 # export MPI_INC_DIR='/usr/local/pkg/mpich/mpich-intel/include/'
29 # > module load mpich/pgi
30 if test 'dummy'$PBS_NODEFILE = 'dummy'
31 then
32 echo ' $PBS_NODEFILE not defined'
33 echo "for now, works only from a (at least) $Np nodes PBS bach session"
34 exit 8
35 else ncpus=`wc -l $PBS_NODEFILE | awk '{print $1}'`
36 if [ $ncpus -lt $Np ] ; then
37 echo ' Nb of nodes from $PBS_NODEFILE =' $ncpus
38 echo "for now, works only from a (at least) $Np nodes PBS bach session"
39 exit 8
40 fi
41 fi
42
43 #============================================================================
44
45 if test $kpr = 0
46 then
47 rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
48 rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*
49 /bin/rm -r -f rank_0 rank_1 rank_2
50 if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi
51 if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi
52 if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi
53 fi
54 if test $kpr = 5
55 then
56 echo 'remove output files in rank_0,1,2 dir.'
57 rm -f pr_group std_outp comp_res.{ocn,atm,land,sice}
58 if test -d rank_0 ; then cd rank_0 ; rm -f Coupler.0000.clog ; cd .. ; fi
59 if test -d rank_1
60 then cd rank_1 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
61 if test -d rank_2
62 then cd rank_2 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
63 fi
64
65 if test $kpr = 1
66 then
67
68 #- find the optfile that corresponds to the currently loaded mpich module
69 . /etc/profile.d/modules.sh
70 module list -t >& tmp_compiler
71 compiler=`sed -n 's/mpich\///p' tmp_compiler`
72 case $compiler in
73 'gnu') OPTFILE="../../tools/build_options/linux_ia32_g77+mpi_aces" ;;
74 'intel') OPTFILE="../../tools/build_options/linux_ia32_ifort+mpi_aces" ;;
75 'pgi') OPTFILE="../../tools/build_options/linux_ia32_pgf77+mpi_aces" ;;
76 *) echo 'ERROR: cannot use compiler:' $compiler ;
77 echo ""; cat tmp_compiler ; exit 7 ;;
78 esac
79 rm -f tmp_compiler
80 echo " Using optfile: $OPTFILE (compiler=$compiler)"
81 xx=`echo $OPTFILE | grep -c '^\/'`
82 if test $xx = 0 ; then OPTFILE="../$OPTFILE" ; fi
83 #---
84 echo '==== compile coupler:'
85 cd build_cpl
86 echo ' --- genmake2 (cpl):'
87 ../../../tools/genmake2 -of $OPTFILE -mpi -ieee > TTT.genmake.$$
88 tail -5 TTT.genmake.$$
89 echo ' --- make depend (cpl):'
90 make depend > TTT.mkdepend.$$
91 tail -5 TTT.mkdepend.$$
92 echo ' --- make (cpl):'
93 make -j 2 > TTT.make.$$ 2>&1
94 tail -10 TTT.make.$$
95 echo ' ' ; cd $dir
96
97 echo '==== compile OGCM:'
98 cd build_ocn
99 echo ' --- genmake2 (ocn):'
100 ../../../tools/genmake2 -of $OPTFILE -mpi -ieee > TTT.genmake.$$
101 tail -5 TTT.genmake.$$
102 echo ' --- make depend (ocn):'
103 make depend > TTT.mkdepend.$$
104 tail -10 TTT.mkdepend.$$
105 echo ' --- make (ocn):'
106 make -j 2 > TTT.make.$$ 2>&1
107 tail -10 TTT.make.$$
108 echo ' ' ; cd $dir
109
110 echo '==== compile AGCM:'
111 cd build_atm
112 echo ' --- genmake2 (atm):'
113 ../../../tools/genmake2 -of $OPTFILE -mpi -ieee > TTT.genmake.$$
114 tail -5 TTT.genmake.$$
115 echo ' --- make depend (atm):'
116 make depend > TTT.mkdepend.$$
117 tail -10 TTT.mkdepend.$$
118 echo ' --- make (atm):'
119 make -j 2 > TTT.make.$$ 2>&1
120 tail -10 TTT.make.$$
121 echo ' ' ; cd $dir
122
123 ls -l build_???/mitgcmuv
124
125 fi
126
127 if test $kpr = 2
128 then
129 /bin/rm -r -f rank_0 rank_1 rank_2
130 echo 'CP dir:' input_cpl '->' rank_0
131 cp -p -r input_cpl rank_0
132
133 echo 'CP dir:' input_ocn '->' rank_1
134 cp -p -r input_ocn rank_1
135 cd rank_1
136 ./prepare_run
137 cd $dir
138
139 echo 'CP dir:' input_atm '->' rank_2
140 cp -p -r input_atm rank_2
141 cd rank_2
142 ./prepare_run
143 cd $dir
144
145 fi
146
147 if test $kpr = 3
148 then
149 ROOTDIR=$dir
150 rm -f rank_?/pickup*.ckptA.00?.00?.??ta
151 echo $ROOTDIR
152 tmpfil=TTT.$$
153
154 echo $PBS_NODEFILE
155 list=`cat $PBS_NODEFILE | head -$Np`
156 rm -f pr_group ; touch pr_group
157 nc=0 ; dd1=cpl ;
158 for xx in $list
159 do
160 echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
161 if test $nc = 0 ; then dd1=ocn ; else dd1=atm ; fi
162 nc=1
163 done
164
165 cd $ROOTDIR
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
169 ls -l rank_?/pickup*.ckptA.001.001.data
170
171 fi
172
173 if test $kpr = 4
174 then
175
176 if test -f rank_1/STDOUT.0000
177 then echo '==> check Ocean output:'
178 /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
179 mv -f comp_res.log comp_res.ocn
180 echo ' '
181 else echo 'No Ocean output file in rank_1' ; fi
182
183 if test -f rank_2/STDOUT.0000
184 then
185 echo '==> check Atmos output:'
186 /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:'
189 /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:'
192 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
193 mv -f comp_res.log comp_res.sice
194 echo ' '
195 else echo 'No Atmos output file in rank_1' ; fi
196
197 fi
198
199 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22