/[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.11 - (show annotations) (download)
Tue Nov 27 00:54:58 2007 UTC (13 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint61l, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59k, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q
Changes since 1.10: +12 -10 lines
avoid the local copy of the optfile

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

  ViewVC Help
Powered by ViewVC 1.1.22