Changeset 3661
- Timestamp:
- 2012-11-26T14:40:22+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_NOC_MERCATOR_2012/NEMOGCM/SETTE/prepare_job.sh
r3651 r3661 11 11 # prepare_job.sh : creates the job script for running job 12 12 ###################################################### 13 #set - x13 #set -vx 14 14 set -o posix 15 15 #set -u 16 16 #set -e 17 # 17 #+ 18 18 # 19 19 # ================ … … 30 30 # :: 31 31 # 32 # $ ./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 33 33 # 34 34 # … … 36 36 # =========== 37 37 # 38 # Simple job for SET TESTS for NEMO (SETTE)38 # Part of the SETTE package to run tests for NEMO 39 39 # 40 # get input files (if needed) : tar file 41 # (note this job needs to have an input_CONFIG.cfg in which can be found input tar file name) 42 # 43 # runs job in interactive or batch mode : all jobs using 1 process are run interactive, and all MPP jobs are 44 # 45 # run in batch (MPI_INTERACT="no") or interactive (MPI_INTERACT="yes") see sette.sh and BATCH_TEMPLATE directory 46 # 47 # 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 48 41 # 49 42 # EXAMPLES … … 52 45 # :: 53 46 # 54 # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 55 # 56 # run a job of config GYRE with 1 processor SHORT test ( 5 days ) using an interactive run without mpirun 57 # $ ./fcm_job.sh input_GYRE.cfg 1 SHORT yes no 58 # 59 # run a job of config ORCA2_LIM_PISCES with 8 processors test RESTARTABILITY submitting the job to the batch queue system and using mpirun 60 # $ ./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 61 50 # 62 51 # … … 70 59 # ========== 71 60 # 72 # $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 $ 73 62 # 74 63 # … … 79 68 # 80 69 81 usage=" Usage : ./ fcm_job.sh input_CONFIG_NAME.cfg NUMBER_OF_PROCS TEST_NAME INTERACT MPI_FLAG"82 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" 83 72 84 73 … … 86 75 if [ ${#} -lt ${minargcount} ] 87 76 then 88 echo "not enough t arguments for fcm_job.sh script"89 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" 90 79 echo "${usage}" 91 80 exit 1 … … 170 159 exit 1 171 160 fi 172 #if [ ${NB_PROC} == 1 ] ; then 173 # echo "running opa" >> ${SETTE_DIR}/output.sette 174 # echo " " >> ${SETTE_DIR}/output.sette 175 # ./opa 176 # 177 # Tidy out output from this test and populate the NEMO_VALIDATION_DIR tree 178 # 179 # post_test_tidyup 180 #else 181 # echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 182 # echo " " >> ${SETTE_DIR}/output.sette 183 184 # if [ ${MPI_INTERACT} == "yes" ] ; then 185 # # 186 # # example for brodie (NEC SX8) machine 187 # # mpirun -np ${NB_PROC} opa 188 # # example for dedale machine 189 # # mpirun --mca btl self,tcp -np ${NB_PROC} opa 190 # # example for vargas (IBM Power6) machine 191 # mpiexec -n ${NB_PROC} opa 192 # # 193 # post_test_tidyup 194 # fi 195 # 161 196 162 # example for NOCS Altix system using PBS batch submission (requires ${SETTE_DIR}/sette_batch_template file) 197 163 # 198 # if [ ${MPI_ INTERACT} == "no" ] ; then164 # if [ ${MPI_FLAG} == "no" ] ; then 199 165 case ${COMPILER} in 200 166 ALTIX_NAUTILUS_MPT) … … 203 169 # number of processes required is an integer multiple of 4 204 170 # 205 NB_NODES=$( echo $NB_PROC | awk '{print $1 $1/ 4}')171 NB_NODES=$( echo $NB_PROC | awk '{print $1 / 4}') 206 172 else 207 173 # … … 215 181 echo NB_PROCS ${NB_PROC} 216 182 echo NB_NODES ${NB_NODES} 217 echo NB_PROC ${NB_PROC} 183 echo NB_PROC ${NB_PROC} 218 184 if [ ${NB_PROC} -eq 1 ] ; then 219 185 NB_NODES=1 220 186 QUEUE=monoproc 221 NB_PROC_NODE=${NB_PROC} 187 NB_PROC_NODE=${NB_PROC} 222 188 else 223 if [ ${NB_PROC} -le 8 ] ; then 189 if [ ${NB_PROC} -le 8 ] ; then 224 190 NB_NODES=1 225 191 QUEUE=mono 226 NB_PROC_NODE=${NB_PROC} 192 NB_PROC_NODE=${NB_PROC} 227 193 else 228 194 NB_NODES=$( echo $NB_PROC | awk '{print $1 - $1 % 8}' | awk '{print $1 / 8 }') 229 195 QUEUE=multi 230 196 NB_PROC_NODE=8 231 fi 232 fi 197 fi 198 fi 233 199 echo NB_PROCS ${NB_PROC} 234 200 echo NB_NODES ${NB_NODES} 235 echo NB_PROC_NODE ${NB_PROC_NODE} 236 201 echo NB_PROC_NODE ${NB_PROC_NODE} 202 ;; 237 203 *) 238 204 NB_NODES=${NB_PROC} … … 243 209 # Pass settings into job file by using sed to edit predefined strings 244 210 # 245 ((mem=5*NB_PROC)) 246 echo NB_NODES NB_PROC QUEUE ${NB_NODES} ${NB_PROC} ${QUEUE} 247 cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCSNODE/${NB_PROC_NODE}/" \ 248 -e"s/NPROCS/${NB_PROC}/" \ 249 -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \ 250 -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" \ 211 cat ${SETTE_DIR}/job_batch_template | sed -e"s/NODES/${NB_NODES}/" -e"s/NPROCS/${NB_PROC}/" \ 251 212 -e"s:DEF_SETTE_DIR:${SETTE_DIR}:" -e"s:DEF_INPUT_DIR:${INPUT_DIR}:" \ 252 213 -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ … … 255 216 -e"s:DEF_NEMO_VALIDATION:${NEMO_VALIDATION_DIR}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \ 256 217 -e"s:DEF_CMP_NAM:${CMP_NAM}:" -e"s:DEF_TEST_NAME:${TEST_NAME}:" > run_sette_test.job 257 218 219 if [ ${COMPILER} -eq 'ifort_MERCATOR_CLUSTER' ] ; then 220 cat run_sette_test.job | sed -e"s/QUEUE/${QUEUE}/" -e"s/MEM/${mem}/" > run_sette_test1.job 221 mv run_sette_test1.job run_sette_test.job 222 fi 258 223 # 259 224 # create the unique submission job script … … 272 237 fi 273 238 274 chmod a+x $JOB_FILE 239 chmod a+x $JOB_FILE ; echo "$JOB_FILE is ready" 275 240 276 241 #fi
Note: See TracChangeset
for help on using the changeset viewer.