Ignore:
Timestamp:
2015-06-09T11:13:36+02:00 (5 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Add rebuild tool for comparing among other improvments & bugs

File:
1 edited

Legend:

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

    r5355 r5383  
    1111#--------------------------------------------------- 
    1212NEMO_TRUS=$( pwd $( dirname $0 ) ) 
     13SVN_CMD='svn status' 
    1314DEBUG=0; PUBLISH=0; status='OK' 
    1415 
     
    2223   -n|--newconf) TEST_CONF=$2         ; shift 2;; -r|--refconf) REFE_CONF=$2         ; shift 2;; 
    2324   -t|--time   ) TIME_LIMI=$2         ; shift 2;; -p|--publish) PUBLISH=1            ; shift  ;; 
    24         -u|--user   ) CFG_USER=$2          ; shift 2;; -v|--version) NEMO_REVI=$2         ; shift 2;; 
     25        -u|--user   ) CFG_USER=$2          ; shift 2;; -v|--version) NEMO_VERS=$2         ; shift 2;; 
    2526                   *) cat trusting_help.txt; exit  1;; 
    2627    esac 
     
    4647fi 
    4748 
     49# If -v|--version option has been set, modify svn command 
     50[ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ] && SVN_CMD='svn update' 
     51[ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 
     52 
    4853datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 
    4954. ./trusting_func.sh 
     
    5358printf "Date\n%s\n"       $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 
    5459# Only at end status will change to OK 
    55 printf "Status\nFAILED\n"           > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 
     60printf "Status\nFAILED\n"           > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 
    5661 
    5762 
    5863# Check softwares versions 
    5964#--------------------------------------------------- 
    60 printf "Step......................\nGet softwares release\n"                     | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    61 for rel in $CDO $COMPILER $MPI $NETCDF; do 
    62                              arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 
    63     [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH          | sed "s#.*$rel/\([^/]*\).*#\1#"  ) 
    64 #    [ $( echo $rel | grep $COMPILER ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' >/dev/null ) 
    65     echo $rel ${arch_rel} >> model.log 
    66 done 
    67  
    68 sed -n 2p model.log | sed 'i\Fortran compiler' > mesg_04_compiler_${CFG_USER}_${CFG_ARCH}.txt 
    69 sed -n 3p model.log | sed 'i\MPI libraries   ' > mesg_05_mpi_${CFG_USER}_${CFG_ARCH}.txt 
    70 sed -n 4p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
     65printf "Step......................\nGet softwares release\n"                     | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
     66. ${ARCH_ENV} > /dev/null    # Sourcing architecture environment 
     67get_rel 
     68sed -n 2p model.log | sed 'i\Fortran compiler' > mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 
     69sed -n 3p model.log | sed 'i\MPI libraries   ' > mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 
     70sed -n 4p model.log | sed 'i\NetCDF libraries' > mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
    7171 
    7272 
    7373# SVN action on XIOS & NEMO essentials directories 
    7474#--------------------------------------------------- 
    75 svn_cmd='svn status' 
    76 # If -v|--version option has been set, modify svn command 
    77 [ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ] && svn_cmd='svn update' 
    78 [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && svn_cmd='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 
    79  
    80 printf "Step......................\nGet NEMO SVN revision with: ${svn_cmd}\n"    | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    81 rev=0 
    82  
    83 for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_TRUS} ${NEMO_TCMP}; do 
    84     # For time being, just get revision number from XIOS 
    85     [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 
    86     ${svn_cmd} $dir 
    87     rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 
    88     (( ${rev_loc} >= $rev )) && rev=${rev_loc} 
    89 done 
    90 echo 'NEMO '$rev >> model.log 
     75printf "Step......................\nGet NEMO SVN revision with: ${SVN_CMD}\n"    | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
     76get_rev 
     77sed -n 6p model.log | sed 'i\NEMO revision' > mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt 
    9178 
    9279 
    9380# NEMO config compiled from scratch 
    9481#--------------------------------------------------- 
    95 printf "Step......................\nCompiling ${CONF_REF} configuration\n"       | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     82printf "Step......................\nCompiling ${CONF_REF} configuration\n"       | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    9683cd ${NEMO_CONF} 
    97 . ${ARCH_ENV} > /dev/null    # Sourcing architecture environment 
    9884#[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 
    9985./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC > /dev/null 2>&1 
     
    10389# Get namelists, xml & forced files for running 
    10490#--------------------------------------------------- 
    105 printf "Step......................\nPreparing job\n"                             | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     91printf "Step......................\nPreparing job\n"                             | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    10692cd ${TEST_DIR} 
    10793find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 
     
    119105# Job submission & computing 
    120106#--------------------------------------------------- 
    121 printf "Step......................\nRunning\n"                                   | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM} 
     107printf "Step......................\nRunning\n"                                   | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM} 
    122108job_num=$( ${JOB_SUBM} | awk '{print $NF}' ) 
    123109[ $? -ne 0 ] && get_out 
     
    135121# Eventual crash during computing 
    136122#--------------------------------------------------- 
    137 printf "Step......................\nTest if ASCII output files exist\n"          | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     123printf "Step......................\nTest if ASCII output files exist\n"          | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    138124if   [ ! -f ocean.output                  ]; then 
    139     printf "Step......................\nOpa crashed at initialization\n"         | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     125    printf "Step......................\nOpa crashed at initialization\n"         | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    140126    status='FAILED' 
    141127elif [ $( grep 'E R R O R' ocean.output ) ]; then 
    142     printf "Step......................\nOpa crashed\n"                           | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
    143     grep 'E R R O R'       ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
    144     sed 's/^/Time step :/' time.step    >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
     128    printf "Step......................\nOpa crashed\n"                           | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
     129    grep 'E R R O R'       ocean.output >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 
     130    sed 's/^/Time step :/' time.step    >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 
    145131    status='FAILED' 
    146132fi 
     
    149135# Inspect output text files 
    150136#--------------------------------------------------- 
    151 printf "Step......................\nTest ASCII output files difference\n"        | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     137printf "Step......................\nTest ASCII output files difference\n"        | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    152138for file in ocean.output solver.stat tracer.stat; do 
    153139    diff $file ${REFE_DIR}/$file 
     
    158144# Inspect output NetCDF files 
    159145#--------------------------------------------------- 
    160 printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     146printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    161147diff_restart 2>/dev/null 
    162148[ $? -ne 0 ] && status='FAILED' 
     
    165151# Comments 
    166152#--------------------------------------------------- 
    167 echo 'Comments'                    >  mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
    168 grep 'W A R N I N G:' ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
     153echo 'Comments'                    >  mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 
     154grep 'W A R N I N G:' ocean.output >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 
    169155 
    170156 
     
    172158#--------------------------------------------------- 
    173159if [ $status != 'FAILED' ]; then 
    174     printf "Step......................\nGet real CPU time\n"                     | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     160    printf "Step......................\nGet real CPU time\n"                     | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    175161    real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}' ) 
    176     printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     162    printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
    177163else 
    178     printf "Step......................\nTest input files difference\n"           | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     164    printf "Step......................\nTest input files difference\n"           | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    179165    diff inputs_list.txt ${REFE_DIR}/inputs_list.txt 
    180166 
    181     if [ $? -ne 0]; then 
    182    printf "Input files\nDifferent" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
     167    if [ $? -ne 0 ]; then 
     168   printf "Input files\nDifferent" > mesg_10_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    183169    else 
    184    printf "Input files\nSame"      > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
     170   printf "Input files\nSame"      > mesg_10_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    185171    fi 
    186172 
     
    191177# So far, everything is good 
    192178#--------------------------------------------------- 
    193 printf "Status\nOK\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 
    194 printf "Step......................\nCode is reliable\n"                          | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     179printf "Status\nOK\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 
     180printf "Step......................\nCode is reliable\n"                          | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    195181 
    196182 
Note: See TracChangeset for help on using the changeset viewer.