source: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_jeanzay.sh @ 1792

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

dev_trunk_omp : update and cleanup of unit tests

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