Changeset 5696


Ignore:
Timestamp:
2015-08-17T21:28:42+02:00 (5 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Improve trusting output readability; use of commands block instead of multiples '&&'

Location:
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/X64_ADA.cfg

    r5695 r5696  
    2323 
    2424## $CDO command to compare 2 datasets 
    25 CDOD=$CDO' diffn' 
     25CDOD='cdo diffn' 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/X64_ADA_at.cfg

    r5695 r5696  
    2323 
    2424## $CDO command to compare 2 datasets 
    25 CDOD=$CDO' diffn' 
     25CDOD='cdo diffn' 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/romr005.cfg

    r5695 r5696  
    3434REFE_DIR=${DIR_STOR}/${REFE_CONF}/${NEMO_BRAN} 
    3535TEST_DIR=${DIR_SCRA}/${REFE_CONF}/${NEMO_BRAN}/trusting_${DATE} 
    36 CDOD="$CDO diffn" 
     36 
    3737 
    3838## External softs directories: 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh

    r5695 r5696  
    164164print_step 'Compare new outputs to benchmark files' 
    165165diff_results 
    166 [ $ST == 'FAILED' ] && echo 'Failure' || echo 'Success' 
    167166print_step 'Compare new restarts to benchmark files' 
    168167diff_restart 
    169 [ $ST == 'FAILED' ] && get_out 8      || echo 'Success' 
     168[ $ST == 'FAILED' ] && get_out 8 
    170169 
    171170 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh

    r5695 r5696  
    119119 
    120120    ## 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}/* ."; } 
    122122 
    123123    ${cmd_iol} > inputs_list.txt 
     
    172172 
    173173    ## 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 6 
     174    [ ${time_elapsed} -eq ${TIME_LIMI} ] && { ${JOB_DELE} ${JOB_ID} &> /dev/null; get_out 6; } 
    175175} 
    176176 
     
    178178diff_results() { 
    179179    local file 
    180     local files_list='' 
     180    local files_list='' mesg='Same' 
    181181 
    182182    ## Simple diff 
     
    184184 
    185185   ## Stop if no benchmark files (ocean.output, eventual stat files) 
    186    [ ! -e ${REFE_DIR}/$file ] && export ST='FAILED' && get_out 7 
     186   [ ! -e ${REFE_DIR}/$file ] && { export ST='FAILED'; get_out 7; } 
    187187 
    188188   diff -q $file ${REFE_DIR}/$file 
    189189 
    190190   ## 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' '; } 
    192192    done 
     193 
     194    [ $mesg == 'Same' ] && echo $mesg 
    193195 
    194196    ## List different files for web comment 
     
    203205 
    204206    ## Stop if no benchmark files (ie time.step) 
    205     [ ! -e ${REFE_DIR}/time.step ] && export ST='FAILED' && get_out 7 
     207    [ ! -e ${REFE_DIR}/time.step ] && { export ST='FAILED'; get_out 7; } 
    206208    time_step=$( cat ${REFE_DIR}/time.step | tr -d [:space:] ) 
    207209 
     
    240242         ## CDO can return void stdout with no difference 
    241243         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}' ) 
    244246             echo $file.nc': '$dif 
    245247         fi 
     
    258260        ## List different files for web comment with sum of different parameters 
    259261   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' 
    261266   fi 
    262267 
     
    269274 
    270275get_cpu_time() { 
    271     ## Interest  
     276    ## Interest for checking unusual time computing 
    272277    local real_cpu_time=$( eval ${JOB_TIME} ) 
    273278 
     
    282287    if [ -e ocean.output ]; then 
    283288        ## '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\"" 
    286291 
    287292        ## 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' ) 
    289294   echo $line 
    290295    fi 
     
    349354 
    350355    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} 
    352361 
    353362    if [ $ST == 'FAILED' ]; then 
     
    369378 
    370379    else 
    371    ERR='Code is reliable' 
    372     fi 
    373  
    374     print_step '' 
     380   echo 'Success' && ERR='Code is reliable' 
     381    fi 
    375382 
    376383    ## Eventual comments from ocean.output 
     
    384391    fi 
    385392 
     393    ## Last messenger files 
    386394    export ERR 
    387395    sed -i "2 s/.*/$ST/" ${FILE_STAT}; sed -i "2 s/.*/$ERR/" ${FILE_RESU} 
     
    395403 
    396404    ## Share trusting result (.txt file/mail) 
     405    print_step 'Trusting digest' 
    397406    mesg_make 
    398407    mesg_publish 
Note: See TracChangeset for help on using the changeset viewer.