[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 |
---|
| 19 | # CREATE scripts (step needed if we want a script run_sette_${CONFIG}.sh to run compilation and submit job) |
---|
| 20 | ./prepare_run_sette.sh # => master script that compile then submit all the individual jobs for one CONFIGuration |
---|
| 21 | |
---|
| 22 | # RUN main script |
---|
| 23 | $PATH_TO_SCRIPT/run_sette_${CONFIG}.sh # could be run by using BATCH submission (with/without --wait option or similar) if needed |
---|
| 24 | # could easily be switch to parrallel run as soon as makenemo allow multiple CONFIG to be compile at the same time |
---|
| 25 | cd $SETTE_DIR |
---|
| 26 | |
---|
| 27 | # LOAD input data |
---|
| 28 | . $PATH_TO_INPUT/input_${CONFIG} # in cfgs/.sette_cfgs or in cfgs/config (but not all of them exist) ? |
---|
| 29 | |
---|
| 30 | # LOAD param value |
---|
| 31 | . ./param.cfg |
---|
| 32 | # To add in param: |
---|
| 33 | NJ=8 # => use to define number of tread used for compilation |
---|
| 34 | |
---|
| 35 | # LOAD function |
---|
| 36 | . ./all_functions.sh |
---|
| 37 | |
---|
| 38 | # CREATE validation directory |
---|
| 39 | set_valid_dir |
---|
| 40 | |
---|
| 41 | # COMPILE NEMO |
---|
| 42 | cd $NEMO_DIR |
---|
| 43 | . ./makenemo -m ${CMP_NAM} -n ${CONFIG}_ST -a ${CFG_REF} -j ${NJ} add_key ${ADD_KEYS} del_key ${DEL_KEYS} |
---|
| 44 | |
---|
| 45 | # SETUP REF/MPP/RST run directory (copy EXP00 + REF/RST/MPP + mv old files) |
---|
| 46 | for TEST_NAME in 'REF MPP RST'; do |
---|
| 47 | cd $SETTE_DIR |
---|
| 48 | |
---|
| 49 | # set EXE_DIR and move old files |
---|
| 50 | . ./prepare_exe_dir.sh # set $EXE_DIR |
---|
| 51 | |
---|
| 52 | # set XIOS |
---|
| 53 | set_xios # set_xio_using_server iodef.xml ${USING_MPMD} |
---|
| 54 | |
---|
| 55 | # set namelist |
---|
| 56 | set_namelist_common # set common namelist |
---|
| 57 | set_namelist_${TEST_NAME} # set specific namelist |
---|
| 58 | |
---|
| 59 | NPROC=$((NPROC$TEST_NAME)) |
---|
| 60 | |
---|
| 61 | # create run_job.sh file for REF/MPP/RST |
---|
| 62 | . ./prepare_run_job.sh input_${CONFIG}.cfg ${NPROC} ${TEST_NAME} ${MPIRUN_FLAG} run_job.sh ${NUM_XIOSERVERS} ${NEMO_VALID} |
---|
| 63 | done |
---|
| 64 | |
---|
| 65 | # link restart for RST simulation |
---|
| 66 | link_restart |
---|
| 67 | |
---|
| 68 | # RUN Simulation REF/MPP/RST (report script will need to be updated) |
---|
| 69 | # option to wait REF is done defined in param ('-W depend=afterany:' for SGE) |
---|
| 70 | . ./fcm_job.sh $NPROCREF ${MAIN_DIR}/cfgs/${CONFIG}_ST/REF ; REFid=${JOBID} # JOBID comes from fcm_job.sh |
---|
| 71 | . ./fcm_job.sh $NPROCMPP ${MAIN_DIR}/cfgs/${CONFIG}_ST/MPP ; MPPid=${JOBID} # |
---|
| 72 | . ./fcm_job.sh $NPROCRST ${MAIN_DIR}/cfgs/${CONFIG}_ST/RST -w $REFid ; RSTid=${JOBID} # wait REFid to finish to start |
---|
| 73 | |
---|
| 74 | done |
---|