Changeset 3294 for trunk/NEMOGCM/SETTE/fcm_job.sh
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/SETTE/fcm_job.sh
r2687 r3294 25 25 # :: 26 26 # 27 # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME 27 # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 28 28 # 29 29 # … … 31 31 # =========== 32 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) 33 37 # 34 # Simple job for SET TESTS for NEMO (SETTE)38 # runs job in interactive or batch mode : all jobs using 1 process are run interactive, and all MPP jobs are 35 39 # 36 # this job creates tree of validation in NEMO_VALIDATION_DIR as follows :40 # run in batch (MPI_INTERACT="no") or interactive (MPI_INTERACT="yes") see sette.sh and BATCH_TEMPLATE directory 37 41 # 38 # NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE) 39 # 40 # NEMO_VALIDATION_DIR : is choosen in param.cfg 41 # 42 # WCONFIG_NAME : set by makenemo at the moment of compilation 43 # 44 # WCOMPILER_NAME : set by makenemo at the moment of compilation 45 # 46 # TEST_NAME : convention is LONG=10 days run, SHORT=5 days run 47 # 48 # REVISION_NUMBER(or DATE) : revision number by svn info, if problems with svn date is taken 42 # and call post_test_tidyup function (that moves in NEMO_VALIDATION_DIR solver.stat, tracer.stat (for LOBSTER & PISCES) & ocean.output) 49 43 # 50 44 # EXAMPLES … … 53 47 # :: 54 48 # 55 # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME 49 # $ ./fcm_job.sh INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPI_INTERACT MPI_FLAG 56 50 # 57 # run a job of config GYRE with 1 processor test REPRODUCTINILITY58 # $ ./fcm_job.sh input_GYRE.cfg 1 SHORT 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 59 53 # 60 # run a job of config ORCA2_LIM_PISCES with 8 processors test RESTARTABILITY 61 # $ ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 LONG 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 62 56 # 63 57 # … … 80 74 # 81 75 82 usage=" Usage : ./fcm_job.sh input_CONFIG_NAME.cfg NUMBER_OF_PROCS TEST_NAME "83 usage=" example : ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 8 RUN"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" 84 78 85 79 86 minargcount= 380 minargcount=2 87 81 if [ ${#} -lt ${minargcount} ] 88 82 then … … 97 91 fi 98 92 99 echo "date: `date`" >> ${SETTE_DIR}/output.sette100 echo "" >> ${SETTE_DIR}/output.sette101 echo "running config: ${NEW_CONF}" >> ${SETTE_DIR}/output.sette102 echo "" >> ${SETTE_DIR}/output.sette103 echo "list of cpp_keys: " >> ${SETTE_DIR}/output.sette104 echo "`more ../CONFIG/${NEW_CONF}/cpp_${NEW_CONF}.fcm`" >> ${SETTE_DIR}/output.sette105 echo "" >> ${SETTE_DIR}/output.sette106 echo "compiling with: ${CMP_NAM}" >> ${SETTE_DIR}/output.sette107 echo "" >> ${SETTE_DIR}/output.sette108 echo "executing script : \"fcm_job $@\" " >> ${SETTE_DIR}/output.sette109 echo " " >> ${SETTE_DIR}/output.sette110 93 111 ################################################################ 112 # SET INPUT 113 # get the input tarfile if needed 114 tar_file=$(sed -ne "1,1p" $1) 115 if [ "$(cat $1 | grep -c ".tar" )" -ne 0 ] ; then 116 echo "looking for tar file" >> ${SETTE_DIR}/output.sette 117 echo " " >> ${SETTE_DIR}/output.sette 118 cp ${FORCING_DIR}/${tar_file} ${INPUT_DIR}/. 119 if [ ! -f ${INPUT_DIR}/${tar_file} ] ; then 120 echo "PROBLEM during copy of tar file" >> ${SETTE_DIR}/output.sette 121 echo "tar file IS NOT present in ${INPUT_DIR} directory " >> ${SETTE_DIR}/output.sette 122 echo " " >> ${SETTE_DIR}/output.sette 123 echo "PROBLEM during copy of tar file" 124 exit 1 125 else 126 cd ${INPUT_DIR} ; tar xvof ${INPUT_DIR}/*.tar ; gunzip -f *gz 127 fi 128 fi 129 130 if [ -f ${INPUT_DIR}/namelist_ice_lim2 ] ; then 131 echo "choosing for namelist ice " >> ${SETTE_DIR}/output.sette 132 echo " " >> ${SETTE_DIR}/output.sette 133 cp ${INPUT_DIR}/namelist_ice_lim2 ${INPUT_DIR}/namelist_ice 134 elif [ -f ${INPUT_DIR}/namelist_ice_lim3 ] ; then 135 cp ${INPUT_DIR}/namelist_ice_lim3 ${INPUT_DIR}/namelist_ice 136 fi 137 138 139 if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "agrif" )" -ne 0 ] ; then 140 #- Namelist for ocean and ice (agrif fine grid) 141 echo "choosing for namelist for AGRIF" >> ${SETTE_DIR}/output.sette 142 echo " " >> ${SETTE_DIR}/output.sette 143 cp ${INPUT_DIR}/1_namelist_ice_lim2 ${INPUT_DIR}/1_namelist_ice 144 fi 145 ################################################################ 146 94 export NB_PROCS=$1 95 export JOB_FILE=$2 147 96 ################################################################ 148 97 # RUN OPA 149 cd ${INPUT_DIR} 150 NB_PROC=$2 151 if [ ! -r ${INPUT_DIR}/opa ] 152 then 153 echo "executable opa does not exist" 154 echo "executable opa does not exist, exit" >> ${SETTE_DIR}/output.sette 155 exit 1 156 fi 157 if [ ${NB_PROC} == 1 ] ; then 158 echo "running opa" >> ${SETTE_DIR}/output.sette 159 echo " " >> ${SETTE_DIR}/output.sette 160 ./opa 161 else 162 echo "running opa in MPI" >> ${SETTE_DIR}/output.sette 163 echo " " >> ${SETTE_DIR}/output.sette 164 # example for brodie (NEC SX8) machine 165 # mpirun -np ${NB_PROC} opa 166 # example for dedale machine 167 # mpirun --mca btl self,tcp -np ${NB_PROC} opa 168 # example for vargas (IBM Power6) machine 169 mpiexec -n ${NB_PROC} opa 170 fi 171 ################################################################ 172 # SMALL DEBUG 173 # echo "control that time.step exists 174 if [ ! -r ${INPUT_DIR}/time.step ] 175 then 176 echo "file time.step does not exist" >> ${SETTE_DIR}/output.sette 177 echo "some problems during execution of model" >> ${SETTE_DIR}/output.sette 178 exit 1 179 else 180 echo "file time.step exists" >> ${SETTE_DIR}/output.sette 181 echo "ok model run" >> ${SETTE_DIR}/output.sette 182 fi 183 ################################################################ 98 cd ${EXE_DIR} 184 99 185 ################################################################ 186 # SAVE OUTPUT, DEBUG & RESTART FILES 187 echo "saving ocean & ice output, debug & restart files" >> ${SETTE_DIR}/output.sette 188 echo " " >> ${SETTE_DIR}/output.sette 189 [ ! -d ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR} 190 [ -f *ocean.output ] && mv *ocean.output ${OUTPUT_DIR}/. 191 [ -f *solver.stat ] && mv *solver.stat ${OUTPUT_DIR}/. 192 [ -n "$(ls *_grid_*)" ] && mv *_grid_*.nc ${OUTPUT_DIR}/. 193 [ -n "$(ls *_ptrc_*)" ] && mv *_ptrc_*.nc ${OUTPUT_DIR}/. 194 [ -n "$(ls *_diad_*)" ] && mv *_diad_*.nc ${OUTPUT_DIR}/. 195 [ -n "`ls *restart*`" ] && cp *restart*.nc ${OUTPUT_DIR}/. 196 [ -f ice_evolu ] && mv ice_evolu ${OUTPUT_DIR}/. 197 [ -n "`ls *icemod*`" ] && mv *icemod* ${OUTPUT_DIR}/. 198 #- Save ftrace file 199 [ -f ftrace.out* ] && cp ftrace.out* ${OUTPUT_DIR}/. 200 ################################################################ 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 201 106 202 ################################################################203 # SAVE IN NEMO_VALIDATION tree204 export LANG=en_US205 cd ${CONFIG_DIR}206 cd ../207 REVISION_NB=`svn info | grep -i "Revision:" | sed -e "s/ //" | cut -d ":" -f 2`208 if [ ${#REVISION_NB} -eq 0 ]209 then210 echo "some problems with svn info command"211 echo "some problems with svn info command" >> ${SETTE_DIR}/output.sette212 REVISION_NB=`date +%Y%m%d`213 echo "put in ${REVISION_NB} date"214 echo "put in ${REVISION_NB} date" >> ${SETTE_DIR}/output.sette215 else216 echo "value of revision number of NEMOGCM: ${REVISION_NB}"217 fi218 cd ${NEMO_VALIDATION_DIR}219 export TEST_NAME=$3220 `mkdir -p ${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}`221 NEMO_VALID=${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}222 if [ -d ${NEMO_VALID} ] ; then223 echo "created ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette224 else225 echo "problems in creating ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette226 echo "EXIT,"227 exit 1228 fi229 [ -f ${OUTPUT_DIR}/*ocean.output ] && mv ${OUTPUT_DIR}/*ocean.output ${NEMO_VALID}/.230 [ -f ${OUTPUT_DIR}/*solver.stat ] && mv ${OUTPUT_DIR}/*solver.stat ${NEMO_VALID}/.231 [ -n "`ls ${OUTPUT_DIR}/*restart*`" ] && mv ${OUTPUT_DIR}/*restart* ${NEMO_VALID}/.232 [ -f ${OUTPUT_DIR}/ice_evolu ] && mv ${OUTPUT_DIR}/ice_evolu ${NEMO_VALID}/.233 if [ -n "$(ls ${NEMO_VALID}/*solver*)" ] ; then234 echo "moved solver.stat in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette235 echo "moved solver.stat in ${NEMO_VALID} directory"236 else237 echo "problem in looking for solver.stat file in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette238 echo "solver.stat IS NOT in ${NEMO_VALID} directory"239 fi240 if [ -n "$(ls ${NEMO_VALID}/*ocean.output*)" ] ; then241 echo "moved ocean.output in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette242 echo "moved ocean.output in ${NEMO_VALID} directory"243 else244 echo "problem in looking for ocean.output file in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette245 echo "ocean.output IS NOT in ${NEMO_VALID} directory"246 fi247 if [ -n "`ls ${NEMO_VALID}/*restart*`" ] ; then248 echo "moved restart files in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette249 echo "moved restart files in ${NEMO_VALID} directory"250 else251 echo "problem in looking for restart files in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette252 echo "restart files ARE NOT in ${NEMO_VALID} directory"253 fi254 if [ -n "$(ls ${NEMO_VALID}/ice_evolu)" ] ; then255 echo "moved ice_evolu in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette256 echo "moved ice_evolu in ${NEMO_VALID} directory"257 else258 echo "problem looking for ice_evolu file in ${NEMO_VALID} directory" >> ${SETTE_DIR}/output.sette259 echo "ice_evolu IS NOT in ${NEMO_VALID} directory"260 fi261 ################################################################
Note: See TracChangeset
for help on using the changeset viewer.