New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sette_xios.sh in utils/CI/sette – NEMO

source: utils/CI/sette/sette_xios.sh @ 10517

Last change on this file since 10517 was 9605, checked in by clem, 6 years ago

change some names to comply with the new architecture

  • Property svn:executable set to *
File size: 16.2 KB
Line 
1#!/bin/bash
2############################################################
3# Author : Italo Epicoco - CMCC
4# Contact: italo.epicoco@unisalento.it
5# 2014   : A.C. Coward added new namelist settings for GYRE configuration
6#
7# sette_xios.sh   : additional script of SET TEsts for XIOS within NEMO
8# ----------------------------------------------------------------------
9# NEMO/SETTE , NEMO Consortium (2014)
10# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
11# ----------------------------------------------------------------------
12#
13#############################################################
14#set -x
15set -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_MPMD        : flag to control the use of stand-alone IO servers
32#                      "true" to run in MPMD (detached) mode with stand-alone IO servers
33#                      "false"  to run in SPMD (attached) mode without separate IO servers
34# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
35#                     set to zero if USING_MPMD="false"
36#
37# Principal script is sette_xios.sh, that calls
38#
39#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe
40#              and links to nemo in ${CONFIG_NAME}/EXP00)
41#
42#  param.cfg : sets and loads following directories:
43#
44#   FORCING_DIR         : is the directory for forcing files (tarfile)
45#   INPUT_DIR           : is the directory for input files storing
46#   TMPDIR              : is the temporary directory (if needed)
47#   NEMO_VALIDATION_DIR : is the validation directory
48#
49#   (NOTE: this file is the same for all configrations to be tested with sette)
50#
51#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
52#   set_namelist     : function declared in all_functions that sets namelist parameters
53#   post_test_tidyup : creates validation storage directory and copies required output files
54#                      (run.stat and ocean.output) in it after execution of test.
55#
56#  VALIDATION tree is:
57#
58#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
59#
60#  prepare_exe_dir.sh : defines and creates directory where the test is executed
61#                       execution directory takes name of TEST_NAME defined for every test
62#                       in sette.sh. (each test in executed in its own directory)
63#
64#  prepare_job.sh     : to generate the script run_job.sh
65#
66#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
67#                        see sette.sh and BATCH_TEMPLATE directory
68#
69#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which
70#        can be found paths to the input tar file)
71#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR}
72#        directory
73#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists
74#        remain in ${NEW_CONF}/EXP00
75#
76#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of
77#        executed commands
78#
79#  NOTE: if sette_xios.sh is stopped in output.sette there is written the last command
80#        executed by sette_xios.sh
81#
82# example use: ./sette_xios.sh
83#########################################################################################
84#
85# Compiler among those in NEMOGCM/ARCH
86COMPILER=
87export BATCH_COMMAND_PAR="llsubmit"
88export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
89export INTERACT_FLAG="no"
90export MPIRUN_FLAG="yes"
91#
92
93# Directory to run the tests
94SETTE_DIR=$(cd $(dirname "$0"); pwd)
95MAIN_DIR=${SETTE_DIR%/SETTE}
96CONFIG_DIR=${MAIN_DIR}/cfgs
97TOOLS_DIR=${MAIN_DIR}/tools
98
99CMP_NAM=${1:-$COMPILER}
100#
101#=================================================================================
102# Copy job_batch_COMPILER file for specific compiler into job_batch_template
103# Note this batch template needs to be capable of launching both SPMD and MPMD
104# tasks with internal selection depending on the value of NUM_XIOSERVERS
105# (0=SPMD; >0 = MPMD)
106#=================================================================================
107#
108cd ${SETTE_DIR}
109cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
110
111for config in 1 2 
112
113do
114
115#==========================================================
116# TESTS FOR XIOS USING GYRE CONFIGURATION AT LOW RESOLUTION
117#==========================================================
118
119if [ ${config} -eq 1 ] ;  then
120    ## Test of XIOS configured in attached mode with multiple output files (one for each process).
121    ## $NPROC processes are used
122
123    NPROC=4
124    jp_cfg=1
125    jpni=2
126    jpnj=2
127    export NUM_XIOSERVERS=0
128    export USING_MPMD="false"
129
130    export TEST_NAME="ATTACHED_MULTIPLE"
131
132    cd ${SETTE_DIR}
133    . ../cfgs/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 120
145    set_namelist namelist_cfg ln_clobber .true.
146    set_namelist namelist_cfg jp_cfg $jp_cfg
147    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
148    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
149    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
150    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
151    set_namelist namelist_cfg jpni $jpni
152    set_namelist namelist_cfg jpnj $jpnj
153    set_namelist namelist_cfg jpnij $NPROC
154
155    set_xio_using_server iodef.xml $USING_MPMD
156    set_xio_file_type    iodef.xml multiple_file
157
158    cd ${SETTE_DIR}
159    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
160
161    cd ${SETTE_DIR}
162    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
163
164
165    ## Test of XIOS configured in attached mode with a single output file.
166
167    export TEST_NAME="ATTACHED_ONE"
168    export NUM_XIOSERVERS=0
169    export USING_MPMD="false"
170    cd ${SETTE_DIR} 
171    . ./prepare_exe_dir.sh
172    JOB_FILE=${EXE_DIR}/run_job.sh
173    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
174    cd ${EXE_DIR}
175    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
176    set_namelist namelist_cfg nn_it000 1
177    set_namelist namelist_cfg nn_itend 120
178    set_namelist namelist_cfg nn_stock 120
179    set_namelist namelist_cfg ln_clobber .true.
180    set_namelist namelist_cfg jp_cfg $jp_cfg
181    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
182    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
183    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
184    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
185    set_namelist namelist_cfg jpni $jpni
186    set_namelist namelist_cfg jpnj $jpnj
187    set_namelist namelist_cfg jpnij $NPROC
188
189    set_xio_using_server iodef.xml $USING_MPMD
190    set_xio_file_type    iodef.xml one_file
191
192    cd ${SETTE_DIR}
193    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
194
195    cd ${SETTE_DIR}
196    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
197
198
199    ## Test of XIOS configured in detached mode with a single output file.
200    ## $NUM_XIOSERVERS IO server are used.
201    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
202
203    export TEST_NAME="DETACHED_ONE"
204    export NUM_XIOSERVERS=2
205    export USING_MPMD="true"
206    cd ${SETTE_DIR}
207#
208    . ./prepare_exe_dir.sh
209    JOB_FILE=${EXE_DIR}/run_job.sh
210    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
211    cd ${EXE_DIR}
212    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
213    set_namelist namelist_cfg nn_it000 1
214    set_namelist namelist_cfg nn_itend 120
215    set_namelist namelist_cfg nn_stock 120
216    set_namelist namelist_cfg ln_clobber .true.
217    set_namelist namelist_cfg jp_cfg $jp_cfg
218    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
219    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
220    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
221    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
222    set_namelist namelist_cfg jpni $jpni
223    set_namelist namelist_cfg jpnj $jpnj
224    set_namelist namelist_cfg jpnij $NPROC
225
226    set_xio_using_server iodef.xml $USING_MPMD
227    set_xio_file_type    iodef.xml one_file
228
229    cd ${SETTE_DIR}
230    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
231
232    cd ${SETTE_DIR}
233    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
234
235    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server).
236    ## $NUM_XIOSERVERS IO server are used.
237    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
238
239
240    export TEST_NAME="DETACHED_MULTIPLE"
241    export NUM_XIOSERVERS=2
242    export USING_MPMD="true"
243    cd ${SETTE_DIR}
244    . ./prepare_exe_dir.sh
245    JOB_FILE=${EXE_DIR}/run_job.sh
246    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
247    cd ${EXE_DIR}
248    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
249    set_namelist namelist_cfg nn_it000 1
250    set_namelist namelist_cfg nn_itend 120
251    set_namelist namelist_cfg nn_stock 120
252    set_namelist namelist_cfg ln_clobber .true.
253    set_namelist namelist_cfg jp_cfg $jp_cfg
254    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
255    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
256    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
257    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
258    set_namelist namelist_cfg jpni $jpni
259    set_namelist namelist_cfg jpnj $jpnj
260    set_namelist namelist_cfg jpnij $NPROC
261
262    set_xio_using_server iodef.xml $USING_MPMD
263    set_xio_file_type    iodef.xml multiple_file
264
265    cd ${SETTE_DIR}
266    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
267
268    cd ${SETTE_DIR}
269    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
270
271fi
272
273#==========================================================
274# TESTS FOR XIOS USING GYRE CONFIGURATION AT HIGH RESOLUTION
275#==========================================================
276
277if [ ${config} -eq 2 ] ;  then
278    ## Test of XIOS configured in attached mode with multiple output files (one for each process).
279    ## $NPROC processes are used
280
281    NPROC=64
282    jp_cfg=30
283    jpni=8
284    jpnj=8
285    export NUM_XIOSERVERS=0
286    export USING_MPMD="false"
287
288    export TEST_NAME="ATTACHED_MULTIPLE"
289
290    cd ${SETTE_DIR}
291    . ../cfgs/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8
292    cd ${SETTE_DIR}
293#
294    . ./param.cfg
295    . ./all_functions.sh
296    . ./prepare_exe_dir.sh
297#
298    JOB_FILE=${EXE_DIR}/run_job.sh
299    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
300    cd ${EXE_DIR}
301    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
302    set_namelist namelist_cfg nn_it000 1
303    set_namelist namelist_cfg nn_itend 120
304    set_namelist namelist_cfg nn_stock 120
305    set_namelist namelist_cfg nn_bench 1
306    set_namelist namelist_cfg ln_clobber .true.
307    set_namelist namelist_cfg jp_cfg $jp_cfg
308    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
309    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
310    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
311    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
312    set_namelist namelist_cfg jpni $jpni
313    set_namelist namelist_cfg jpnj $jpnj
314    set_namelist namelist_cfg jpnij $NPROC
315
316    set_xio_using_server iodef.xml $USING_MPMD
317    set_xio_file_type    iodef.xml multiple_file
318
319    cd ${SETTE_DIR}
320    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
321
322    cd ${SETTE_DIR}
323    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
324
325
326    ## Test of XIOS configured in attached mode with a single output file.
327
328    export TEST_NAME="ATTACHED_ONE"
329    export NUM_XIOSERVERS=0
330    export USING_MPMD="false"
331    cd ${SETTE_DIR}
332#
333    . ./prepare_exe_dir.sh
334#
335    JOB_FILE=${EXE_DIR}/run_job.sh
336    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
337    cd ${EXE_DIR}
338    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
339    set_namelist namelist_cfg nn_it000 1
340    set_namelist namelist_cfg nn_itend 120
341    set_namelist namelist_cfg nn_stock 120
342    set_namelist namelist_cfg nn_bench 1
343    set_namelist namelist_cfg ln_clobber .true.
344    set_namelist namelist_cfg jp_cfg $jp_cfg
345    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
346    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
347    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
348    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
349    set_namelist namelist_cfg jpni $jpni
350    set_namelist namelist_cfg jpnj $jpnj
351    set_namelist namelist_cfg jpnij $NPROC
352
353    set_xio_using_server iodef.xml $USING_MPMD
354    set_xio_file_type    iodef.xml one_file
355
356    cd ${SETTE_DIR}
357    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
358
359    cd ${SETTE_DIR}
360    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
361
362
363    ## Test of XIOS configured in detached mode with a single output file.
364    ## $NUM_XIOSERVERS IO server are used.
365    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
366
367    export TEST_NAME="DETACHED_ONE"
368    export NUM_XIOSERVERS=8
369    export USING_MPMD="true"
370    cd ${SETTE_DIR}
371#
372    . ./prepare_exe_dir.sh
373#
374    JOB_FILE=${EXE_DIR}/run_job.sh
375    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
376    cd ${EXE_DIR}
377    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
378    set_namelist namelist_cfg nn_it000 1
379    set_namelist namelist_cfg nn_itend 120
380    set_namelist namelist_cfg nn_stock 120
381    set_namelist namelist_cfg nn_bench 1
382    set_namelist namelist_cfg ln_clobber .true.
383    set_namelist namelist_cfg jp_cfg $jp_cfg
384    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
385    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
386    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
387    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
388    set_namelist namelist_cfg jpni $jpni
389    set_namelist namelist_cfg jpnj $jpnj
390    set_namelist namelist_cfg jpnij $NPROC
391
392    set_xio_using_server iodef.xml $USING_MPMD
393    set_xio_file_type    iodef.xml one_file
394
395    cd ${SETTE_DIR}
396    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
397
398    cd ${SETTE_DIR}
399    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
400
401    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server).
402    ## $NUM_XIOSERVERS IO server are used.
403    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
404
405    export TEST_NAME="DETACHED_MULTIPLE"
406    export NUM_XIOSERVERS=8
407    export USING_MPMD="true"
408    cd ${SETTE_DIR}
409    . ./prepare_exe_dir.sh
410    JOB_FILE=${EXE_DIR}/run_job.sh
411    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
412    cd ${EXE_DIR}
413    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
414    set_namelist namelist_cfg nn_it000 1
415    set_namelist namelist_cfg nn_itend 120
416    set_namelist namelist_cfg nn_stock 120
417    set_namelist namelist_cfg nn_bench 1
418    set_namelist namelist_cfg ln_clobber .true.
419    set_namelist namelist_cfg jp_cfg $jp_cfg
420    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
421    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
422    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
423    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
424    set_namelist namelist_cfg jpni $jpni
425    set_namelist namelist_cfg jpnj $jpnj
426    set_namelist namelist_cfg jpnij $NPROC
427
428    set_xio_using_server iodef.xml $USING_MPMD
429    set_xio_file_type    iodef.xml multiple_file
430
431    cd ${SETTE_DIR}
432    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
433
434    cd ${SETTE_DIR}
435    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
436
437fi
438
439done
Note: See TracBrowser for help on using the repository browser.