source: XIOS/trunk/GENERIC_TESTCASE/job_irene.sh @ 1793

Last change on this file since 1793 was 1793, checked in by yushan, 2 years ago

trunk : correction on job scripts

File size: 6.1 KB
Line 
1#!/bin/bash
2######################
3## CURIE   TGCC/CEA ##
4######################
5#MSUB -r XIOS
6#MSUB -o client_output.out    # standard output
7#MSUB -e client_error.err    #error output
8#MSUB -eo
9#MSUB -c 1
10#MSUB -n 16  # Number of MPI tasks (SPMD case) or cores (MPMD case)
11#MSUB -X
12#MSUB -x
13#MSUB -T 1800      # Wall clock limit (seconds)
14#MSUB -q skylake           # thin nodes
15#MSUB -A devcmip6
16#MSUB -Q test
17#MSUB -m work
18
19
20#============================= X64_IRENE_prod =============================
21
22
23cd $BRIDGE_MSUB_PWD
24
25module load subversion
26export arch=X64_IRENE
27export mode=prod
28export machine_name=irene
29export machine_full_name=Irene
30export xios_dir=/ccc/cont003/home/gencmip6/wangyush/XIOS/trunk
31export reference_dir=${CCCWORKDIR}
32export reference_file=xios_reference.tar.gz
33export reference_folder=xios_reference
34
35export build_dir=build_${arch}_${mode}
36export xios_revision=$(svn info --show-item revision .. 2>&1)
37export relurl=$(svn info --show-item relative-url .. 2>&1)
38
39source ../arch/arch-${arch}.env
40module load nco
41module load cdo
42module load subversion
43
44export KMP_STACKSIZE=3g
45export KMP_LIBRARY=turnaround
46export MKL_SERIAL=YES
47export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}
48
49set -x
50
51
52bash -c "cd .. && ./make_xios --arch ${arch} --${mode} --build_dir ${build_dir} --job 4"
53
54#----------- Fetch reference -----------
55cp ${reference_dir}/${reference_file} ./
56tar -xzvf ${reference_file}
57
58rm -f ${reference_file}
59
60for i in $(ls ${reference_folder}/) 
61do
62  folder=${i%%}
63  bash -c "cd ${folder} && rm -rf config_*"
64  bash -c "cp -r ${reference_folder}/${folder}/config_* ./${folder}"
65done
66
67rm -rf ${reference_folder}
68
69
70rm -f plein_report.txt
71
72echo "#revision" ${xios_revision} >> plein_report.txt
73echo "#relurl" ${relurl} >> plein_report.txt
74echo "#machine" ${machine_name} >> plein_report.txt
75echo "#build_dir" ${xios_dir}/${build_dir} >> plein_report.txt
76echo "#arch" ${arch} >> plein_report.txt
77echo "#mode" ${mode} >> plein_report.txt
78
79
80rm -f setup.sh
81touch setup.sh
82>setup.sh
83for i in $(ls -d test_*/)
84do
85  cp setup.py ${i%%/}     
86  cp run_sub_test.sh ${i%%/}   
87  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
88  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
89done
90
91export output=$(python user_config.py 2>&1 >/dev/null)
92
93if [ "$output" -ne 0 ]
94then
95        echo "user_config.py failed"
96        exit
97else
98        echo "user_config.py OK"
99fi
100
101
102cmake .
103ctest -V
104#ctest --output-on-failure
105make report
106
107rm -f test_*/setup.py
108rm -f test_*/run_sub_test.sh
109rm -f test_*/run_test_*.py
110rm -f test_*/CMakeLists.txt
111rm -f test_*/context_grid_dynamico.xml
112rm -f test_*/dynamico_grid.nc
113rm -f test_*/default_param.pyc
114rm -f test_*/user_param.pyc
115rm -f test_*/user_param.py.*
116
117mkdir -p ../html
118mkdir -p ../html/test_${machine_name}
119
120cp plein_report.txt ../html/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
121
122mkdir -p ../html/def_files
123mkdir -p ../html/def_files/${xios_revision}
124
125for i in $(ls -d test_*/)
126do
127  mkdir -p ../html/def_files/${xios_revision}/${i%%}
128  cp ${i%%}/user_params.def ../html/def_files/${xios_revision}/${i%%}     
129  for j in $(ls -d ${i%%/}/config_*)
130  do
131    mkdir -p ../html/def_files/${xios_revision}/${j%%}
132    cp ${j%%}/setup/all_param.def ../html/def_files/${xios_revision}/${j%%} 
133  done
134done
135
136
137bash -c "cd ../html && python generate_test.py"
138
139
140#============================= X64_IRENE_debug =============================
141
142
143cd $BRIDGE_MSUB_PWD
144
145module load subversion
146export arch=X64_IRENE
147export mode=debug
148export machine_name=irene
149export machine_full_name=Irene
150export xios_dir=/ccc/cont003/home/gencmip6/wangyush/XIOS/trunk
151export reference_dir=${CCCWORKDIR}
152export reference_file=xios_reference.tar.gz
153export reference_folder=xios_reference
154
155export build_dir=build_${arch}_${mode}
156export xios_revision=$(svn info --show-item revision .. 2>&1)
157export relurl=$(svn info --show-item relative-url .. 2>&1)
158
159source ../arch/arch-${arch}.env
160module load nco
161module load cdo
162module load subversion
163
164export KMP_STACKSIZE=3g
165export KMP_LIBRARY=turnaround
166export MKL_SERIAL=YES
167export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}
168
169set -x
170
171
172bash -c "cd .. && ./make_xios --arch ${arch} --${mode} --build_dir ${build_dir} --job 4"
173
174#----------- Fetch reference -----------
175cp ${reference_dir}/${reference_file} ./
176tar -xzvf ${reference_file}
177
178rm -f ${reference_file}
179
180for i in $(ls ${reference_folder}/) 
181do
182  folder=${i%%}
183  bash -c "cd ${folder} && rm -rf config_*"
184  bash -c "cp -r ${reference_folder}/${folder}/config_* ./${folder}"
185done
186
187rm -rf ${reference_folder}
188
189
190rm -f plein_report.txt
191
192echo "#revision" ${xios_revision} >> plein_report.txt
193echo "#relurl" ${relurl} >> plein_report.txt
194echo "#machine" ${machine_name} >> plein_report.txt
195echo "#build_dir" ${xios_dir}/${build_dir} >> plein_report.txt
196echo "#arch" ${arch} >> plein_report.txt
197echo "#mode" ${mode} >> plein_report.txt
198
199
200rm -f setup.sh
201touch setup.sh
202>setup.sh
203for i in $(ls -d test_*/)
204do
205  cp setup.py ${i%%/}     
206  cp run_sub_test.sh ${i%%/}   
207  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
208  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
209done
210
211export output=$(python user_config.py 2>&1 >/dev/null)
212
213if [ "$output" -ne 0 ]
214then
215        echo "user_config.py failed"
216        exit
217else
218        echo "user_config.py OK"
219fi
220
221
222cmake .
223ctest -V
224#ctest --output-on-failure
225make report
226
227rm -f test_*/setup.py
228rm -f test_*/run_sub_test.sh
229rm -f test_*/run_test_*.py
230rm -f test_*/CMakeLists.txt
231rm -f test_*/context_grid_dynamico.xml
232rm -f test_*/dynamico_grid.nc
233rm -f test_*/default_param.pyc
234rm -f test_*/user_param.pyc
235rm -f test_*/user_param.py.*
236
237mkdir -p ../html
238mkdir -p ../html/test_${machine_name}
239
240cp plein_report.txt ../html/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
241
242mkdir -p ../html/def_files
243mkdir -p ../html/def_files/${xios_revision}
244
245for i in $(ls -d test_*/)
246do
247  mkdir -p ../html/def_files/${xios_revision}/${i%%}
248  cp ${i%%}/user_params.def ../html/def_files/${xios_revision}/${i%%}     
249  for j in $(ls -d ${i%%/}/config_*)
250  do
251    mkdir -p ../html/def_files/${xios_revision}/${j%%}
252    cp ${j%%}/setup/all_param.def ../html/def_files/${xios_revision}/${j%%} 
253  done
254done
255
256
257bash -c "cd ../html && python generate_test.py"
258
259
260
261
262
Note: See TracBrowser for help on using the repository browser.