source: XIOS/trunk/GENERIC_TESTCASE/job_jeanzay.sh @ 1791

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

trunk : add job scripts for Irene and Jean-Zay

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