New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5521 for branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh – NEMO

Ignore:
Timestamp:
2015-06-30T16:20:45+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Error management redefinition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh

    r5509 r5521  
    77    if [ "$state" == 'E R R O R' ]; then 
    88   [ -e time.step ] && LAST_TIME_STEP=$( cat time.step | tr -d [:space:] ) 
    9    export ${LAST_TIME_STEP} ERR=1 
     9   export ${LAST_TIME_STEP} 
    1010    fi 
    1111 
    1212    [ -e ocean.output ] && line=$( grep -m1 -A5 "$state" ocean.output | tr -d '\n' ) 
     13 
    1314    if [[ -e ${REFE_DIR}/model.log && $( diff -q model.log ${REFE_DIR}/model.log ) ]]; then 
    1415   line=$( diff model.log ${REFE_DIR}/model.log  | tr -d '\n' ) 
     
    2223    mesg='Same' 
    2324    for file in inputs_list.txt $( ls namelist_* ) $( ls *.xml ); do 
    24    diff -q $file ${REFE_DIR}/$file 
     25   diff -q $file ${REFE_DIR}/$file > /dev/null 
    2526   [ $? -ne 0 ] && mesg='Different' 
    2627    done 
    2728 
    28     printf "Input files\n$mesg\n" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
     29    printf "Input files\n$mesg\n" | tee mesg_09_inputs_${CFG_USER}_${CFG_ARCH}.txt 
    2930} 
    3031 
    3132diff_results() { 
    3233    for file in ocean.output $( ls *.stat ); do 
    33    [ ! -e ${REFE_DIR}/$file ] && export ST='FAILED' && get_out $ST ERR=7 
     34   [ ! -e ${REFE_DIR}/$file ] && export ST='FAILED' && get_out 7 
    3435   diff -q $file ${REFE_DIR}/$file 
    3536   [ $? -ne 0 ] && export ST='FAILED' 
     
    3839 
    3940diff_restart() { 
    40     [ ! -e  ${REFE_DIR}/time.step ] && export ST='FAILED' && get_out $ST ERR=9 
     41    [ ! -e  ${REFE_DIR}/time.step ] && export ST='FAILED' && get_out 9 
    4142 
    4243    export LAST_TIME_STEP=$( cat ${REFE_DIR}/time.step | tr -d [:space:] ) 
     
    8283get_cpu_time() { 
    8384    real_cpu_time=$( eval "${JOB_INFO} ${JOB_ID} | ${JOB_TIME}" ) 
    84     printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     85    printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_cputime_${CFG_USER}_${CFG_ARCH}.txt 
    8586} 
    8687 
     
    175176 
    176177END_MAIL 
    177 #`tail -n 1 ${TEST_DIR}/mesg_03_error_${CFG_USER}_${CFG_ARCH}.txt` 
     178 
    178179      if [ -e ${TEST_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt ]; then 
    179180     cat ${TEST_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt  >> trusting.mail 
     
    188189 
    189190get_out() { 
     191    ERR=$1 
     192 
    190193    printf "Status\n$ST\n"  > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 
    191194 
    192     # Save tested configuration if trusting failed 
    193195    if [ "$ST" == 'FAILED' ]; then 
    194196   cd ${TEST_DIR} 
    195    printf "Input files\n\n"   > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    196    printf "Real CPU time\n\n" > mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     197 
     198   if [ ! -e mesg_09_inputs_${CFG_USER}_${CFG_ARCH}.txt ]; then 
     199       printf "Input files\n\n"   > mesg_09_inputs_${CFG_USER}_${CFG_ARCH}.txt 
     200   fi 
     201 
     202   if [ ! -e mesg_10_cputime_${CFG_USER}_${CFG_ARCH}.txt ]; then 
     203       printf "Real CPU time\n\n" > mesg_10_cputime_${CFG_USER}_${CFG_ARCH}.txt 
     204   fi 
    197205 
    198206   if [ ! -e mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt ]; then 
     
    201209 
    202210        # Error identification 
    203    case ERR in 
     211   case $ERR in 
    204212       # Compilation 
    205213       1) ERR='XIOS compilation failed'            ;;  2) ERR='NEMO compilation failed'            ;; 
     
    215223   esac 
    216224 
    217    #tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
     225   export ERR 
    218226    fi 
    219227 
    220228    printf "Result.....\n$ERR\n" > mesg_03_result_${CFG_USER}_${CFG_ARCH}.txt 
     229 
     230    # Save tested configuration if trusting failed 
     231    [ "$ST" == 'FAILED' ] && tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
    221232 
    222233    mesg_make 
     
    234245   ${JOB_INFO} ${JOB_ID}                                           >> computation.log 
    235246   sleep ${time_increment} 
    236 #  let time_elapsed+=${time_increment} 
    237247   time_elapsed=$(( ${time_elapsed} + ${time_increment} )) 
    238248    done 
     
    244254   export ${TIME_LIMIT} 
    245255   get_out $ST ERR=6 
    246 } 
     256    fi 
     257} 
Note: See TracChangeset for help on using the changeset viewer.