/[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.6 - (show annotations) (download)
Sun Jul 2 22:12:37 2006 UTC (15 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58k_post
Changes since 1.5: +15 -2 lines
use the compiler currently loaded (gnu,intel or pgi compiler)

1 #! /bin/sh
2
3 # $Header: /u/gcmpack/MITgcm/verification/cpl_aim+ocn/run_cpl_test_itrda,v 1.5 2006/07/02 18:23:35 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 #- find the optfile that corresponds to the currently loaded mpich module
70 . /etc/profile.d/modules.sh
71 module list -t >& tmp_compiler
72 compiler=`sed -n 's/mpich\///p' tmp_compiler`
73 case $compiler in
74 'gnu') cp -p ../../tools/build_options/linux_ia32_g77+mpi_itrda genmake_optfile ;;
75 'intel') cp -p ../../tools/build_options/linux_ia32_ifc+mpi_itrda genmake_optfile ;;
76 'pgi') cp -p ../../tools/build_options/linux_ia32_pgf77+mpi_itrda genmake_optfile ;;
77 *) echo 'ERROR: cannot use compiler:' $compiler ;
78 echo ""; cat tmp_compiler ; exit 7 ;;
79 esac
80 rm -f tmp_compiler
81 echo " Using" $compiler "compiler:"
82 #---
83 echo '==== compile coupler:'
84 cd build_cpl
85 echo ' --- genmake2 (cpl):'
86 ../../../tools/genmake2 -of ../genmake_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 ../genmake_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 ../genmake_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 cp -p -r input_cpl rank_0
129 cp -p -r input_ocn rank_1
130 cp -p -r input_atm rank_2
131
132 cd rank_1
133 ./IMPORT_INPUT_FILES
134 cd $dir
135
136 cd rank_2
137 ./SHARE_OCN_GRID '../rank_1'
138 ./IMPORT_INPUT_FILES
139 cd $dir
140
141 fi
142
143 if test $kpr = 3
144 then
145 ROOTDIR=$dir
146 rm -f rank_?/pickup*.ckptA.00?.00?.??ta
147 echo $ROOTDIR
148 tmpfil=TTT.$$
149
150 echo $PBS_NODEFILE
151 list=`cat $PBS_NODEFILE`
152 rm -f pr_group ; touch pr_group
153 nc=0 ; dd1=cpl ;
154 for xx in $list
155 do
156 echo $xx $nc $dir/build_$dd1/mitgcmuv >> pr_group
157 if test $nc = 0 ; then dd1=ocn ; else dd1=atm ; fi
158 nc=1
159 done
160
161 cd $ROOTDIR
162 # /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
163 mpirun -p4pg pr_group -v ./build_cpl/mitgcmuv > std_outp 2>&1
164 tail -20 std_outp
165 ls -l rank_?/pickup*.ckptA.001.001.data
166
167 fi
168
169 if test $kpr = 4
170 then
171
172 if test -f rank_1/STDOUT.0000
173 then echo '==> check Ocean output:'
174 /home/jmc/bin/comp_res rank_1/STDOUT.0000 results/ocnSTDOUT.0000
175 echo ' '
176 else echo 'No Ocean output file in rank_1' ; fi
177
178 if test -f rank_2/STDOUT.0000
179 then
180 echo '==> check Atmos output:'
181 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000
182 echo '==> check Land output:'
183 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 L
184 echo '==> check thSIce output:'
185 /home/jmc/bin/comp_res rank_2/STDOUT.0000 results/atmSTDOUT.0000 I
186 echo ' '
187 else echo 'No Atmos output file in rank_1' ; fi
188
189 fi
190
191 exit 0

  ViewVC Help
Powered by ViewVC 1.1.22