- Timestamp:
- 2015-08-17T21:28:42+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
r5695 r5696 119 119 120 120 ## List & copy files in case of personal inputs 121 [ -z "${NEMO_TARF}" ] && cmd_iol="ls ${NEMO_FORC}/*" && cmd_iof="\cp ${NEMO_FORC}/* ."121 [ -z "${NEMO_TARF}" ] && { cmd_iol="ls ${NEMO_FORC}/*"; cmd_iof="\cp ${NEMO_FORC}/* ."; } 122 122 123 123 ${cmd_iol} > inputs_list.txt … … 172 172 173 173 ## Kill remaining job & stop the test if it's too long 174 [ ${time_elapsed} -eq ${TIME_LIMI} ] && ${JOB_DELE} ${JOB_ID} &> /dev/null && get_out 6174 [ ${time_elapsed} -eq ${TIME_LIMI} ] && { ${JOB_DELE} ${JOB_ID} &> /dev/null; get_out 6; } 175 175 } 176 176 … … 178 178 diff_results() { 179 179 local file 180 local files_list='' 180 local files_list='' mesg='Same' 181 181 182 182 ## Simple diff … … 184 184 185 185 ## Stop if no benchmark files (ocean.output, eventual stat files) 186 [ ! -e ${REFE_DIR}/$file ] && export ST='FAILED' && get_out 7186 [ ! -e ${REFE_DIR}/$file ] && { export ST='FAILED'; get_out 7; } 187 187 188 188 diff -q $file ${REFE_DIR}/$file 189 189 190 190 ## Continue even if it differs 191 [ $? -ne 0 ] && export ST='FAILED' && files_list+=$file' '191 [ $? -ne 0 ] && { export ST='FAILED'; mesg='Different'; files_list+=$file' '; } 192 192 done 193 194 [ $mesg == 'Same' ] && echo $mesg 193 195 194 196 ## List different files for web comment … … 203 205 204 206 ## Stop if no benchmark files (ie time.step) 205 [ ! -e ${REFE_DIR}/time.step ] && export ST='FAILED' && get_out 7207 [ ! -e ${REFE_DIR}/time.step ] && { export ST='FAILED'; get_out 7; } 206 208 time_step=$( cat ${REFE_DIR}/time.step | tr -d [:space:] ) 207 209 … … 240 242 ## CDO can return void stdout with no difference 241 243 if [[ -n "$dif" && $( echo $dif | awk '{print $1}' ) -ne 0 ]]; then 242 export ST='FAILED' && files_list+=$file' '243 let dift+=$( echo $dif | awk '{print $1}' )244 export ST='FAILED' 245 files_list+=$file' ' && let dift+=$( echo $dif | awk '{print $1}' ) 244 246 echo $file.nc': '$dif 245 247 fi … … 258 260 ## List different files for web comment with sum of different parameters 259 261 if [ $dift -ne 0 ]; then 260 echo 'Restarts: '${files_list}$dift' record(s) differ<br>' | tee -a temp_${FILE_COMM} 262 echo 'Restarts: '${files_list}$dift' record(s) differ<br>' \ 263 >> temp_${FILE_COMM} 264 else 265 echo 'Same' 261 266 fi 262 267 … … 269 274 270 275 get_cpu_time() { 271 ## Interest 276 ## Interest for checking unusual time computing 272 277 local real_cpu_time=$( eval ${JOB_TIME} ) 273 278 … … 282 287 if [ -e ocean.output ]; then 283 288 ## 'W A R N I N G' by default 284 opat="-A2 '^ $state'"285 [ "$state" == 'E R R O R' ] && opat="-A4 '$state'"289 opat="-A2 \"^ $state\"" 290 [ "$state" == 'E R R O R' ] && opat="-A4 \"$state\"" 286 291 287 292 ## Select first occurence for web comment 288 line=$( grep -m1 $opat ocean.output | tr -d '\n' )293 line=$( eval grep -m1 $opat ocean.output | tr -d '\n' ) 289 294 echo $line 290 295 fi … … 349 354 350 355 ERR=$1 351 cd ${TEST_DIR} ## In case of compilation error 356 357 print_step 'End of trusting test' 358 359 ## In case of compilation error 360 cd ${TEST_DIR} 352 361 353 362 if [ $ST == 'FAILED' ]; then … … 369 378 370 379 else 371 ERR='Code is reliable' 372 fi 373 374 print_step '' 380 echo 'Success' && ERR='Code is reliable' 381 fi 375 382 376 383 ## Eventual comments from ocean.output … … 384 391 fi 385 392 393 ## Last messenger files 386 394 export ERR 387 395 sed -i "2 s/.*/$ST/" ${FILE_STAT}; sed -i "2 s/.*/$ERR/" ${FILE_RESU} … … 395 403 396 404 ## Share trusting result (.txt file/mail) 405 print_step 'Trusting digest' 397 406 mesg_make 398 407 mesg_publish
Note: See TracChangeset
for help on using the changeset viewer.