1 | #!/bin/bash |
---|
2 | ############################################################ |
---|
3 | # Author : Simona Flavoni for NEMO |
---|
4 | # Contact: sflod@locean-ipsl.upmc.fr |
---|
5 | # 2013 : A.C. Coward added options for testing with XIOS in dettached mode |
---|
6 | # |
---|
7 | # sette.sh : principal script of SET TEsts for NEMO (SETTE) |
---|
8 | # ---------------------------------------------------------------------- |
---|
9 | # NEMO/SETTE , NEMO Consortium (2010) |
---|
10 | # Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
11 | # ---------------------------------------------------------------------- |
---|
12 | # |
---|
13 | ############################################################# |
---|
14 | #set -x |
---|
15 | set -o posix |
---|
16 | #set -u |
---|
17 | #set -e |
---|
18 | # =========== |
---|
19 | # DESCRIPTION |
---|
20 | # =========== |
---|
21 | # |
---|
22 | # Variables to be checked by user: |
---|
23 | # |
---|
24 | # COMPILER : name of compiler as defined in NEMOGCM/ARCH directory |
---|
25 | # BATCH_COMMAND_PAR : name of the command for submitting parallel batch jobs |
---|
26 | # BATCH_COMMAND_SEQ : name of the command for submitting sequential batch jobs |
---|
27 | # INTERACT_FLAG : flag to run in interactive mode "yes" |
---|
28 | # to run in batch mode "no" |
---|
29 | # MPIRUN_FLAG : flag to run in parallel (MPI) "yes" |
---|
30 | # to run in sequential mode (NB_PROC = 1) "no" |
---|
31 | # USING_XIOS : flag to control the activation of key_iomput |
---|
32 | # "yes" to compile using key_iomput and link to the external XIOS library |
---|
33 | # "no" to compile without key_iomput and link to the old IOIPSL library |
---|
34 | # USING_MPMD : flag to control the use of stand-alone IO servers |
---|
35 | # requires USING_XIOS="yes" |
---|
36 | # "yes" to run in MPMD (detached) mode with stand-alone IO servers |
---|
37 | # "no" to run in SPMD (attached) mode without separate IO servers |
---|
38 | # NUM_XIOSERVERS : number of stand-alone IO servers to employ |
---|
39 | # set to zero if USING_MPMD="no" |
---|
40 | # |
---|
41 | # Principal script is sette.sh, that calls |
---|
42 | # |
---|
43 | # makenemo : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe |
---|
44 | # and links to opa in ${CONFIG_NAME}/EXP00) |
---|
45 | # |
---|
46 | # param.cfg : sets and loads following directories: |
---|
47 | # |
---|
48 | # FORCING_DIR : is the directory for forcing files (tarfile) |
---|
49 | # INPUT_DIR : is the directory for input files storing |
---|
50 | # TMPDIR : is the temporary directory (if needed) |
---|
51 | # NEMO_VALIDATION_DIR : is the validation directory |
---|
52 | # |
---|
53 | # (NOTE: this file is the same for all configrations to be tested with sette) |
---|
54 | # |
---|
55 | # all_functions.sh : loads functions used by sette (note: new functions can be added here) |
---|
56 | # set_namelist : function declared in all_functions that sets namelist parameters |
---|
57 | # post_test_tidyup : creates validation storage directory and copies required output files |
---|
58 | # (solver.stat and ocean.output) in it after execution of test. |
---|
59 | # |
---|
60 | # VALIDATION tree is: |
---|
61 | # |
---|
62 | # NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE) |
---|
63 | # |
---|
64 | # prepare_exe_dir.sh : defines and creates directory where the test is executed |
---|
65 | # execution directory takes name of TEST_NAME defined for every test |
---|
66 | # in sette.sh. (each test in executed in its own directory) |
---|
67 | # |
---|
68 | # prepare_job.sh : to generate the script run_job.sh |
---|
69 | # |
---|
70 | # fcm_job.sh : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes") |
---|
71 | # see sette.sh and BATCH_TEMPLATE directory |
---|
72 | # |
---|
73 | # NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which |
---|
74 | # can be found paths to the input tar file) |
---|
75 | # NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} |
---|
76 | # directory |
---|
77 | # NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists |
---|
78 | # remain in ${NEW_CONF}/EXP00 |
---|
79 | # |
---|
80 | # NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of |
---|
81 | # executed commands |
---|
82 | # |
---|
83 | # NOTE: if sette.sh is stopped in output.sette there is written the last command |
---|
84 | # executed by sette.sh |
---|
85 | # |
---|
86 | # example use: ./sette.sh |
---|
87 | ######################################################################################### |
---|
88 | # |
---|
89 | # Compiler among those in NEMOGCM/ARCH |
---|
90 | COMPILER=tobedefined |
---|
91 | export BATCH_COMMAND_PAR="llsubmit" |
---|
92 | export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR |
---|
93 | export INTERACT_FLAG="no" |
---|
94 | export MPIRUN_FLAG="yes" |
---|
95 | # |
---|
96 | |
---|
97 | # Directory to run the tests |
---|
98 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
99 | MAIN_DIR=${SETTE_DIR%/SETTE} |
---|
100 | CONFIG_DIR=${MAIN_DIR}/CONFIG |
---|
101 | TOOLS_DIR=${MAIN_DIR}/TOOLS |
---|
102 | COMPIL_DIR=${TOOLS_DIR}/COMPILE |
---|
103 | |
---|
104 | CMP_NAM=${1:-$COMPILER} |
---|
105 | # Copy job_batch_COMPILER file for specific compiler into job_batch_template |
---|
106 | #================================================================================= |
---|
107 | # Note this script sets up and submits a mixture of SPMD and MPMD jobs corresponding |
---|
108 | # to ATTACHED and DETACHED mode, XIOS jobs. In general, the launch command for these |
---|
109 | # jobs is different and is accommodated here by employing two different batch-file |
---|
110 | # templates. This script expects to find both a BATCH_TEMPLATE/batch-${COMPILER} and |
---|
111 | # a BATCH_TEMPLATE/batch-mpmd-${COMPILER} template. If your test system doesn't |
---|
112 | # require this distinction, simply make both files identical. |
---|
113 | #================================================================================= |
---|
114 | # Initially copy standard (SPMD) template for attached mode tests |
---|
115 | cd ${SETTE_DIR} |
---|
116 | cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit |
---|
117 | |
---|
118 | for config in 2 |
---|
119 | |
---|
120 | do |
---|
121 | |
---|
122 | # TESTS FOR GYRE CONFIGURATION |
---|
123 | if [ ${config} -eq 1 ] ; then |
---|
124 | ## Restartability tests for GYRE |
---|
125 | |
---|
126 | NPROC=4 |
---|
127 | export NUM_XIOSERVERS=0 |
---|
128 | export USING_MPMD="false" |
---|
129 | |
---|
130 | export TEST_NAME="ATTACHED_MULTIPLE" |
---|
131 | |
---|
132 | cd ${SETTE_DIR} |
---|
133 | . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_LR -r GYRE_XIOS -j 8 |
---|
134 | cd ${SETTE_DIR} |
---|
135 | . ./param.cfg |
---|
136 | . ./all_functions.sh |
---|
137 | . ./prepare_exe_dir.sh |
---|
138 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
139 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
140 | cd ${EXE_DIR} |
---|
141 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\" |
---|
142 | set_namelist namelist_cfg nn_it000 1 |
---|
143 | set_namelist namelist_cfg nn_itend 120 |
---|
144 | set_namelist namelist_cfg nn_stock 60 |
---|
145 | set_namelist namelist_cfg ln_clobber .true. |
---|
146 | set_namelist namelist_cfg jp_cfg 1 |
---|
147 | set_namelist namelist_cfg jpni 2 |
---|
148 | set_namelist namelist_cfg jpnj 2 |
---|
149 | set_namelist namelist_cfg jpnij $NPROC |
---|
150 | |
---|
151 | set_xio_using_server iodef.xml $USING_MPMD |
---|
152 | set_xio_file_type iodef.xml multiple_file |
---|
153 | |
---|
154 | cd ${SETTE_DIR} |
---|
155 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
156 | |
---|
157 | cd ${SETTE_DIR} |
---|
158 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
159 | |
---|
160 | |
---|
161 | export TEST_NAME="ATTACHED_ONE" |
---|
162 | export NUM_XIOSERVERS=0 |
---|
163 | export USING_MPMD="false" |
---|
164 | cd ${SETTE_DIR} |
---|
165 | . ./prepare_exe_dir.sh |
---|
166 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
167 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
168 | cd ${EXE_DIR} |
---|
169 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\" |
---|
170 | set_namelist namelist_cfg nn_it000 1 |
---|
171 | set_namelist namelist_cfg nn_itend 120 |
---|
172 | set_namelist namelist_cfg nn_stock 60 |
---|
173 | set_namelist namelist_cfg ln_clobber .true. |
---|
174 | set_namelist namelist_cfg jp_cfg 1 |
---|
175 | set_namelist namelist_cfg jpni 2 |
---|
176 | set_namelist namelist_cfg jpnj 2 |
---|
177 | set_namelist namelist_cfg jpnij $NPROC |
---|
178 | |
---|
179 | set_xio_using_server iodef.xml $USING_MPMD |
---|
180 | set_xio_file_type iodef.xml one_file |
---|
181 | |
---|
182 | cd ${SETTE_DIR} |
---|
183 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
184 | |
---|
185 | cd ${SETTE_DIR} |
---|
186 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
187 | |
---|
188 | |
---|
189 | export TEST_NAME="DETACHED_ONE" |
---|
190 | export NUM_XIOSERVERS=2 |
---|
191 | export USING_MPMD="true" |
---|
192 | cd ${SETTE_DIR} |
---|
193 | # |
---|
194 | # Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template |
---|
195 | cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit |
---|
196 | # |
---|
197 | . ./prepare_exe_dir.sh |
---|
198 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
199 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
200 | cd ${EXE_DIR} |
---|
201 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\" |
---|
202 | set_namelist namelist_cfg nn_it000 1 |
---|
203 | set_namelist namelist_cfg nn_itend 120 |
---|
204 | set_namelist namelist_cfg nn_stock 60 |
---|
205 | set_namelist namelist_cfg ln_clobber .true. |
---|
206 | set_namelist namelist_cfg jp_cfg 1 |
---|
207 | set_namelist namelist_cfg jpni 2 |
---|
208 | set_namelist namelist_cfg jpnj 2 |
---|
209 | set_namelist namelist_cfg jpnij $NPROC |
---|
210 | |
---|
211 | set_xio_using_server iodef.xml $USING_MPMD |
---|
212 | set_xio_file_type iodef.xml one_file |
---|
213 | |
---|
214 | cd ${SETTE_DIR} |
---|
215 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
216 | |
---|
217 | cd ${SETTE_DIR} |
---|
218 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
219 | |
---|
220 | export TEST_NAME="DETACHED_MULTIPLE" |
---|
221 | export NUM_XIOSERVERS=2 |
---|
222 | export USING_MPMD="true" |
---|
223 | cd ${SETTE_DIR} |
---|
224 | . ./prepare_exe_dir.sh |
---|
225 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
226 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
227 | cd ${EXE_DIR} |
---|
228 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\" |
---|
229 | set_namelist namelist_cfg nn_it000 1 |
---|
230 | set_namelist namelist_cfg nn_itend 120 |
---|
231 | set_namelist namelist_cfg nn_stock 60 |
---|
232 | set_namelist namelist_cfg ln_clobber .true. |
---|
233 | set_namelist namelist_cfg jp_cfg 1 |
---|
234 | set_namelist namelist_cfg jpni 2 |
---|
235 | set_namelist namelist_cfg jpnj 2 |
---|
236 | set_namelist namelist_cfg jpnij $NPROC |
---|
237 | |
---|
238 | set_xio_using_server iodef.xml $USING_MPMD |
---|
239 | set_xio_file_type iodef.xml multiple_file |
---|
240 | |
---|
241 | cd ${SETTE_DIR} |
---|
242 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
243 | |
---|
244 | cd ${SETTE_DIR} |
---|
245 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
246 | |
---|
247 | fi |
---|
248 | |
---|
249 | if [ ${config} -eq 2 ] ; then |
---|
250 | ## Restartability tests for GYRE |
---|
251 | |
---|
252 | NPROC=152 |
---|
253 | export NUM_XIOSERVERS=0 |
---|
254 | export USING_MPMD="false" |
---|
255 | |
---|
256 | export TEST_NAME="ATTACHED_MULTIPLE" |
---|
257 | |
---|
258 | cd ${SETTE_DIR} |
---|
259 | . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8 |
---|
260 | cd ${SETTE_DIR} |
---|
261 | # |
---|
262 | # Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template |
---|
263 | cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit |
---|
264 | # |
---|
265 | . ./param.cfg |
---|
266 | . ./all_functions.sh |
---|
267 | . ./prepare_exe_dir.sh |
---|
268 | # |
---|
269 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
270 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
271 | cd ${EXE_DIR} |
---|
272 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\" |
---|
273 | set_namelist namelist_cfg nn_it000 1 |
---|
274 | set_namelist namelist_cfg nn_itend 120 |
---|
275 | set_namelist namelist_cfg nn_stock 120 |
---|
276 | set_namelist namelist_cfg nn_bench 1 |
---|
277 | set_namelist namelist_cfg ln_clobber .true. |
---|
278 | set_namelist namelist_cfg jp_cfg 144 |
---|
279 | set_namelist namelist_cfg jpni 19 |
---|
280 | set_namelist namelist_cfg jpnj 8 |
---|
281 | set_namelist namelist_cfg jpnij $NPROC |
---|
282 | |
---|
283 | set_xio_using_server iodef.xml $USING_MPMD |
---|
284 | set_xio_file_type iodef.xml multiple_file |
---|
285 | |
---|
286 | cd ${SETTE_DIR} |
---|
287 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
288 | |
---|
289 | cd ${SETTE_DIR} |
---|
290 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
291 | |
---|
292 | |
---|
293 | |
---|
294 | export TEST_NAME="ATTACHED_ONE" |
---|
295 | export NUM_XIOSERVERS=0 |
---|
296 | export USING_MPMD="false" |
---|
297 | cd ${SETTE_DIR} |
---|
298 | # |
---|
299 | # Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template |
---|
300 | cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit |
---|
301 | # |
---|
302 | . ./prepare_exe_dir.sh |
---|
303 | # |
---|
304 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
305 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
306 | cd ${EXE_DIR} |
---|
307 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\" |
---|
308 | set_namelist namelist_cfg nn_it000 1 |
---|
309 | set_namelist namelist_cfg nn_itend 120 |
---|
310 | set_namelist namelist_cfg nn_stock 120 |
---|
311 | set_namelist namelist_cfg nn_bench 1 |
---|
312 | set_namelist namelist_cfg ln_clobber .true. |
---|
313 | set_namelist namelist_cfg jp_cfg 144 |
---|
314 | set_namelist namelist_cfg jpni 19 |
---|
315 | set_namelist namelist_cfg jpnj 8 |
---|
316 | set_namelist namelist_cfg jpnij $NPROC |
---|
317 | |
---|
318 | set_xio_using_server iodef.xml $USING_MPMD |
---|
319 | set_xio_file_type iodef.xml one_file |
---|
320 | |
---|
321 | cd ${SETTE_DIR} |
---|
322 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
323 | |
---|
324 | cd ${SETTE_DIR} |
---|
325 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
326 | |
---|
327 | export TEST_NAME="DETACHED_ONE" |
---|
328 | export NUM_XIOSERVERS=8 |
---|
329 | export USING_MPMD="true" |
---|
330 | cd ${SETTE_DIR} |
---|
331 | # |
---|
332 | # Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template |
---|
333 | cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit |
---|
334 | # |
---|
335 | . ./prepare_exe_dir.sh |
---|
336 | # |
---|
337 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
338 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
339 | cd ${EXE_DIR} |
---|
340 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\" |
---|
341 | set_namelist namelist_cfg nn_it000 1 |
---|
342 | set_namelist namelist_cfg nn_itend 120 |
---|
343 | set_namelist namelist_cfg nn_stock 120 |
---|
344 | set_namelist namelist_cfg nn_bench 1 |
---|
345 | set_namelist namelist_cfg ln_clobber .true. |
---|
346 | set_namelist namelist_cfg jp_cfg 144 |
---|
347 | set_namelist namelist_cfg jpni 19 |
---|
348 | set_namelist namelist_cfg jpnj 8 |
---|
349 | set_namelist namelist_cfg jpnij $NPROC |
---|
350 | |
---|
351 | set_xio_using_server iodef.xml $USING_MPMD |
---|
352 | set_xio_file_type iodef.xml one_file |
---|
353 | |
---|
354 | cd ${SETTE_DIR} |
---|
355 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
356 | |
---|
357 | cd ${SETTE_DIR} |
---|
358 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
359 | |
---|
360 | export TEST_NAME="DETACHED_MULTIPLE" |
---|
361 | export NUM_XIOSERVERS=8 |
---|
362 | export USING_MPMD="true" |
---|
363 | cd ${SETTE_DIR} |
---|
364 | . ./prepare_exe_dir.sh |
---|
365 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
366 | if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi |
---|
367 | cd ${EXE_DIR} |
---|
368 | set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\" |
---|
369 | set_namelist namelist_cfg nn_it000 1 |
---|
370 | set_namelist namelist_cfg nn_itend 120 |
---|
371 | set_namelist namelist_cfg nn_stock 120 |
---|
372 | set_namelist namelist_cfg nn_bench 1 |
---|
373 | set_namelist namelist_cfg ln_clobber .true. |
---|
374 | set_namelist namelist_cfg jp_cfg 144 |
---|
375 | set_namelist namelist_cfg jpni 19 |
---|
376 | set_namelist namelist_cfg jpnj 8 |
---|
377 | set_namelist namelist_cfg jpnij $NPROC |
---|
378 | |
---|
379 | set_xio_using_server iodef.xml $USING_MPMD |
---|
380 | set_xio_file_type iodef.xml multiple_file |
---|
381 | |
---|
382 | cd ${SETTE_DIR} |
---|
383 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} |
---|
384 | |
---|
385 | cd ${SETTE_DIR} |
---|
386 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|
387 | |
---|
388 | fi |
---|
389 | |
---|
390 | done |
---|