Ignore:
Timestamp:
2015-05-22T18:49:31+02:00 (6 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Standalone TRUST directory for regular NEMO configuration testing

File:
1 copied

Legend:

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

    r5286 r5292  
    1111DEBUG=0; PUBLISH=0; status='OK' 
    1212 
    13 # Get options && replace some initials settings 
     13# Get options to replace some initials settings 
    1414while [ $# -ne 0 ]; do 
    1515    case $1 in 
    1616        -b|--branch ) NEMO_BRAN=$2         ; shift 2;; -d|--debug  ) set -vx; DEBUG=1     ; shift  ;; 
    1717   -e|--email  ) MAIL=$2              ; shift 2;; -j|--job    ) NPROC=$2             ; shift 2;; 
    18    -h|--help   ) cat trusting_help.txt; exit   ;; -m|--machine) ARCH=$2              ; shift 2;; 
     18   -h|--help   ) cat trusting_help.txt; exit   ;; -m|--machine) CFG_ARCH=$2          ; shift 2;; 
    1919   -n|--newconf) CONF_TEST=$2         ; shift 2;; -r|--refconf) CONF_REFE=$2         ; shift 2;; 
    2020   -t|--time   ) TIME_LIMI=$2         ; shift 2;; -p|--publish) PUBLISH=1            ; shift  ;; 
     21        -u|--user   ) CFG_USER=$2          ; shift 2;; -v|--version) NEMO_REVI=$2         ; shift 2;; 
    2122                   *) cat trusting_help.txt; exit   ;; 
    2223    esac 
     
    2425 
    2526# Set super-computer & user environment 
    26 [[ ! -z "$ARCH" && . trusting.env ]] || { ./trusting.sh -h && exit; } 
     27[[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]] && . trusting.env || { ./trusting.sh -h && exit; } 
    2728export DEBUG PUBLISH 
    2829 
     
    3435cd ${DIR_TEST} 
    3536datestr1=$( LC_ALL=C date -d"$DATE_STR" +%Y-%m-%dT%H:%M ) 
    36 printf "Date\n%s\n"       $datestr1 > mesg_01_date.txt 
     37printf "Date\n%s\n"       $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 
    3738 
    38 printf "Status\nFAILED\n"           > mesg_02_status.txt # Only at end status will change to OK 
     39printf "Status\nFAILED\n"           > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt # Only at end status will change to OK 
    3940 
    4041. trusting_func.sh 
     
    4546#============================================= 
    4647for rel in $CDO $COMPILER $MPI $NETCDF; do 
    47     printf "Step......................\nGet $rel release\n" > mesg_03_step.txt 
     48    printf "Step......................\nGet $rel release\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    4849                             arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 
    4950    [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH          | sed "s#.*$rel/\([^/]*\).*#\1#"  ) 
     
    5253done 
    5354 
    54 sed -n 1p model.log | sed 'i\Fortran compiler' > mesg_04_curiec.txt 
    55 sed -n 2p model.log | sed 'i\MPI libraries   ' > mesg_05_mpicurie.txt 
    56 sed -n 3p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_curie.txt 
     55sed -n 1p model.log | sed 'i\Fortran compiler' > mesg_04_compiler_${CFG_USER}_${CFG_ARCH}.txt 
     56sed -n 2p model.log | sed 'i\MPI libraries   ' > mesg_05_mpi_${CFG_USER}_${CFG_ARCH}.txt 
     57sed -n 3p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
    5758 
    5859 
    5960#--------------------------------------------- 
    60 printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step.txt 
     61printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     62svn_cmd='svn status' 
     63 
     64# If -v|--version option has been set, modify svn command 
     65[ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ] && svn_cmd='svn update' 
     66[ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && svn_cmd='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 
     67 
    6168rev=0 
    62 for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_SETT} ${NEMO_TCMP}; do 
    63     svn up $dir 
     69for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_TRUS} ${NEMO_TCMP}; do 
     70    [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 
     71    ${svn_cmd} $dir 
    6472    rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 
    65     [ $dir == ${DIR_XIOS} ] && echo 'XIOS '${rev_loc} >> model.log && continue 
    6673    (( ${rev_loc} >= $rev )) && rev=${rev_loc} 
    6774done 
     
    7077 
    7178#--------------------------------------------- 
    72 printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step.txt 
     79printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    7380cd ${NEMO_CONF} 
    7481. ${ARCH_ENV}     # Sourcing architecture environment 
     
    7986 
    8087#--------------------------------------------- 
    81 printf "Step......................\nPreparing job\n" > mesg_03_step.txt 
     88printf "Step......................\nPreparing job\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    8289cd ${DIR_TEST} 
    8390find ${NEMO_CONF}/${CONF_TEST}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 
     
    94101 
    95102#--------------------------------------------- 
    96 printf "Step......................\nRunning\n"       > mesg_03_step.txt 
     103printf "Step......................\nRunning\n"       > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    97104#${JOB_SUB} ${DIR_TEST}/../../batch.sh 
    98105job_num=$( ${JOB_SUB} ${DIR_TEST}/../../batch.sh | awk '{print $NF}') 
     
    110117 
    111118#--------------------------------------------- 
    112 printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step.txt 
     119printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    113120if      [ ! -f ${output_test} ]; then 
    114121 
     
    116123else if [  ] 
    117124 
    118     grep 'E R R O R' ocean.output    >> mesg_11_comments.txt 
    119     sed 's/^/Time step :/' time.step >> mesg_11_comments.txt 
     125    grep 'E R R O R' ocean.output    >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
     126    sed 's/^/Time step :/' time.step >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
    120127fi 
    121128 
    122129 
    123130#--------------------------------------------- 
    124 printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step.txt 
     131printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    125132for file in ocean.output solver.stat tracer.stat; do 
    126133    diff $file ${DIR_REFE}/$file 
     
    130137 
    131138#--------------------------------------------- 
    132 printf "Step......................\nTest last restart files difference\n" > mesg_03_step.txt 
     139printf "Step......................\nTest last restart files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    133140diff_trusting 2>/dev/null 
    134141[ $? -ne 0 ] && status='FAILED' 
     
    136143 
    137144#--------------------------------------------- 
    138 echo 'Comments'                    >  mesg_11_comments.txt 
    139 grep 'W A R N I N G:' ocean.output >> mesg_11_comments.txt 
     145echo 'Comments'                    >  mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
     146grep 'W A R N I N G:' ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
    140147 
    141148 
    142149#--------------------------------------------- 
    143150if [ $status != 'FAILED' ]; then 
    144     printf "Step......................\nGet Real CPU time\n" > mesg_03_step.txt 
     151    printf "Step......................\nGet Real CPU time\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    145152    real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}') 
    146     printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime.txt 
     153    printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
    147154else 
    148     printf "Step......................\nTest InputFiles difference\n" > mesg_03_step.txt 
     155    printf "Step......................\nTest InputFiles difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    149156    diff inputs_list.txt ${DIR_REFE}/inputs_list.txt 
    150157    [ $? -ne 0 ] && getout 
    151     [[ $? -ne 0 && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles.txt 
     158    [[ $? -ne 0 && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    152159fi 
    153160 
    154161 
    155162#--------------------------------------------- 
    156 printf "Status\nOK\n" > mesg_02_status.txt 
    157 printf "Step......................\nCode is reliable\n" > mesg_03_step.txt 
     163printf "Status\nOK\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 
     164printf "Step......................\nCode is reliable\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    158165 
    159166#--------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.