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

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

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


Revision 1.9 - (show annotations) (download)
Mon Jul 17 01:34:23 2006 UTC (15 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59i, checkpoint59h, checkpoint59, checkpoint58o_post, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint58m_post
Changes since 1.8: +8 -6 lines
use "prepare_run" (replace IMPORT_INPUT_FILES & SHARE_OCN_GRID)

1 #! /bin/sh
2
3 # $Header: /u/gcmpack/MITgcm/verification/cpl_aim+ocn/run_cpl_test,v 1.8 2006/03/30 02:13:59 jmc Exp $
4 # $Name: $
5
6 Np=3
7 Opt=' '
8 Opt='-ieee'
9 if [ $# -lt 1 ]
10 then
11 echo 'Usage:'`basename $0`' step '
12 echo ' => test coupled set-up on myrinet cluster'
13 echo 'step = 0 : clean all directories'
14 echo 'step = 1 : compile the 3 executables (cpl,ocn,atm)'
15 echo 'step = 2 : copy input files and dir(s)'
16 echo "step = 3 : run on $Np processor"
17 echo 'step = 4 : check the results'
18 echo 'step = 5 : remove output files in rank_0,1,2 dir.'
19 exit
20 fi
21 kpr=$1
22 dir=`pwd`
23
24 #- only works from a 3 nodes PBS bach session ( qsub -I -l nodes=3:p4 )
25 # on myrinet cluster:
26 xx=`hostname | sed 's/[0-9]/X/g'`
27 if test $xx != 'myrinet-X-XX'
28 then
29 echo ' hostname='`hostname`
30 echo 'for now, works only on myrinet cluster'
31 exit 9
32 fi
33 if test 'dummy'$PBS_NODEFILE = 'dummy'
34 then
35 echo ' $PBS_NODEFILE not defined'
36 echo "for now, works only from a $Np nodes PBS bach session"
37 exit 8
38 else ncpus=`wc -l $PBS_NODEFILE | awk '{print $1}'`
39 if test $ncpus != $Np ; then
40 echo ' Nb of nodes from $PBS_NODEFILE =' $ncpus
41 echo "for now, works only from a $Np nodes PBS bach session"
42 exit 8
43 fi
44 fi
45
46 #============================================================================
47
48 if test $kpr = 0
49 then
50 rm -f genmake_optfile pr_group std_outp
51 rm -f build_???/TTT.*make.* build_???/TTT.mkdepend.*
52 /bin/rm -r -f rank_0 rank_1 rank_2
53 if test -f build_cpl/Makefile ; then cd build_cpl ; make CLEAN ; cd .. ; fi
54 if test -f build_ocn/Makefile ; then cd build_ocn ; make CLEAN ; cd .. ; fi
55 if test -f build_atm/Makefile ; then cd build_atm ; make CLEAN ; cd .. ; fi
56 fi
57 if test $kpr = 5
58 then
59 echo 'remove output files in rank_0,1,2 dir.'
60 rm -f pr_group std_outp
61 if test -d rank_0 ; then cd rank_0 ; rm -f Coupler.0000.clog ; cd .. ; fi
62 if test -d rank_1
63 then cd rank_1 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
64 if test -d rank_2
65 then cd rank_2 ; rm -f *.data *.meta STD???.0000 UV-*.0001.clog ; cd .. ; fi
66 fi
67
68 if test $kpr = 1
69 then
70
71 cp -p ../../tools/build_options/linux_ia32_ifc+mpi_cg01 genmake_optfile
72 echo '==== compile coupler:'
73 cd build_cpl
74 echo ' --- genmake2 (cpl):'
75 ../../../tools/genmake2 -of ../genmake_optfile $Opt > TTT.genmake.$$
76 tail -5 TTT.genmake.$$
77 echo ' --- make depend (cpl):'
78 make depend > TTT.mkdepend.$$
79 tail -5 TTT.mkdepend.$$
80 echo ' --- make (cpl):'
81 make > TTT.make.$$ 2>&1
82 tail -10 TTT.make.$$
83 echo ' ' ; cd $dir
84
85 echo '==== compile OGCM:'
86 cd build_ocn
87 echo ' --- genmake2 (ocn):'
88 ../../../tools/genmake2 -of ../genmake_optfile $Opt > TTT.genmake.$$
89 tail -5 TTT.genmake.$$
90 echo ' --- make depend (ocn):'
91 make depend > TTT.mkdepend.$$
92 tail -10 TTT.mkdepend.$$
93 echo ' --- make (ocn):'
94 make > TTT.make.$$ 2>&1
95 tail -10 TTT.make.$$
96 echo ' ' ; cd $dir
97
98 echo '==== compile AGCM:'
99 cd build_atm
100 echo ' --- genmake2 (atm):'
101 ../../../tools/genmake2 -of ../genmake_optfile $Opt > TTT.genmake.$$
102 tail -5 TTT.genmake.$$
103 echo ' --- make depend (atm):'
104 make depend > TTT.mkdepend.$$
105 tail -10 TTT.mkdepend.$$
106 echo ' --- make (atm):'
107 make > TTT.make.$$ 2>&1
108 tail -10 TTT.make.$$
109 echo ' ' ; cd $dir
110
111 ls -l build_???/mitgcmuv
112
113 fi
114
115 if test $kpr = 2
116 then
117 /bin/rm -r -f rank_0 rank_1 rank_2
118 echo 'CP dir:' input_cpl '->' rank_0
119 cp -p -r input_cpl rank_0
120
121 echo 'CP dir:' input_ocn '->' rank_1
122 cp -p -r input_ocn rank_1
123 cd rank_1
124 ./prepare_run
125 cd $dir
126
127 echo 'CP dir:' input_atm '->' rank_2
128 cp -p -r input_atm rank_2
129 cd rank_2
130 ./prepare_run
131 cd $dir
132
133 fi
134
135 if test $kpr = 3
136 then
137 ROOTDIR=$dir
138 rm -f rank_?/pickup*.ckptA.00?.00?.??ta
139 echo $ROOTDIR
140 tmpfil=TTT.$$
141
142 echo $PBS_NODEFILE
143 list=`cat $PBS_NODEFILE`
144 rm -f pr_group ; touch pr_group
145 nc=0 ; dd1=cpl ;
146 for xx in $list
147 do
148 echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
149 if test $nc = 0 ; then dd1=ocn ; else dd1=atm ; fi
150 nc=1
151 done
152
153 cd $ROOTDIR
154 # -wd $ROOTDIR
155 /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
156 tail -20 std_outp
157 ls -l rank_?/pickup*.ckptA.001.001.data
158
159 fi
160
161 if test $kpr = 4
162 then
163
164 if test -f rank_1/STDOUT.0000
165 then echo '==> check Ocean output:'
166 /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
167 echo ' '
168 else echo 'No Ocean output file in rank_1' ; fi
169
170 if test -f rank_2/STDOUT.0000
171 then
172 echo '==> check Atmos output:'
173 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000
174 echo '==> check Land output:'
175 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L
176 echo '==> check thSIce output:'
177 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
178 echo ' '
179 else echo 'No Atmos output file in rank_1' ; fi
180
181 fi
182
183 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22