- Timestamp:
- 2012-11-16T11:23:06+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_r3342_MERCATOR7_SST/NEMOGCM/SETTE/prepare_job.sh
r3422 r3572 1 1 ##################################################### 2 # Author : Italo Epicoco for NEMO 3 # Contact : italo.epicoco@unisalento.it 4 # 5 # Some scripts called by sette.sh 6 # prepare_job.sh : create the job script for running job 2 # Author : Simona Flavoni for NEMO 3 # Contact : sflod@locean-ipsl.upmc.fr 4 # 5 # ---------------------------------------------------------------------- 6 # NEMO/SETTE , NEMO Consortium (2010) 7 # Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 8 # ---------------------------------------------------------------------- 9 # 10 # Some scripts called by sette.sh 11 # prepare_job.sh : creates the job script for running job 7 12 ###################################################### 8 #set - x13 #set -vx 9 14 set -o posix 10 15 #set -u 11 16 #set -e 12 # 17 #+ 13 18 # 14 19 # ================ … … 16 21 # ================ 17 22 # 18 # -------------------------- 19 # createthe job script for NEMO tests20 # -------------------------- 23 # ------------------------------------------------- 24 # script that creates the job script for NEMO tests 25 # ------------------------------------------------- 21 26 # 22 27 # SYNOPSIS … … 25 30 # :: 26 31 # 27 # $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_ INTERACT MPI_FLAG32 # $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG JOB_FILE 28 33 # 29 34 # … … 31 36 # =========== 32 37 # 33 # Simple job for SET TESTS for NEMO (SETTE)38 # Part of the SETTE package to run tests for NEMO 34 39 # 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) 40 # prepare the script $JOB_FILE to run the tests 43 41 # 44 42 # EXAMPLES … … 47 45 # :: 48 46 # 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 47 # $ ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG $JOB_FILE 48 # 49 # prepare the $JOB_FILE for execution 56 50 # 57 51 # … … 65 59 # ========== 66 60 # 67 # $Id: fcm_job.sh 3050 2011-11-07 14:11:34Z acc $61 # $Id: prepare_job.sh 3050 2011-11-07 14:11:34Z acc $ 68 62 # 69 63 # … … 74 68 # 75 69 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"70 usage=" Usage : ./prepare_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_FLAG JOB_FILE" 71 usage=" example : ./prepare_job.sh input_ORCA2_LIM_PISCES.cfg 8 SHORT no/yes $JOB_FILE" 78 72 79 73 … … 81 75 if [ ${#} -lt ${minargcount} ] 82 76 then 83 echo "not enough t arguments for fcm_job.sh script"84 echo "control number of argument of fcm_job.sh in sette.sh"77 echo "not enough arguments for prepare_job.sh script" 78 echo "control number of argument of prepare_job.sh in sette.sh" 85 79 echo "${usage}" 86 80 exit 1 … … 165 159 exit 1 166 160 fi 167 #if [ ${NB_PROC} == 1 ] ; then 168 # echo "running opa" >> ${SETTE_DIR}/output.sette 169 # echo " " >> ${SETTE_DIR}/output.sette 170 # ./opa 171 # 172 # Tidy out output from this test and populate the NEMO_VALIDATION_DIR tree 173 # 174 # post_test_tidyup 175 #else 176 # echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 177 # echo " " >> ${SETTE_DIR}/output.sette 178 179 # if [ ${MPI_INTERACT} == "yes" ] ; then 180 # # 181 # # example for brodie (NEC SX8) machine 182 # # mpirun -np ${NB_PROC} opa 183 # # example for dedale machine 184 # # mpirun --mca btl self,tcp -np ${NB_PROC} opa 185 # # example for vargas (IBM Power6) machine 186 # mpiexec -n ${NB_PROC} opa 187 # # 188 # post_test_tidyup 189 # fi 190 # 161 191 162 # example for NOCS Altix system using PBS batch submission (requires ${SETTE_DIR}/sette_batch_template file) 192 163 # 193 # if [ ${MPI_ INTERACT} == "no" ] ; then164 # if [ ${MPI_FLAG} == "no" ] ; then 194 165 case ${COMPILER} in 195 166 ALTIX_NAUTILUS_MPT) … … 198 169 # number of processes required is an integer multiple of 4 199 170 # 200 NB_NODES=$( echo $NB_PROC | awk '{print $1 $1/ 4}')171 NB_NODES=$( echo $NB_PROC | awk '{print $1 / 4}') 201 172 else 202 173 # … … 209 180 ifort_MERCATOR_CLUSTER) 210 181 echo NB_PROCS ${NB_PROC} 211 NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}' | awk '{print $1 / 8 + 1 }')212 182 echo NB_NODES ${NB_NODES} 213 183 echo NB_PROC ${NB_PROC} 214 184 if [ ${NB_PROC} -eq 1 ] ; then 185 NB_NODES=1 215 186 QUEUE=monoproc 187 NB_PROC_NODE=${NB_PROC} 216 188 else 217 189 if [ ${NB_PROC} -le 8 ] ; then 190 NB_NODES=1 218 191 QUEUE=mono 192 NB_PROC_NODE=${NB_PROC} 219 193 else 194 NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}' | awk '{print $1 / 8 }') 220 195 QUEUE=multi 221 NB_PROC =8196 NB_PROC_NODE=8 222 197 fi 223 198 fi 199 echo NB_PROCS ${NB_PROC} 200 echo NB_NODES ${NB_NODES} 201 echo NB_PROC_NODE ${NB_PROC_NODE} 224 202 ;; 225 203 *) … … 231 209 # Pass settings into job file by using sed to edit predefined strings 232 210 # 233 ((mem=5*NB_PROC))234 echo NB_NODES NB_PROC QUEUE ${NB_NODES} ${NB_PROC} ${QUEUE}235 211 cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCS/${NB_PROC}/" \ 236 -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \237 212 -e"s:DEF_SETTE_DIR:${SETTE_DIR}:" -e"s:DEF_INPUT_DIR:${INPUT_DIR}:" \ 238 213 -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ … … 258 233 fi 259 234 260 chmod a+x $JOB_FILE 235 chmod a+x $JOB_FILE ; echo "$JOB_FILE is ready" 261 236 262 237 #fi
Note: See TracChangeset
for help on using the changeset viewer.