[12874] | 1 | #!/bin/bash |
---|
| 2 | set -o posix |
---|
| 3 | ######################################################################################### |
---|
| 4 | # |
---|
| 5 | # LOAD param value |
---|
| 6 | . ./param.cfg |
---|
| 7 | |
---|
| 8 | # define DEL_KEY here as done in current sette_test_cases.sh script (ADD_KEY is useless as it concern only key_signedzero which should be define in the arch file) |
---|
| 9 | |
---|
| 10 | # LOAD function |
---|
| 11 | . ./all_functions.sh |
---|
| 12 | |
---|
| 13 | # CREATE job submission template |
---|
| 14 | cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit |
---|
| 15 | |
---|
| 16 | # RUN all CONFIGuration in TEST_CONFIG list |
---|
| 17 | for CONFIG in ${SETTE_TEST_CONFIGS} # SETTE_TEST_CONFIG defined in cfgs/test (not in param.cfg) |
---|
| 18 | do |
---|
[12875] | 19 | cd $SETTE_DIR |
---|
[12874] | 20 | |
---|
[12875] | 21 | # CREATE scripts (step needed if we want a batch script run_sette.sh to run compilation on compute node) |
---|
| 22 | #./prepare_run_sette.sh |
---|
| 23 | |
---|
[12874] | 24 | # RUN main script |
---|
[12875] | 25 | ./sette_run.sh $CONFIG # could be run by using BATCH submission (with/without --wait option or similar) if needed |
---|
| 26 | # could easily be switch to parrallel run as soon as makenemo allow multiple CONFIG to be compile at the same time |
---|
[12874] | 27 | |
---|
[12875] | 28 | cd $SETTE_DIR # need to be exported as env var before starting this script |
---|
| 29 | |
---|
[12874] | 30 | # LOAD input data |
---|
| 31 | . $PATH_TO_INPUT/input_${CONFIG} # in cfgs/.sette_cfgs or in cfgs/config (but not all of them exist) ? |
---|
| 32 | |
---|
| 33 | # LOAD param value |
---|
| 34 | . ./param.cfg |
---|
| 35 | # To add in param: |
---|
| 36 | NJ=8 # => use to define number of tread used for compilation |
---|
| 37 | |
---|
| 38 | # LOAD function |
---|
| 39 | . ./all_functions.sh |
---|
| 40 | |
---|
| 41 | # CREATE validation directory |
---|
| 42 | set_valid_dir |
---|
| 43 | |
---|
| 44 | # COMPILE NEMO |
---|
| 45 | cd $NEMO_DIR |
---|
| 46 | . ./makenemo -m ${CMP_NAM} -n ${CONFIG}_ST -a ${CFG_REF} -j ${NJ} add_key ${ADD_KEYS} del_key ${DEL_KEYS} |
---|
| 47 | |
---|
| 48 | # SETUP REF/MPP/RST run directory (copy EXP00 + REF/RST/MPP + mv old files) |
---|
| 49 | for TEST_NAME in 'REF MPP RST'; do |
---|
| 50 | cd $SETTE_DIR |
---|
| 51 | |
---|
| 52 | # set EXE_DIR and move old files |
---|
| 53 | . ./prepare_exe_dir.sh # set $EXE_DIR |
---|
| 54 | |
---|
| 55 | # set XIOS |
---|
| 56 | set_xios # set_xio_using_server iodef.xml ${USING_MPMD} |
---|
| 57 | |
---|
| 58 | # set namelist |
---|
| 59 | set_namelist_common # set common namelist |
---|
| 60 | set_namelist_${TEST_NAME} # set specific namelist |
---|
| 61 | |
---|
| 62 | NPROC=$((NPROC$TEST_NAME)) |
---|
| 63 | |
---|
| 64 | # create run_job.sh file for REF/MPP/RST |
---|
| 65 | . ./prepare_run_job.sh input_${CONFIG}.cfg ${NPROC} ${TEST_NAME} ${MPIRUN_FLAG} run_job.sh ${NUM_XIOSERVERS} ${NEMO_VALID} |
---|
| 66 | done |
---|
| 67 | |
---|
| 68 | # link restart for RST simulation |
---|
| 69 | link_restart |
---|
| 70 | |
---|
| 71 | # RUN Simulation REF/MPP/RST (report script will need to be updated) |
---|
| 72 | # option to wait REF is done defined in param ('-W depend=afterany:' for SGE) |
---|
| 73 | . ./fcm_job.sh $NPROCREF ${MAIN_DIR}/cfgs/${CONFIG}_ST/REF ; REFid=${JOBID} # JOBID comes from fcm_job.sh |
---|
| 74 | . ./fcm_job.sh $NPROCMPP ${MAIN_DIR}/cfgs/${CONFIG}_ST/MPP ; MPPid=${JOBID} # |
---|
| 75 | . ./fcm_job.sh $NPROCRST ${MAIN_DIR}/cfgs/${CONFIG}_ST/RST -w $REFid ; RSTid=${JOBID} # wait REFid to finish to start |
---|
| 76 | |
---|
| 77 | done |
---|