/[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.5 - (show annotations) (download)
Sun Jul 2 18:23:35 2006 UTC (17 years, 11 months ago) by jmc
Branch: MAIN
Changes since 1.4: +12 -10 lines
fix typo in notes.txt and update the script.

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

  ViewVC Help
Powered by ViewVC 1.1.22