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 branches/UKMO/r6232_sst_landsea_cpl/NEMOGCM/SETTE – NEMO

source: branches/UKMO/r6232_sst_landsea_cpl/NEMOGCM/SETTE/sette_xios.sh @ 8743

Last change on this file since 8743 was 4990, checked in by timgraham, 10 years ago

Merged branches/2014/dev_MERGE_2014 back onto the trunk as follows:

In the working copy of branch ran:
svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk@HEAD
1 conflict in LIM_SRC_3/limdiahsb.F90
Resolved by keeping the version from dev_MERGE_2014 branch
and commited at r4989

In working copy run:
svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
to switch working copy

Run:
svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2014/dev_MERGE_2014
to merge the branch into the trunk - no conflicts at this stage.

  • Property svn:executable set to *
File size: 16.3 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 opa 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#                      (solver.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}/CONFIG
97TOOLS_DIR=${MAIN_DIR}/TOOLS
98COMPIL_DIR=${TOOLS_DIR}/COMPILE
99
100CMP_NAM=${1:-$COMPILER}
101#
102#=================================================================================
103# Copy job_batch_COMPILER file for specific compiler into job_batch_template
104# Note this batch template needs to be capable of launching both SPMD and MPMD
105# tasks with internal selection depending on the value of NUM_XIOSERVERS
106# (0=SPMD; >0 = MPMD)
107#=================================================================================
108#
109cd ${SETTE_DIR}
110cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
111
112for config in 1 2 
113
114do
115
116#==========================================================
117# TESTS FOR XIOS USING GYRE CONFIGURATION AT LOW RESOLUTION
118#==========================================================
119
120if [ ${config} -eq 1 ] ;  then
121    ## Test of XIOS configured in attached mode with multiple output files (one for each process).
122    ## $NPROC processes are used
123
124    NPROC=4
125    jp_cfg=1
126    jpni=2
127    jpnj=2
128    export NUM_XIOSERVERS=0
129    export USING_MPMD="false"
130
131    export TEST_NAME="ATTACHED_MULTIPLE"
132
133    cd ${SETTE_DIR}
134    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_LR -r GYRE_XIOS -j 8
135    cd ${SETTE_DIR}
136    . ./param.cfg
137    . ./all_functions.sh
138    . ./prepare_exe_dir.sh
139    JOB_FILE=${EXE_DIR}/run_job.sh
140    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
141    cd ${EXE_DIR} 
142    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
143    set_namelist namelist_cfg nn_it000 1
144    set_namelist namelist_cfg nn_itend 120
145    set_namelist namelist_cfg nn_stock 120
146    set_namelist namelist_cfg ln_clobber .true.
147    set_namelist namelist_cfg jp_cfg $jp_cfg
148    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
149    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
150    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
151    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
152    set_namelist namelist_cfg jpni $jpni
153    set_namelist namelist_cfg jpnj $jpnj
154    set_namelist namelist_cfg jpnij $NPROC
155
156    set_xio_using_server iodef.xml $USING_MPMD
157    set_xio_file_type    iodef.xml multiple_file
158
159    cd ${SETTE_DIR}
160    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
161
162    cd ${SETTE_DIR}
163    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
164
165
166    ## Test of XIOS configured in attached mode with a single output file.
167
168    export TEST_NAME="ATTACHED_ONE"
169    export NUM_XIOSERVERS=0
170    export USING_MPMD="false"
171    cd ${SETTE_DIR} 
172    . ./prepare_exe_dir.sh
173    JOB_FILE=${EXE_DIR}/run_job.sh
174    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
175    cd ${EXE_DIR}
176    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
177    set_namelist namelist_cfg nn_it000 1
178    set_namelist namelist_cfg nn_itend 120
179    set_namelist namelist_cfg nn_stock 120
180    set_namelist namelist_cfg ln_clobber .true.
181    set_namelist namelist_cfg jp_cfg $jp_cfg
182    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
183    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
184    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
185    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
186    set_namelist namelist_cfg jpni $jpni
187    set_namelist namelist_cfg jpnj $jpnj
188    set_namelist namelist_cfg jpnij $NPROC
189
190    set_xio_using_server iodef.xml $USING_MPMD
191    set_xio_file_type    iodef.xml one_file
192
193    cd ${SETTE_DIR}
194    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
195
196    cd ${SETTE_DIR}
197    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
198
199
200    ## Test of XIOS configured in detached mode with a single output file.
201    ## $NUM_XIOSERVERS IO server are used.
202    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
203
204    export TEST_NAME="DETACHED_ONE"
205    export NUM_XIOSERVERS=2
206    export USING_MPMD="true"
207    cd ${SETTE_DIR}
208#
209    . ./prepare_exe_dir.sh
210    JOB_FILE=${EXE_DIR}/run_job.sh
211    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
212    cd ${EXE_DIR}
213    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
214    set_namelist namelist_cfg nn_it000 1
215    set_namelist namelist_cfg nn_itend 120
216    set_namelist namelist_cfg nn_stock 120
217    set_namelist namelist_cfg ln_clobber .true.
218    set_namelist namelist_cfg jp_cfg $jp_cfg
219    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
220    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
221    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
222    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
223    set_namelist namelist_cfg jpni $jpni
224    set_namelist namelist_cfg jpnj $jpnj
225    set_namelist namelist_cfg jpnij $NPROC
226
227    set_xio_using_server iodef.xml $USING_MPMD
228    set_xio_file_type    iodef.xml one_file
229
230    cd ${SETTE_DIR}
231    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
232
233    cd ${SETTE_DIR}
234    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
235
236    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server).
237    ## $NUM_XIOSERVERS IO server are used.
238    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
239
240
241    export TEST_NAME="DETACHED_MULTIPLE"
242    export NUM_XIOSERVERS=2
243    export USING_MPMD="true"
244    cd ${SETTE_DIR}
245    . ./prepare_exe_dir.sh
246    JOB_FILE=${EXE_DIR}/run_job.sh
247    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
248    cd ${EXE_DIR}
249    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
250    set_namelist namelist_cfg nn_it000 1
251    set_namelist namelist_cfg nn_itend 120
252    set_namelist namelist_cfg nn_stock 120
253    set_namelist namelist_cfg ln_clobber .true.
254    set_namelist namelist_cfg jp_cfg $jp_cfg
255    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
256    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
257    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
258    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
259    set_namelist namelist_cfg jpni $jpni
260    set_namelist namelist_cfg jpnj $jpnj
261    set_namelist namelist_cfg jpnij $NPROC
262
263    set_xio_using_server iodef.xml $USING_MPMD
264    set_xio_file_type    iodef.xml multiple_file
265
266    cd ${SETTE_DIR}
267    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
268
269    cd ${SETTE_DIR}
270    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
271
272fi
273
274#==========================================================
275# TESTS FOR XIOS USING GYRE CONFIGURATION AT HIGH RESOLUTION
276#==========================================================
277
278if [ ${config} -eq 2 ] ;  then
279    ## Test of XIOS configured in attached mode with multiple output files (one for each process).
280    ## $NPROC processes are used
281
282    NPROC=64
283    jp_cfg=30
284    jpni=8
285    jpnj=8
286    export NUM_XIOSERVERS=0
287    export USING_MPMD="false"
288
289    export TEST_NAME="ATTACHED_MULTIPLE"
290
291    cd ${SETTE_DIR}
292    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8
293    cd ${SETTE_DIR}
294#
295    . ./param.cfg
296    . ./all_functions.sh
297    . ./prepare_exe_dir.sh
298#
299    JOB_FILE=${EXE_DIR}/run_job.sh
300    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
301    cd ${EXE_DIR}
302    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
303    set_namelist namelist_cfg nn_it000 1
304    set_namelist namelist_cfg nn_itend 120
305    set_namelist namelist_cfg nn_stock 120
306    set_namelist namelist_cfg nn_bench 1
307    set_namelist namelist_cfg ln_clobber .true.
308    set_namelist namelist_cfg jp_cfg $jp_cfg
309    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
310    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
311    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
312    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
313    set_namelist namelist_cfg jpni $jpni
314    set_namelist namelist_cfg jpnj $jpnj
315    set_namelist namelist_cfg jpnij $NPROC
316
317    set_xio_using_server iodef.xml $USING_MPMD
318    set_xio_file_type    iodef.xml multiple_file
319
320    cd ${SETTE_DIR}
321    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
322
323    cd ${SETTE_DIR}
324    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
325
326
327    ## Test of XIOS configured in attached mode with a single output file.
328
329    export TEST_NAME="ATTACHED_ONE"
330    export NUM_XIOSERVERS=0
331    export USING_MPMD="false"
332    cd ${SETTE_DIR}
333#
334    . ./prepare_exe_dir.sh
335#
336    JOB_FILE=${EXE_DIR}/run_job.sh
337    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
338    cd ${EXE_DIR}
339    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
340    set_namelist namelist_cfg nn_it000 1
341    set_namelist namelist_cfg nn_itend 120
342    set_namelist namelist_cfg nn_stock 120
343    set_namelist namelist_cfg nn_bench 1
344    set_namelist namelist_cfg ln_clobber .true.
345    set_namelist namelist_cfg jp_cfg $jp_cfg
346    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
347    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
348    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
349    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
350    set_namelist namelist_cfg jpni $jpni
351    set_namelist namelist_cfg jpnj $jpnj
352    set_namelist namelist_cfg jpnij $NPROC
353
354    set_xio_using_server iodef.xml $USING_MPMD
355    set_xio_file_type    iodef.xml one_file
356
357    cd ${SETTE_DIR}
358    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
359
360    cd ${SETTE_DIR}
361    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
362
363
364    ## Test of XIOS configured in detached mode with a single output file.
365    ## $NUM_XIOSERVERS IO server are used.
366    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
367
368    export TEST_NAME="DETACHED_ONE"
369    export NUM_XIOSERVERS=8
370    export USING_MPMD="true"
371    cd ${SETTE_DIR}
372#
373    . ./prepare_exe_dir.sh
374#
375    JOB_FILE=${EXE_DIR}/run_job.sh
376    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
377    cd ${EXE_DIR}
378    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
379    set_namelist namelist_cfg nn_it000 1
380    set_namelist namelist_cfg nn_itend 120
381    set_namelist namelist_cfg nn_stock 120
382    set_namelist namelist_cfg nn_bench 1
383    set_namelist namelist_cfg ln_clobber .true.
384    set_namelist namelist_cfg jp_cfg $jp_cfg
385    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
386    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
387    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
388    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
389    set_namelist namelist_cfg jpni $jpni
390    set_namelist namelist_cfg jpnj $jpnj
391    set_namelist namelist_cfg jpnij $NPROC
392
393    set_xio_using_server iodef.xml $USING_MPMD
394    set_xio_file_type    iodef.xml one_file
395
396    cd ${SETTE_DIR}
397    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
398
399    cd ${SETTE_DIR}
400    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
401
402    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server).
403    ## $NUM_XIOSERVERS IO server are used.
404    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC
405
406    export TEST_NAME="DETACHED_MULTIPLE"
407    export NUM_XIOSERVERS=8
408    export USING_MPMD="true"
409    cd ${SETTE_DIR}
410    . ./prepare_exe_dir.sh
411    JOB_FILE=${EXE_DIR}/run_job.sh
412    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
413    cd ${EXE_DIR}
414    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
415    set_namelist namelist_cfg nn_it000 1
416    set_namelist namelist_cfg nn_itend 120
417    set_namelist namelist_cfg nn_stock 120
418    set_namelist namelist_cfg nn_bench 1
419    set_namelist namelist_cfg ln_clobber .true.
420    set_namelist namelist_cfg jp_cfg $jp_cfg
421    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
422    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
423    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
424    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
425    set_namelist namelist_cfg jpni $jpni
426    set_namelist namelist_cfg jpnj $jpnj
427    set_namelist namelist_cfg jpnij $NPROC
428
429    set_xio_using_server iodef.xml $USING_MPMD
430    set_xio_file_type    iodef.xml multiple_file
431
432    cd ${SETTE_DIR}
433    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
434
435    cd ${SETTE_DIR}
436    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
437
438fi
439
440done
Note: See TracBrowser for help on using the repository browser.