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

Last change on this file since 4692 was 4692, checked in by acc, 7 years ago

Merge SPMD and MPMD batch templates for use with sette_xios.sh. Only one batch template file now required for all SETTE jobs. Also fix namelist parameter settings for GYRE_XIOS_HR tests so that domain scales correctly with jp_cfg

  • Property svn:executable set to *
File size: 14.0 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#
106#=================================================================================
107# Copy job_batch_COMPILER file for specific compiler into job_batch_template
108# Note this batch template needs to be capable of launching both SPMD and MPMD
109# tasks with internal selection depending on the value of NUM_XIOSERVERS
110# (0=SPMD; >0 = MPMD)
111#=================================================================================
112#
113cd ${SETTE_DIR}
114cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
115
116for config in 2 
117
118do
119
120# TESTS FOR GYRE CONFIGURATION
121if [ ${config} -eq 1 ] ;  then
122    ## Restartability tests for GYRE
123
124    NPROC=4
125    export NUM_XIOSERVERS=0
126    export USING_MPMD="false"
127
128    export TEST_NAME="ATTACHED_MULTIPLE"
129
130    cd ${SETTE_DIR}
131    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_LR -r GYRE_XIOS -j 8
132    cd ${SETTE_DIR}
133    . ./param.cfg
134    . ./all_functions.sh
135    . ./prepare_exe_dir.sh
136    JOB_FILE=${EXE_DIR}/run_job.sh
137    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
138    cd ${EXE_DIR} 
139    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
140    set_namelist namelist_cfg nn_it000 1
141    set_namelist namelist_cfg nn_itend 120
142    set_namelist namelist_cfg nn_stock 60
143    set_namelist namelist_cfg ln_clobber .true.
144    set_namelist namelist_cfg jp_cfg 1
145    set_namelist namelist_cfg jpni 2
146    set_namelist namelist_cfg jpnj 2
147    set_namelist namelist_cfg jpnij $NPROC
148
149    set_xio_using_server iodef.xml $USING_MPMD
150    set_xio_file_type    iodef.xml multiple_file
151
152    cd ${SETTE_DIR}
153    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
154
155    cd ${SETTE_DIR}
156    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
157
158
159    export TEST_NAME="ATTACHED_ONE"
160    export NUM_XIOSERVERS=0
161    export USING_MPMD="false"
162    cd ${SETTE_DIR} 
163    . ./prepare_exe_dir.sh
164    JOB_FILE=${EXE_DIR}/run_job.sh
165    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
166    cd ${EXE_DIR}
167    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
168    set_namelist namelist_cfg nn_it000 1
169    set_namelist namelist_cfg nn_itend 120
170    set_namelist namelist_cfg nn_stock 60
171    set_namelist namelist_cfg ln_clobber .true.
172    set_namelist namelist_cfg jp_cfg 1
173    set_namelist namelist_cfg jpni 2
174    set_namelist namelist_cfg jpnj 2
175    set_namelist namelist_cfg jpnij $NPROC
176
177    set_xio_using_server iodef.xml $USING_MPMD
178    set_xio_file_type    iodef.xml one_file
179
180    cd ${SETTE_DIR}
181    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
182
183    cd ${SETTE_DIR}
184    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
185
186
187    export TEST_NAME="DETACHED_ONE"
188    export NUM_XIOSERVERS=2
189    export USING_MPMD="true"
190    cd ${SETTE_DIR}
191#
192    . ./prepare_exe_dir.sh
193    JOB_FILE=${EXE_DIR}/run_job.sh
194    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
195    cd ${EXE_DIR}
196    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
197    set_namelist namelist_cfg nn_it000 1
198    set_namelist namelist_cfg nn_itend 120
199    set_namelist namelist_cfg nn_stock 60
200    set_namelist namelist_cfg ln_clobber .true.
201    set_namelist namelist_cfg jp_cfg 1
202    set_namelist namelist_cfg jpni 2
203    set_namelist namelist_cfg jpnj 2
204    set_namelist namelist_cfg jpnij $NPROC
205
206    set_xio_using_server iodef.xml $USING_MPMD
207    set_xio_file_type    iodef.xml one_file
208
209    cd ${SETTE_DIR}
210    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
211
212    cd ${SETTE_DIR}
213    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
214
215    export TEST_NAME="DETACHED_MULTIPLE"
216    export NUM_XIOSERVERS=2
217    export USING_MPMD="true"
218    cd ${SETTE_DIR}
219    . ./prepare_exe_dir.sh
220    JOB_FILE=${EXE_DIR}/run_job.sh
221    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
222    cd ${EXE_DIR}
223    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
224    set_namelist namelist_cfg nn_it000 1
225    set_namelist namelist_cfg nn_itend 120
226    set_namelist namelist_cfg nn_stock 60
227    set_namelist namelist_cfg ln_clobber .true.
228    set_namelist namelist_cfg jp_cfg 1
229    set_namelist namelist_cfg jpni 2
230    set_namelist namelist_cfg jpnj 2
231    set_namelist namelist_cfg jpnij $NPROC
232
233    set_xio_using_server iodef.xml $USING_MPMD
234    set_xio_file_type    iodef.xml multiple_file
235
236    cd ${SETTE_DIR}
237    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
238
239    cd ${SETTE_DIR}
240    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
241
242fi
243
244if [ ${config} -eq 2 ] ;  then
245    ## Restartability tests for GYRE
246
247    NPROC=64
248    jp_cfg=30
249    jpni=8
250    jpnj=8
251    export NUM_XIOSERVERS=0
252    export USING_MPMD="false"
253
254    export TEST_NAME="ATTACHED_MULTIPLE"
255
256    cd ${SETTE_DIR}
257    . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8
258    cd ${SETTE_DIR}
259#
260    . ./param.cfg
261    . ./all_functions.sh
262    . ./prepare_exe_dir.sh
263#
264    JOB_FILE=${EXE_DIR}/run_job.sh
265    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
266    cd ${EXE_DIR}
267    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
268    set_namelist namelist_cfg nn_it000 1
269    set_namelist namelist_cfg nn_itend 120
270    set_namelist namelist_cfg nn_stock 120
271    set_namelist namelist_cfg nn_bench 1
272    set_namelist namelist_cfg ln_clobber .true.
273    set_namelist namelist_cfg jp_cfg $jp_cfg
274    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
275    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
276    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
277    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
278    set_namelist namelist_cfg jpni $jpni
279    set_namelist namelist_cfg jpnj $jpnj
280    set_namelist namelist_cfg jpnij $NPROC
281
282    set_xio_using_server iodef.xml $USING_MPMD
283    set_xio_file_type    iodef.xml multiple_file
284
285    cd ${SETTE_DIR}
286    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
287
288    cd ${SETTE_DIR}
289    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
290
291
292
293    export TEST_NAME="ATTACHED_ONE"
294    export NUM_XIOSERVERS=0
295    export USING_MPMD="false"
296    cd ${SETTE_DIR}
297#
298    . ./prepare_exe_dir.sh
299#
300    JOB_FILE=${EXE_DIR}/run_job.sh
301    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
302    cd ${EXE_DIR}
303    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
304    set_namelist namelist_cfg nn_it000 1
305    set_namelist namelist_cfg nn_itend 120
306    set_namelist namelist_cfg nn_stock 120
307    set_namelist namelist_cfg nn_bench 1
308    set_namelist namelist_cfg ln_clobber .true.
309    set_namelist namelist_cfg jp_cfg $jp_cfg
310    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
311    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
312    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
313    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
314    set_namelist namelist_cfg jpni $jpni
315    set_namelist namelist_cfg jpnj $jpnj
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    . ./prepare_exe_dir.sh
333#
334    JOB_FILE=${EXE_DIR}/run_job.sh
335    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
336    cd ${EXE_DIR}
337    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
338    set_namelist namelist_cfg nn_it000 1
339    set_namelist namelist_cfg nn_itend 120
340    set_namelist namelist_cfg nn_stock 120
341    set_namelist namelist_cfg nn_bench 1
342    set_namelist namelist_cfg ln_clobber .true.
343    set_namelist namelist_cfg jp_cfg $jp_cfg
344    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
345    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
346    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
347    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
348    set_namelist namelist_cfg jpni $jpni
349    set_namelist namelist_cfg jpnj $jpnj
350    set_namelist namelist_cfg jpnij $NPROC
351
352    set_xio_using_server iodef.xml $USING_MPMD
353    set_xio_file_type    iodef.xml one_file
354
355    cd ${SETTE_DIR}
356    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
357
358    cd ${SETTE_DIR}
359    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
360
361    export TEST_NAME="DETACHED_MULTIPLE"
362    export NUM_XIOSERVERS=8
363    export USING_MPMD="true"
364    cd ${SETTE_DIR}
365    . ./prepare_exe_dir.sh
366    JOB_FILE=${EXE_DIR}/run_job.sh
367    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
368    cd ${EXE_DIR}
369    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
370    set_namelist namelist_cfg nn_it000 1
371    set_namelist namelist_cfg nn_itend 120
372    set_namelist namelist_cfg nn_stock 120
373    set_namelist namelist_cfg nn_bench 1
374    set_namelist namelist_cfg ln_clobber .true.
375    set_namelist namelist_cfg jp_cfg $jp_cfg
376    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
377    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
378    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
379    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
380    set_namelist namelist_cfg jpni $jpni
381    set_namelist namelist_cfg jpnj $jpnj
382    set_namelist namelist_cfg jpnij $NPROC
383
384    set_xio_using_server iodef.xml $USING_MPMD
385    set_xio_file_type    iodef.xml multiple_file
386
387    cd ${SETTE_DIR}
388    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
389
390    cd ${SETTE_DIR}
391    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
392
393fi
394
395done
Note: See TracBrowser for help on using the repository browser.