source: XIOS/trunk/GENERIC_TESTCASE/job_jeanzay.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.0 KB
Line 
1#!/bin/bash
2##SBATCH --nodes=2
3#SBATCH --ntasks=8              # Nombre total de processus MPI
4#SBATCH --ntasks-per-node=16
5##SBATCH --cpus-per-task=1
6#SBATCH --hint=nomultithread
7#SBATCH -t 00:10:00              # Temps elapsed maximum d'exécution
8#SBATCH -o output.out     # Nom du fichier de sortie
9#SBATCH -e error.err     # Nom du fichier d'erreur
10##SBATCH -p cpu_port             # Nom de la partition d'exécution
11##SBATCH -A sos@cpu
12##SBATCH --distribution=arbitrary
13#SBATCH --account=psl@cpu
14
15
16cd ${SLURM_SUBMIT_DIR}
17
18
19#============================= X64_JEANZAY_prod =============================
20
21module load subversion
22export arch=X64_JEANZAY
23export mode=prod
24export machine_name=jeanzay
25export machine_full_name=Jean-Zay
26export xios_dir=/gpfswork/rech/psl/rpsl954/cron_xios/trunk
27export reference_dir=${WORK}
28export reference_file=xios_reference.tar.gz
29export reference_folder=xios_reference
30
31export build_dir=build_${arch}_${mode}
32export xios_revision=$(svn info --show-item revision .. 2>&1)
33export relurl=$(svn info --show-item relative-url .. 2>&1)
34
35source ../arch/arch-${arch}.env
36source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt
37
38module load cmake
39module load cdo
40module load subversion
41
42ulimit -c 0
43
44bash -c "cd .. && ./make_xios --arch ${arch} --${mode} --build_dir ${build_dir} --job 4"
45
46#----------- Fetch reference -----------
47cp ${reference_dir}/${reference_file} ./
48tar -xzvf ${reference_file}
49
50rm -f ${reference_file}
51
52for i in $(ls ${reference_folder}/) 
53do
54  folder=${i%%}
55  bash -c "cd ${folder} && rm -rf config_*"
56  bash -c "cp -r ${reference_folder}/${folder}/config_* ./${folder}"
57done
58
59rm -rf ${reference_folder}
60
61
62rm -f plein_report.txt
63
64echo "#revision" ${xios_revision} >> plein_report.txt
65echo "#relurl" ${relurl} >> plein_report.txt
66echo "#machine" ${machine_name} >> plein_report.txt
67echo "#build_dir" ${xios_dir}/${build_dir} >> plein_report.txt
68echo "#arch" ${arch} >> plein_report.txt
69echo "#mode" ${mode} >> plein_report.txt
70
71
72rm -f setup.sh
73touch setup.sh
74>setup.sh
75for i in $(ls -d test_*/)
76do
77  cp setup.py ${i%%/}     
78  cp run_sub_test.sh ${i%%/}   
79  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
80  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
81done
82
83export output=$(python user_config.py 2>&1 >/dev/null)
84
85if [ "$output" -ne 0 ]
86then
87    echo "user_config.py failed"
88    exit
89else
90    echo "user_config.py OK"
91fi
92
93
94cmake .
95ctest -V
96#ctest --output-on-failure
97make report
98
99rm -f test_*/setup.py
100rm -f test_*/run_sub_test.sh
101rm -f test_*/run_test_*.py
102rm -f test_*/CMakeLists.txt
103rm -f test_*/context_grid_dynamico.xml
104rm -f test_*/dynamico_grid.nc
105rm -f test_*/default_param.pyc
106rm -f test_*/user_param.pyc
107rm -f test_*/user_param.py.*
108
109mkdir -p ../html
110mkdir -p ../html/test_${machine_name}
111cp plein_report.txt ../html/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
112
113
114mkdir -p ../html/def_files
115mkdir -p ../html/def_files/${xios_revision}
116
117for i in $(ls -d test_*/)
118do
119  mkdir -p ../html/def_files/${xios_revision}/${i%%}
120  cp ${i%%}/user_params.def ../html/def_files/${xios_revision}/${i%%}     
121  for j in $(ls -d ${i%%/}/config_*)
122  do
123    mkdir -p ../html/def_files/${xios_revision}/${j%%}
124    cp ${j%%}/setup/all_param.def ../html/def_files/${xios_revision}/${j%%} 
125  done
126done
127
128
129bash -c "cd ../html && python generate_test.py"
130
131
132
133#============================= X64_JEANZAY_debug =============================
134
135module load subversion
136export arch=X64_JEANZAY
137export mode=debug
138export machine_name=jeanzay
139export machine_full_name=Jean-Zay
140export xios_dir=/gpfswork/rech/psl/rpsl954/cron_xios/trunk
141export reference_dir=${WORK}
142export reference_file=xios_reference.tar.gz
143export reference_folder=xios_reference
144
145export build_dir=build_${arch}_${mode}
146export xios_revision=$(svn info --show-item revision .. 2>&1)
147export relurl=$(svn info --show-item relative-url .. 2>&1)
148
149source ../arch/arch-${arch}.env
150source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt
151
152module load cmake
153module load cdo
154module load subversion
155
156ulimit -c 0
157
158bash -c "cd .. && ./make_xios --arch ${arch} --${mode} --build_dir ${build_dir} --job 4"
159
160#----------- Fetch reference -----------
161cp ${reference_dir}/${reference_file} ./
162tar -xzvf ${reference_file}
163
164rm -f ${reference_file}
165
166for i in $(ls ${reference_folder}/) 
167do
168  folder=${i%%}
169  bash -c "cd ${folder} && rm -rf config_*"
170  bash -c "cp -r ${reference_folder}/${folder}/config_* ./${folder}"
171done
172
173rm -rf ${reference_folder}
174
175
176rm -f plein_report.txt
177
178echo "#revision" ${xios_revision} >> plein_report.txt
179echo "#relurl" ${relurl} >> plein_report.txt
180echo "#machine" ${machine_name} >> plein_report.txt
181echo "#build_dir" ${xios_dir}/${build_dir} >> plein_report.txt
182echo "#arch" ${arch} >> plein_report.txt
183echo "#mode" ${mode} >> plein_report.txt
184
185
186rm -f setup.sh
187touch setup.sh
188>setup.sh
189for i in $(ls -d test_*/)
190do
191  cp setup.py ${i%%/}     
192  cp run_sub_test.sh ${i%%/}   
193  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
194  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
195done
196
197export output=$(python user_config.py 2>&1 >/dev/null)
198
199if [ "$output" -ne 0 ]
200then
201    echo "user_config.py failed"
202    exit
203else
204    echo "user_config.py OK"
205fi
206
207
208cmake .
209ctest -V
210#ctest --output-on-failure
211make report
212
213rm -f test_*/setup.py
214rm -f test_*/run_sub_test.sh
215rm -f test_*/run_test_*.py
216rm -f test_*/CMakeLists.txt
217rm -f test_*/context_grid_dynamico.xml
218rm -f test_*/dynamico_grid.nc
219rm -f test_*/default_param.pyc
220rm -f test_*/user_param.pyc
221rm -f test_*/user_param.py.*
222
223mkdir -p ../html
224mkdir -p ../html/test_${machine_name}
225
226cp plein_report.txt ../html/test_${machine_name}/test_${xios_revision}_${machine_name}_${arch}_${mode}.txt
227
228mkdir -p ../html/def_files
229mkdir -p ../html/def_files/${xios_revision}
230
231for i in $(ls -d test_*/)
232do
233  mkdir -p ../html/def_files/${xios_revision}/${i%%}
234  cp ${i%%}/user_params.def ../html/def_files/${xios_revision}/${i%%}     
235  for j in $(ls -d ${i%%/}/config_*)
236  do
237    mkdir -p ../html/def_files/${xios_revision}/${j%%}
238    cp ${j%%}/setup/all_param.def ../html/def_files/${xios_revision}/${j%%} 
239  done
240done
241
242
243bash -c "cd ../html && python generate_test.py"
244
Note: See TracBrowser for help on using the repository browser.