Changeset 5424


Ignore:
Timestamp:
2015-06-15T17:49:41+02:00 (5 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Many improvments & bug corrections

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

Legend:

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

    r5402 r5424  
    5151[ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 
    5252 
    53 datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 
    5453. ./trusting_func.sh 
    5554 
     55 
     56#  
     57#--------------------------------------------------- 
    5658mkdir -p ${TEST_DIR} ${REFE_DIR} 
    5759echo ${TEST_DIR} && cd ${TEST_DIR} 
     60datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 
    5861printf "Date\n%s\n"       $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 
    5962# Only at end status will change to OK 
     
    6568printf "Step......................\nGet softwares release\n"                     | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    6669. ${ARCH_ENV} > /dev/null    # Sourcing architecture environment 
    67 get_rel 
     70get_soft_rel 
    6871sed -n 2p model.log | sed 'i\Fortran compiler' | tee mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 
    6972sed -n 3p model.log | sed 'i\MPI libraries   ' | tee mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 
     
    7477#--------------------------------------------------- 
    7578printf "Step......................\nGet NEMO SVN revision with: ${SVN_CMD}\n"    | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    76 get_rev 
    77 sed -n 6p model.log | sed 'i\NEMO revision' > mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt 
     79get_nemo_rev 
     80sed -n 6p model.log | sed 'i\NEMO revision'    | tee mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt 
    7881 
    7982 
     
    8386cd ${NEMO_CONF} 
    8487#[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 
    85 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC > /dev/null 2>&1 
     88./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null 
    8689[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 
    8790 
     
    165168    real_cpu_time=$( ${JOB_VIEW} ${job_num} | awk 'END{print $9}' ) 
    166169    printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     170    printf "Input files\nNA"                      | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    167171else 
    168172    printf "Step......................\nTest input files difference\n"           | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh

    r5402 r5424  
    1919    stat=100; file1=$1; file2=$2 
    2020 
    21     cdo diffv $file1 $file2 > out_tmp 
     21    $CDO diffv $file1 $file2 > out_tmp 
    2222    ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 'records differ' out_tmp | awk -Fof '{print $1}' ) 
    2323    [ -f out_tmp ] && rm out_tmp 
     
    2727 
    2828diff_restart() { 
     29    result=0 
    2930    last_time_step=$( cat ${REFE_DIR}/time.step | tr -d [:space:] ) 
    30     result_final=0 
    31  
    3231    echo 'Last time step: '${last_time_step} 
    3332 
    34     for file in restart restart_ice restart_trc; do 
    35    printf "${TEST_DIR}/*${last_time_step}_${file}*.nc: " 
    36    find ${TEST_DIR} -name *${last_time_step}_$file*.nc && exit 0 
    37    if [ $( find ${TEST_DIR} -regex .*${last_time_step}_$file[_0-9]*.nc ) ]; then 
    38        filebase=$( ls *${last_time_step}_$file*.nc | sed "s/^\(.*_\)0*$last_time_step.*/\1/" ) 
    39        ${NEMO_TRBD}/rebuild_nemo -t $NPROC ${filebase}_${last_time_step}_$file $(( ${last_time_step} + 1 )) #>/dev/null 
    40        result=$( diff_nc ${TEST_DIR}/*${last_time_step}_$file.nc ${REFE_DIR}/*${last_time_step}_$file.nc ) 
    41        printf "cdo diffv $result\n" 
    42        (( result_final = result_final + result )) 
     33    if [ $( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit ) ]; then 
     34   file_base=$( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit | \ 
     35                sed "s/^\(.*\)0*$last_time_step.*/\1/"                                 ) 
     36 
     37   for file in restart restart_ice restart_trc; do 
     38       printf "${TEST_DIR}/*${last_time_step}_${file}*.nc: " 
     39 
     40       nb_dom=$( find ${TEST_DIR} -name "*${last_time_step}_${file}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
     41       if [ ${nb_dom} -gt 1 ]; then 
     42      ${NEMO_TRBD}/rebuild_nemo -t $NPROC ${file_base}${last_time_step}_$file ${nb_dom} >/dev/null 
     43       fi 
     44 
     45#      result=$( diff_nc ${TEST_DIR}/*${last_time_step}_$file.nc ${REFE_DIR}/*${last_time_step}_$file.nc ) 
     46       result=$( diff_nc ${file_base}${last_time_step}_$file.nc ${REFE_DIR}/*${last_time_step}_$file.nc ) 
     47       printf "$CDO diffv $result\n" 
    4348#      \rm *${last_time_step}_${file}_[0-9]*.nc 
    44    else 
    45        printf "no restart files found for comparison\n" 
    46    fi 
     49   done 
    4750 
    48     done 
    49  
    50     return ${result_final} 
     51    else 
     52   printf "no restart files found for comparison\n" 
     53    fi 
    5154} 
    5255 
    53 get_rel() { 
     56get_soft_rel() { 
    5457    for rel in $CDO $COMPILER $MPI $NETCDF; do 
    5558                                arch_rel=$( echo $LOADEDMODULES | sed "s#.*$rel/\([^:]*\).*#\1#" ) 
     
    6063} 
    6164 
    62 get_rev() { 
     65get_nemo_rev() { 
    6366    rev=0 
    6467 
    65 #    for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \ 
    66     for dir in ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \ 
     68    for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \ 
    6769          ${NEMO_EFCM} ${NEMO_TRUS} ${NEMO_TCMP} ${NEMO_TRBD}               ; do 
    6870   # For time being, just get revision number from XIOS 
    69 #  [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 
     71   [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 
    7072   ${SVN_CMD} $dir 
    7173   rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 
     
    8587if [ $PUBLISH -eq 1 ]; then 
    8688 
    87   if [ -f ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ] ; then 
    88       tail -1 trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 
    89   else 
    90       cp      trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt    ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 
    91   fi 
     89  if [ -f ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ]; then cmd='sed -n 2p'; else cmd='cat'; fi 
    9290 
    93   cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${TEST_DIR} 
    94 #  chmod o+r ${TEST_DIR}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt 
    95    
    96 #  rm -rf              ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 
    97 #  cp -alf ${TEST_DIR} ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 
    98 #  chmod o+rX          ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 
    99    
     91  $cmd trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 
     92 
    10093  # Send mail only when FAILED 
    10194  if [[ $( grep 'FAILED' mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt ) && ! -z $MAIL ]]; then 
    102       cat << END_MAIL > ${TEST_DIR}/trusting.mail 
     95      cat << END_MAIL > trusting.mail 
    10396XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
    10497Dear $USER, 
    10598 
    106 The trusting sequence for ${CONF_REF} has failed. 
    107 Please consult http://webservices.ipsl.fr/trusting/ 
    108  
    109 Failed at step: `tail -n 1 mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt` 
     99The trusting sequence for ${CONF_REF} has failed at step: 
     100`tail -n 1 mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt` 
    110101Directory : ${TEST_DIR} 
    111102 
     
    113104 
    114105END_MAIL 
    115       mail -s "[trusting ${CONF_REF}] FAILED" $MAIL < ${TEST_DIR}/trusting.mail 
     106      cat mesg_*_${CFG_USER}_${CFG_ARCH}.txt        >> trusting.mail 
     107      mail -s "[trusting ${CONF_REF}] FAILED" $MAIL  < trusting.mail 
    116108  fi 
    117109 
     
    120112 
    121113get_out() { 
    122    cd ${TEST_DIR} 
    123         mesg_make; mesg_publish 
     114    mesg_make; mesg_publish 
    124115 
    125         # Add tar saved into {DIR_STOR} 
    126    find ${DIR_SCRA}/trusting/${CONF_REF}/* -prune -mtime +7 -exec /bin/rm -rf {} \; > /dev/null 2>&1 
    127         [ -f ${DIR_STOR}/${CONF_REF}.tar ] && \rm ${DIR_STOR}/${CONF_REF}.tar 
    128         tar -cf ${DIR_STOR}/${CONF_REF}.tar . 
    129  
    130         exit 
     116    # Save tested configuration if trusting failed 
     117    if [ $status == 'FAILED' ]; then 
     118   cd ${REFE_DIR} 
     119   tar -czf trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.tar.gz ${TEST_DIR}/* 
     120   cd - 
     121    fi 
     122    
     123    exit 1 
    131124} 
Note: See TracChangeset for help on using the changeset viewer.