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 trunk/NEMOGCM/SETTE – NEMO

source: trunk/NEMOGCM/SETTE/sette_xios.sh @ 4528

Last change on this file since 4528 was 4373, checked in by epico, 10 years ago

new SETTE test for testing XIOS in its 4 modes Attached/Detached?, One/Multiple? with both Low and High resolution.
A modification of BATCH file for each machine is required to enable MPMD jobs. See batch-gfortran_athena_xios as example

  • Property svn:executable set to *
File size: 12.6 KB
Line 
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
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_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
90COMPILER=tobedefined
91export BATCH_COMMAND_PAR="llsubmit"
92export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
93export INTERACT_FLAG="no"
94export MPIRUN_FLAG="yes"
95#
96
97# Directory to run the tests
98SETTE_DIR=$(cd $(dirname "$0"); pwd)
99MAIN_DIR=${SETTE_DIR%/SETTE}
100CONFIG_DIR=${MAIN_DIR}/CONFIG
101TOOLS_DIR=${MAIN_DIR}/TOOLS
102COMPIL_DIR=${TOOLS_DIR}/COMPILE
103
104CMP_NAM=${1:-$COMPILER}
105# Copy job_batch_COMPILER file for specific compiler into job_batch_template
106cd ${SETTE_DIR}
107cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
108
109for config in 2 
110
111do
112
113# TESTS FOR GYRE CONFIGURATION
114if [ ${config} -eq 1 ] ;  then
115    ## Restartability tests for GYRE
116
117    NPROC=4
118    export NUM_XIOSERVERS=0
119    export USING_MPMD="false"
120
121    export TEST_NAME="ATTACHED_MULTIPLE"
122
123    cd ${SETTE_DIR}
124    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_LR -r GYRE_XIOS -j 8
125    cd ${SETTE_DIR}
126    . param.cfg
127    . all_functions.sh
128    . prepare_exe_dir.sh
129    JOB_FILE=${EXE_DIR}/run_job.sh
130    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
131    cd ${EXE_DIR} 
132    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
133    set_namelist namelist_cfg nn_it000 1
134    set_namelist namelist_cfg nn_itend 120
135    set_namelist namelist_cfg nn_stock 60
136    set_namelist namelist_cfg ln_clobber .true.
137    set_namelist namelist_cfg jp_cfg 1
138    set_namelist namelist_cfg jpni 2
139    set_namelist namelist_cfg jpnj 2
140    set_namelist namelist_cfg jpnij $NPROC
141
142    set_xio_using_server iodef.xml $USING_MPMD
143    set_xio_file_type    iodef.xml multiple_file
144
145    cd ${SETTE_DIR}
146    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
147
148    cd ${SETTE_DIR}
149    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
150
151
152    export TEST_NAME="ATTACHED_ONE"
153    export NUM_XIOSERVERS=0
154    export USING_MPMD="false"
155    cd ${SETTE_DIR} 
156    . prepare_exe_dir.sh
157    JOB_FILE=${EXE_DIR}/run_job.sh
158    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
159    cd ${EXE_DIR}
160    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
161    set_namelist namelist_cfg nn_it000 1
162    set_namelist namelist_cfg nn_itend 120
163    set_namelist namelist_cfg nn_stock 60
164    set_namelist namelist_cfg ln_clobber .true.
165    set_namelist namelist_cfg jp_cfg 1
166    set_namelist namelist_cfg jpni 2
167    set_namelist namelist_cfg jpnj 2
168    set_namelist namelist_cfg jpnij $NPROC
169
170    set_xio_using_server iodef.xml $USING_MPMD
171    set_xio_file_type    iodef.xml one_file
172
173    cd ${SETTE_DIR}
174    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
175
176    cd ${SETTE_DIR}
177    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
178
179
180    export TEST_NAME="DETACHED_ONE"
181    export NUM_XIOSERVERS=2
182    export USING_MPMD="true"
183    cd ${SETTE_DIR}
184    . prepare_exe_dir.sh
185    JOB_FILE=${EXE_DIR}/run_job.sh
186    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
187    cd ${EXE_DIR}
188    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
189    set_namelist namelist_cfg nn_it000 1
190    set_namelist namelist_cfg nn_itend 120
191    set_namelist namelist_cfg nn_stock 60
192    set_namelist namelist_cfg ln_clobber .true.
193    set_namelist namelist_cfg jp_cfg 1
194    set_namelist namelist_cfg jpni 2
195    set_namelist namelist_cfg jpnj 2
196    set_namelist namelist_cfg jpnij $NPROC
197
198    set_xio_using_server iodef.xml $USING_MPMD
199    set_xio_file_type    iodef.xml one_file
200
201    cd ${SETTE_DIR}
202    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
203
204    cd ${SETTE_DIR}
205    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
206
207    export TEST_NAME="DETACHED_MULTIPLE"
208    export NUM_XIOSERVERS=2
209    export USING_MPMD="true"
210    cd ${SETTE_DIR}
211    . prepare_exe_dir.sh
212    JOB_FILE=${EXE_DIR}/run_job.sh
213    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
214    cd ${EXE_DIR}
215    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
216    set_namelist namelist_cfg nn_it000 1
217    set_namelist namelist_cfg nn_itend 120
218    set_namelist namelist_cfg nn_stock 60
219    set_namelist namelist_cfg ln_clobber .true.
220    set_namelist namelist_cfg jp_cfg 1
221    set_namelist namelist_cfg jpni 2
222    set_namelist namelist_cfg jpnj 2
223    set_namelist namelist_cfg jpnij $NPROC
224
225    set_xio_using_server iodef.xml $USING_MPMD
226    set_xio_file_type    iodef.xml multiple_file
227
228    cd ${SETTE_DIR}
229    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
230
231    cd ${SETTE_DIR}
232    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
233
234fi
235
236if [ ${config} -eq 2 ] ;  then
237    ## Restartability tests for GYRE
238
239    NPROC=152
240    export NUM_XIOSERVERS=0
241    export USING_MPMD="false"
242
243    export TEST_NAME="ATTACHED_MULTIPLE"
244
245    cd ${SETTE_DIR}
246    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8
247    cd ${SETTE_DIR}
248    . param.cfg
249    . all_functions.sh
250    . prepare_exe_dir.sh
251    JOB_FILE=${EXE_DIR}/run_job.sh
252    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
253    cd ${EXE_DIR}
254    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
255    set_namelist namelist_cfg nn_it000 1
256    set_namelist namelist_cfg nn_itend 120
257    set_namelist namelist_cfg nn_stock 120
258    set_namelist namelist_cfg nn_bench 1
259    set_namelist namelist_cfg ln_clobber .true.
260    set_namelist namelist_cfg jp_cfg 144
261    set_namelist namelist_cfg jpni 19
262    set_namelist namelist_cfg jpnj 8
263    set_namelist namelist_cfg jpnij $NPROC
264
265    set_xio_using_server iodef.xml $USING_MPMD
266    set_xio_file_type    iodef.xml multiple_file
267
268    cd ${SETTE_DIR}
269    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
270
271    cd ${SETTE_DIR}
272    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
273
274
275
276    export TEST_NAME="ATTACHED_ONE"
277    export NUM_XIOSERVERS=0
278    export USING_MPMD="false"
279    cd ${SETTE_DIR}
280    . prepare_exe_dir.sh
281    JOB_FILE=${EXE_DIR}/run_job.sh
282    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
283    cd ${EXE_DIR}
284    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
285    set_namelist namelist_cfg nn_it000 1
286    set_namelist namelist_cfg nn_itend 120
287    set_namelist namelist_cfg nn_stock 120
288    set_namelist namelist_cfg nn_bench 1
289    set_namelist namelist_cfg ln_clobber .true.
290    set_namelist namelist_cfg jp_cfg 144
291    set_namelist namelist_cfg jpni 19
292    set_namelist namelist_cfg jpnj 8
293    set_namelist namelist_cfg jpnij $NPROC
294
295    set_xio_using_server iodef.xml $USING_MPMD
296    set_xio_file_type    iodef.xml one_file
297
298    cd ${SETTE_DIR}
299    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
300
301    cd ${SETTE_DIR}
302    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
303
304    export TEST_NAME="DETACHED_ONE"
305    export NUM_XIOSERVERS=8
306    export USING_MPMD="true"
307    cd ${SETTE_DIR}
308    . prepare_exe_dir.sh
309    JOB_FILE=${EXE_DIR}/run_job.sh
310    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
311    cd ${EXE_DIR}
312    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
313    set_namelist namelist_cfg nn_it000 1
314    set_namelist namelist_cfg nn_itend 120
315    set_namelist namelist_cfg nn_stock 120
316    set_namelist namelist_cfg nn_bench 1
317    set_namelist namelist_cfg ln_clobber .true.
318    set_namelist namelist_cfg jp_cfg 144
319    set_namelist namelist_cfg jpni 19
320    set_namelist namelist_cfg jpnj 8
321    set_namelist namelist_cfg jpnij $NPROC
322
323    set_xio_using_server iodef.xml $USING_MPMD
324    set_xio_file_type    iodef.xml one_file
325
326    cd ${SETTE_DIR}
327    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
328
329    cd ${SETTE_DIR}
330    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
331
332    export TEST_NAME="DETACHED_MULTIPLE"
333    export NUM_XIOSERVERS=8
334    export USING_MPMD="true"
335    cd ${SETTE_DIR}
336    . prepare_exe_dir.sh
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 multiple_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
360fi
361
362done
Note: See TracBrowser for help on using the repository browser.