[1] | 1 | ##################################################### |
---|
| 2 | # Author : Simona Flavoni for NEMO |
---|
| 3 | # Contact : sflod@locean-ipsl.upmc.fr |
---|
| 4 | # |
---|
| 5 | # Some scripts called by sette.sh |
---|
| 6 | # fcm_job.sh : simple job to run NEMO with fcm |
---|
| 7 | ###################################################### |
---|
| 8 | #set -x |
---|
| 9 | set -o posix |
---|
| 10 | #set -u |
---|
| 11 | #set -e |
---|
| 12 | #+ |
---|
| 13 | # |
---|
| 14 | # ================ |
---|
| 15 | # fcm_job.sh |
---|
| 16 | # ================ |
---|
| 17 | # |
---|
| 18 | # -------------------------- |
---|
| 19 | # Simple job for NEMO tests |
---|
| 20 | # -------------------------- |
---|
| 21 | # |
---|
| 22 | # SYNOPSIS |
---|
| 23 | # ======== |
---|
| 24 | # |
---|
| 25 | # :: |
---|
| 26 | # |
---|
| 27 | # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG |
---|
| 28 | # |
---|
| 29 | # |
---|
| 30 | # DESCRIPTION |
---|
| 31 | # =========== |
---|
| 32 | # |
---|
| 33 | # Simple job for SET TESTS for NEMO (SETTE) |
---|
| 34 | # |
---|
| 35 | # get input files (if needed) : tar file |
---|
| 36 | # (note this job needs to have an input_CONFIG.cfg in which can be found input tar file name) |
---|
| 37 | # |
---|
| 38 | # runs job in interactive or batch mode : all jobs using 1 process are run interactive, and all MPP jobs are |
---|
| 39 | # |
---|
| 40 | # run in batch (MPI_INTERACT="no") or interactive (MPI_INTERACT="yes") see sette.sh and BATCH_TEMPLATE directory |
---|
| 41 | # |
---|
| 42 | # and call post_test_tidyup function (that moves in NEMO_VALIDATION_DIR solver.stat, tracer.stat (for LOBSTER & PISCES) & ocean.output) |
---|
| 43 | # |
---|
| 44 | # EXAMPLES |
---|
| 45 | # ======== |
---|
| 46 | # |
---|
| 47 | # :: |
---|
| 48 | # |
---|
| 49 | # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG |
---|
| 50 | # |
---|
| 51 | # run a job of config GYRE with 1 processor SHORT test ( 5 days ) using an interactive run without mpirun |
---|
| 52 | # $ ./fcm_job.sh input_GYRE.cfg 1 SHORT yes no |
---|
| 53 | # |
---|
| 54 | # run a job of config ORCA2_LIM_PISCES with 8 processors test RESTARTABILITY submitting the job to the batch queue system and using mpirun |
---|
| 55 | # $ ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 LONG no yes |
---|
| 56 | # |
---|
| 57 | # |
---|
| 58 | # TODO |
---|
| 59 | # ==== |
---|
| 60 | # |
---|
| 61 | # option debug |
---|
| 62 | # |
---|
| 63 | # |
---|
| 64 | # EVOLUTIONS |
---|
| 65 | # ========== |
---|
| 66 | # |
---|
[4] | 67 | # $Id: fcm_job.sh 3294 2012-01-28 16:44:18Z rblod $ |
---|
[1] | 68 | # |
---|
| 69 | # |
---|
| 70 | # |
---|
| 71 | # * creation |
---|
| 72 | # |
---|
| 73 | #- |
---|
| 74 | # |
---|
| 75 | |
---|
| 76 | usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg NUMBER_OF_PROCS TEST_NAME INTERACT MPI_FLAG" |
---|
| 77 | usage=" example : ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 SHORT no/yes no/yes" |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | minargcount=2 |
---|
| 81 | if [ ${#} -lt ${minargcount} ] |
---|
| 82 | then |
---|
| 83 | echo "not enought arguments for fcm_job.sh script" |
---|
| 84 | echo "control number of argument of fcm_job.sh in sette.sh" |
---|
| 85 | echo "${usage}" |
---|
| 86 | exit 1 |
---|
| 87 | fi |
---|
| 88 | unset minargcount |
---|
| 89 | if [ ! -f ${SETTE_DIR}/output.sette ] ; then |
---|
| 90 | touch ${SETTE_DIR}/output.sette |
---|
| 91 | fi |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | export NB_PROCS=$1 |
---|
| 95 | export JOB_FILE=$2 |
---|
| 96 | ################################################################ |
---|
| 97 | # RUN OPA |
---|
| 98 | cd ${EXE_DIR} |
---|
| 99 | |
---|
| 100 | # submit job to batch system |
---|
| 101 | if [ ${NB_PROC} -eq 1 ]; then |
---|
| 102 | eval ${BATCH_COMMAND_SEQ} $JOB_FILE |
---|
| 103 | else |
---|
| 104 | eval ${BATCH_COMMAND_PAR} $JOB_FILE |
---|
| 105 | fi |
---|
| 106 | |
---|