Changeset 8859


Ignore:
Timestamp:
2017-11-30T16:01:29+01:00 (3 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of Trusting tool

  • Introduce new 'dev' mode beetween 'debug' and 'prod' modes to skip XIOS compilation from scratch and working in a solely testing directory (thanks Andrew for the suggestion)
  • Switch cfg files from 'svn:mime-type=text/x-shellscript' to 'svn:executable' trying to get syntax highlighting under Trac
  • Bugfixes: correct XIOS branch 'XIOS_DEV_CMIP6' for ORCA1 and remove remaining 'TRUST_DIR_BENCHMARK' (replace by TRUST_TEST_BENCHMARK)
  • Improve the workflow displayed in the terminal
Location:
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST
Files:
10 edited

Legend:

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

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/X64_CURIE.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/X64_CURIE_trust.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/arch_template.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/martin.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
    r8843 r8859  
    2424     TRUST_IO_XIOS=$CCCWORKDIR/XIOS 
    2525 
    26 if   [ ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE'  ]; then 
    27     TRUST_IO_XIOS+='/xios-1.0' 
    28 elif [ ${TRUST_CFG_REF} == 'ORCA1_LIM3_PISCES'    ]; then 
    29     TRUST_IO_XIOS+='/XIOS_DEV_CMIP6' 
     26if [ ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE'  ]; then 
     27 
     28    if [ ${TRUST_CFG_REF} == 'ORCA1_LIM3_PISCES' ]; then 
     29   TRUST_IO_XIOS+='/XIOS_DEV_CMIP6' 
     30    else 
     31   TRUST_IO_XIOS+='/xios-1.0' 
     32    fi 
     33 
    3034else 
    3135    TRUST_IO_XIOS+='/trunk' 
     
    3640##-------------- 
    3741 
    38 TRUST_TEST_MAILING=$( cat ./cfg/mailing_list.txt ) 
     42TRUST_TEST_MAILING=$( < ./cfg/mailing_list.txt ) 
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/romr005.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/user_template.cfg

    • Property svn:mime-type deleted
    • Property svn:executable set to *
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env

    r8843 r8859  
    1212##------------------------------------------------------------------- 
    1313 
    14 if [ ${TRUST_FLAG_DEBUG} == 'false' ]; then 
    15     ## std mode (merge stdout & stderr to /dev/null, XIOS compilation from scratch) 
     14if   [ ${TRUST_FLAG_DEBUG} == 'true' ]; then 
     15    ## debug mode (skip XIOS compilation    , output stdout & stderr) 
     16    TRUST_IO_XIOS_MODE='' 
     17    TRUST_MAIN_STDOUT='' 
     18elif [ ${TRUST_FLAG_DEV}   == 'true' ]; then 
     19    ## dev mode   (skip XIOS compilation    , output only stderr    ) 
     20    TRUST_IO_XIOS_MODE='' 
     21    TRUST_MAIN_STDOUT='1> /dev/null' 
     22else 
     23    ## prod mode  (compile XIOS from scratch, no stdout nor stderr  ) 
    1624    TRUST_IO_XIOS_MODE='--full' 
    1725    TRUST_MAIN_STDOUT='>& /dev/null' 
    18 else 
    19     ## debug mode (verbose output and skip XIOS compilation) 
    20     TRUST_IO_XIOS_MODE='' 
    21     TRUST_MAIN_STDOUT='1> /dev/null' 
    2226fi 
    2327 
     
    208212fi 
    209213 
    210 export TRUST_TEST_LOG=${TRUST_DIR_BENCHMARK}/trusting_${TRUST_TEST_NAME}.txt 
     214export TRUST_TEST_LOG=${TRUST_TEST_BENCHMARK}/trusting_${TRUST_TEST_NAME}.txt 
    211215 
    212216export TRUST_TEST_MAILING 
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh

    • Property eol-style deleted
    • Property svn:keywords deleted
    r8843 r8859  
    1818##-------------------------------------------------------------------------------- 
    1919 
    20 print_step() { 
     20step() { 
    2121    local char_nb=$( echo "$1" | wc -c ) 
    2222    local outline=$( printf "%${char_nb}s" ) 
    2323 
    24     printf "\n\nStep.....\n%s\n%s\n\n" "$1" ${outline// /-} 
     24    printf "\n%s\n%s\n\n" "$1" ${outline// /-} 
    2525} 
    2626 
     
    152152    cd ${TRUST_SVN_NEMOGCM}/CONFIG 
    153153 
    154     ## Recompiling from scratch if not in debug mode 
    155     if [[ -d ${TRUST_CFG_NEW} && ${TRUST_FLAG_DEBUG} == 'false' ]]; then 
    156    ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 
    157        > /dev/null <<EOF 
     154    ## Recompiling from scratch if not in debug or dev mode 
     155    if [[ ${TRUST_FLAG_DEBUG} == 'false' && ${TRUST_FLAG_DEV} == 'false' ]]; then 
     156 
     157     if [[ -d ${TRUST_CFG_NEW} ]]; then 
     158         ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 
     159         > /dev/null <<EOF 
    158160y 
    159161EOF 
     162     fi 
     163 
    160164    fi 
    161165 
     
    420424       if [ -e ${TRUST_TEST_BENCHMARK}/$filebase.nc ]; then 
    421425 
    422       #bcmk='true' 
    423426      cdo diffn $filebase.nc ${TRUST_TEST_BENCHMARK}/$filebase.nc \ 
    424427          > cdo_diff.out 2> /dev/null 
     
    574577 
    575578       ## Computing 
    576        'H') TRUST_FLAG_ERROR='Crashed at time step'              ;; 
    577        'I') TRUST_FLAG_ERROR='Exceeded time limit'               ;; 
     579       'H') TRUST_FLAG_ERROR='Crashed at time step ' 
     580      comments 'E R R O R' 
     581      [ -e time.step ] && time_step=$( cat time.step ) 
     582      TRUST_FLAG_ERROR+=${time_step:=0}                     ;; 
     583       'I') TRUST_FLAG_ERROR='Exceeded time limit of ' 
     584      TRUST_FLAG_ERROR+=$(( ${TRUST_JOB_TIMEOUT}/3600 ))'h' ;; 
    578585 
    579586       ## Results 
     
    592599 
    593600    ## Eventual comments from ocean.output 
    594     if [ ${TRUST_FLAG_ERROR} == 'Crashed at time step' ]; then 
    595    comments 'E R R O R' 
    596    [ -e time.step ] && time_step=$( cat time.step ) 
    597    TRUST_FLAG_ERROR+=' '${time_step:=0} 
    598     else 
    599    comments 'W A R N I N G' 
    600  
    601    if [ ${TRUST_FLAG_ERROR} == 'Exceeded time limit' ]; then 
    602        TRUST_FLAG_ERROR+=' '$(( ${TRUST_JOB_TIMEOUT}/3600 ))'h' 
    603    fi 
    604  
    605     fi 
     601    [[ ! ${TRUST_FLAG_ERROR} =~ 'Crashed at time step' ]] && comments 'W A R N I N G' 
    606602 
    607603    ## Last messenger files 
     
    609605    sed -i "2 s/.*/$TRUST_FLAG_ERROR/"  ${file_stat} 
    610606 
    611     ## Save tested configuration if trusting failed in production mode (-p|--prod) 
     607    ## Save tested configuration if trusting failed in production mode ('-p') 
    612608    if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} == 'true' ]]; then 
    613609   echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_TEST_BENCHMARK} 
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh

    • Property eol-style deleted
    • Property svn:keywords deleted
    r8843 r8859  
    99 
    1010TRUST_MAIN_DIR=$PWD 
     11TRUST_FLAG_HELP='false' 
     12TRUST_FLAG_DEBUG='false'; TRUST_FLAG_DEV='false' ; TRUST_FLAG_PROD='false' 
    1113 
    12 TRUST_FLAG_DEBUG='false'  ; TRUST_FLAG_HELP='false' ; TRUST_FLAG_PROD='false' 
    13  
     14# Revision number of the tool 
    1415rev=$( svn info | awk '/Last Changed Rev/ {print $NF}' ) 
    1516 
    1617 
    1718##-------------------------------------------------------------------------------- 
    18 ## Get arguments from command line 
     19## Get short or long arguments from command line 
    1920##-------------------------------------------------------------------------------- 
    2021 
     
    4546    cat ./inc/trusting_help.txt 
    4647 
     48    ## Color this section to part with help 
     49    printf "\033[0;33m" 
     50 
    4751    if [ ${TRUST_FLAG_HELP} == 'false' ]; then 
    48    printf "\n\n\033[0;33m" 
    49    printf "At least one configuration (arch or user) file is missing or misspelled:" 
    50    printf "\t'%s'.cfg\t'%s'.cfg" ${TRUST_MAIN_USER} ${TRUST_MAIN_HPCC} 
    51    printf "\033[0m" 
     52   printf "                                                           \ 
     53       \nAt least 1 cfg file (arch or user) is missing or misspelled: \ 
     54       '%s.cfg' or '%s.cfg'\n"                                        \ 
     55       ${TRUST_MAIN_USER} ${TRUST_MAIN_HPCC} 
    5256    fi 
    5357 
    54     printf "\n\nContent of 'config' folder:" 
    55     find config -name *.cfg | cut -d/ -f2 \ 
    56    | xargs -n 4 printf "%-25s\t%-25s\t%-25s\n" 
     58    echo -e "\nContent of './cfg' folder:" 
     59    find ./cfg -name *.cfg | cut -d/ -f3 \ 
     60   | xargs -n 3 printf "%-20s\t%-20s\t%-20s\n" 
     61    printf "\033[0m\n" 
     62 
    5763    exit 1 
    5864else 
     
    95101##------------------ 
    96102 
    97 print_step 'Timestamped testing directory' 
     103step 'Testing directory' 
    98104init 
    99105 
     
    102108##------------------- 
    103109 
    104 print_step 'SVN action on NEMO directories' 
    105 printf "${TRUST_SVN_ACTION} on ${TRUST_SVN_NEMOGCM}:\n\n"   
     110step 'Local working copy' 
     111 
     112echo "${TRUST_SVN_ACTION} on ${TRUST_SVN_NEMOGCM}:" 
    106113get_nemo_rev 
    107114 
     
    110117##------------ 
    111118 
    112 print_step 'Get testing environment' 
     119step 'Environment' 
    113120get_soft_rel 
    114121 
     
    117124##--------------- 
    118125 
    119 print_step 'Compile XIOS' 
     126step 'Compilation(s)' 
     127 
     128printf "XIOS? " 
    120129compile_xios 
    121130 
    122 print_step "Compile ${TRUST_CFG_NEW} cfg from ${TRUST_CFG_REF}" 
     131printf "\nNEMO ${TRUST_CFG_NEW} cfg. from ${TRUST_CFG_REF}? " 
    123132compile_nemo 
    124133 
     
    127136##------- 
    128137 
    129 print_step 'Set job (copying or extracting inputs)' 
     138step 'Inputs' 
     139 
    130140get_inputs 
    131141 
    132 print_step 'Compare inputs' 
     142printf "\nCompare with benchmark? " 
    133143diff_inputs 
    134144 
     
    137147##---- 
    138148 
    139 print_step 'Submit job' 
     149step 'Job' 
     150 
     151printf "Submit? " 
    140152job_submit 
    141153 
    142 print_step 'Pending job' 
     154echo 'Pending...' 
    143155job_pending 
    144156 
    145 print_step 'Job finished' 
     157echo 'Finished!' 
    146158 
    147 print_step 'Test job state' 
     159printf "State? " 
    148160job_state 
    149161 
    150 print_step 'Get job performances' 
     162printf "Perfs?" 
    151163job_perfs 
    152164 
    153165 
    154 ## Outputs 
    155 ##-------- 
     166## Output(s) 
     167##---------- 
    156168 
    157 print_step 'Compare outputs' 
     169step 'Ouput(s)' 
     170 
     171echo 'Compare with benchmark:' 
     172 
     173printf "Plain text files? " 
    158174diff_results 
    159175 
    160 print_step 'Compare restarts' 
     176printf "Restart files? " 
    161177diff_restarts 
    162178 
Note: See TracChangeset for help on using the changeset viewer.