Ignore:
Timestamp:
2015-05-21T20:28:58+02:00 (6 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Major update with clear partition of architecture & user configuration

File:
1 edited

Legend:

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

    r5283 r5286  
    11#!/bin/bash 
     2# 
     3# Author: Patrick Brockmann 
     4# Contact: Patrick.Brockmann@cea.fr 
     5# History: 
     6# Modification: Nicolas-thierry.Martin@locean-ipsl.upmc.fr 
     7# 
    28 
    39 
    410# Set defaults 
    511DEBUG=0; PUBLISH=0; status='OK' 
    6 NEMO_BRAN=trunk; # dev_r5092_CNRS_SETTE dev_v3_4_STABLE_2012 
    7 ARCH=              # arch-${ARCH}.env to be sourced in ${DIR_XIOS} or leave blank without file 
    8 CONF_REFE=ORCA2_LIM_PISCES 
    9 CONF_TEST=${CONF_REFE}_trust 
    10 #COMPILER=ifort gfortran f95 f90 pgfortran pgf95 pgf90 mpifort mpif90 mpiifort 
    11 #MPI=bullxmpi openmpi mpich intel mpxlf 
    1212 
    13  
     13# Get options && replace some initials settings 
    1414while [ $# -ne 0 ]; do 
    1515    case $1 in 
    16         -b|--branch    ) NEMO_BRAN=$2         ; shift 2;; 
    17         -d|--debug     ) set -vx; DEBUG=1     ; shift  ;; 
    18         -h|--help|-help) cat trusting_help.txt; exit   ;; 
    19         -m|--machine   ) ARCH=$2              ; shift 2;; 
    20         -n|--newconf   ) CONF_TEST=$2         ; shift 2;; 
    21         -r|--refconf   ) CONF_REFE=$2         ; shift 2;; 
    22         -p|--publish   ) PUBLISH=1            ; shift  ;; 
    23    *)                                      break  ;; 
     16        -b|--branch ) NEMO_BRAN=$2         ; shift 2;; -d|--debug  ) set -vx; DEBUG=1     ; shift  ;; 
     17   -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;; 
     19   -n|--newconf) CONF_TEST=$2         ; shift 2;; -r|--refconf) CONF_REFE=$2         ; shift 2;; 
     20   -t|--time   ) TIME_LIMI=$2         ; shift 2;; -p|--publish) PUBLISH=1            ; shift  ;; 
     21                   *) cat trusting_help.txt; exit   ;; 
    2422    esac 
    2523done 
    26 export ARCH CONF_REFE CONF_TEST DEBUG NEMO_BRAN PUBLISH 
    2724 
    28 #[ $# -ne 1 ] && { ./trusting.sh -h && exit; } 
    29 # suspend debug mode (too verbose) 
    30 #[ $debug -eq 1 ] && set +vx 
     25# Set super-computer & user environment 
     26[[ ! -z "$ARCH" && . trusting.env ]] || { ./trusting.sh -h && exit; } 
     27export DEBUG PUBLISH 
    3128 
    3229# Initialization 
    3330#============================================= 
    3431 
    35 . trusting.env 
    3632echo ${DIR_TEST} 
    3733mkdir -p ${DIR_TEST} ${DIR_REFE} 
    3834cd ${DIR_TEST} 
    39 datestr1=$( LC_ALL=C date -d"$DATESTR" +%Y-%m-%dT%H:%M ) 
     35datestr1=$( LC_ALL=C date -d"$DATE_STR" +%Y-%m-%dT%H:%M ) 
    4036printf "Date\n%s\n"       $datestr1 > mesg_01_date.txt 
    4137 
     
    4844#  
    4945#============================================= 
    50 for rel in $COMPILER $MPI_NAME $NETCDFF; do 
     46for rel in $CDO $COMPILER $MPI $NETCDF; do 
    5147    printf "Step......................\nGet $rel release\n" > mesg_03_step.txt 
    52     arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 
    53     [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH | sed "s#.*$rel/\([^/]*\).*#\1#" ) 
    54     [ $rel == $COMPILER ] && arch_rel=$( $FC --version | grep -m1 -o ' [0-9.]* ' ) 
     48                             arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 
     49    [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH          | sed "s#.*$rel/\([^/]*\).*#\1#" ) 
     50    [ $( echo $rel | grep "$CDO\|$COMPILER" ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' ) 
    5551    echo $rel ${arch_rel} >> model.log 
    5652done 
     
    6460printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step.txt 
    6561rev=0 
    66 for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_TCMP}; do 
     62for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_SETT} ${NEMO_TCMP}; do 
    6763    svn up $dir 
    6864    rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 
     
    7672printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step.txt 
    7773cd ${NEMO_CONF} 
     74. ${ARCH_ENV}     # Sourcing architecture environment 
    7875#[ -d ${CONF_TEST} ] && ./makenemo -n ${CONF_TEST} clean 
    79 ./makenemo -n ${CONF_TEST} -r ${CONF_REFE} -m $ARCH -j 16 #> /dev/null 2>&1 
     76./makenemo -n ${CONF_TEST} -r ${CONF_REFE} -m $ARCH -j $NPROC #> /dev/null 2>&1 
    8077[ ! -e ${CONF_TEST}/BLD/bin/nemo.exe ] && getout 
    8178 
     
    8582cd ${DIR_TEST} 
    8683find ${NEMO_CONF}/${CONF_TEST}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 
    87 cp ${NEMO_FORC}/${FORC_TAR} . && tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR} 
    88 [ $? -ne 0 ] && getout 
    89 gunzip *.gz 
     84 
     85if [ ! -z "${NEMO_FORC}" ]; then 
     86    cp ${NEMO_FORC}/${FORC_TAR} . 
     87    tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR} 
     88    [ $? -ne 0 ] && getout 
     89    gunzip *.gz 
     90else 
     91    touch inputs_list.txt 
     92fi 
    9093 
    9194 
     
    9699[ $? -ne 0 ] && getout 
    97100 
    98 output_test=ocean.output   ; output_refe=${DIR_REFE}/ocean.output 
    99 solver_test=solver.stat    ; solver_refe=${DIR_REFE}/solver.stat 
    100 tracer_test=tracer.stat    ; tracer_refe=${DIR_REFE}/tracer.stat 
    101 inputs_test=inputs_list.txt; inputs_refe=${DIR_REFE}/inputs_list.txt 
    102  
    103 #time_elapsed=0; time_limit=10800; time_increment=300 
    104 time_elapsed=0; time_limit=1080; time_increment=30 
     101time_elapsed=0; time_increment=300 
    105102sleep ${time_increment} 
    106 while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${time_limit} ]] ; do 
    107 #while [[ ! -f ${solver_test} && ${time_elapsed} -lt ${time_limit} ]] ; do 
    108     printf "\n####################################################" >> ${DIR_TEST}/mpp.log 
    109     ${JOB_VIEW} $job_num >> mpp.log 
    110 #   ${JOB_VIEW} $id >> mpp.log 
     103while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${TIME_LIMI} ]] ; do 
     104    printf "\n####################################################" >> computation.log 
     105    ${JOB_VIEW} $job_num                                            >> computation.log 
    111106    sleep ${time_increment} 
    112     let time_elapsed+=time_increment 
     107    let time_elapsed+=${time_increment} 
    113108done 
    114109 
    115110 
    116111#--------------------------------------------- 
    117 printf "Step......................\nTest if solver exists\n"   > mesg_03_step.txt 
    118 #if [ ! -f ${solver_test} ]; then 
    119 #    grep 'E R R O R' ocean.output    >> mesg_11_comments.txt 
    120 #    sed 's/^/Time step :/' time.step >> mesg_11_comments.txt 
    121 #    getout 
    122 #fi 
     112printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step.txt 
     113if      [ ! -f ${output_test} ]; then 
     114 
     115    getout 
     116else if [  ] 
     117 
     118    grep 'E R R O R' ocean.output    >> mesg_11_comments.txt 
     119    sed 's/^/Time step :/' time.step >> mesg_11_comments.txt 
     120fi 
    123121 
    124122 
    125123#--------------------------------------------- 
    126 printf "Step......................\nTest solvers difference\n" > mesg_03_step.txt 
    127 diff ${output_refe} ${output_test} 
    128 [ $? -ne 0 ] && status='FAILED' 
    129 diff ${solver_refe} ${solver_test} 
    130 [ $? -ne 0 ] && status='FAILED' 
    131 diff ${tracer_refe} ${tracer_test} 
     124printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step.txt 
     125for file in ocean.output solver.stat tracer.stat; do 
     126    diff $file ${DIR_REFE}/$file 
     127    [ $? -ne 0 ] && status='FAILED' 
     128done 
     129 
     130 
     131#--------------------------------------------- 
     132printf "Step......................\nTest last restart files difference\n" > mesg_03_step.txt 
     133diff_trusting 2>/dev/null 
    132134[ $? -ne 0 ] && status='FAILED' 
    133135 
    134136 
    135137#--------------------------------------------- 
    136 printf "Step......................\nTest outputs difference\n" > mesg_03_step.txt 
    137 #diff_trusting 2>/dev/null 
    138 #[ $? -ne 0 ] && status='FAILED' 
    139  
    140  
    141 #--------------------------------------------- 
    142 printf "Comments\n\n"              >  mesg_11_comments.txt 
     138echo 'Comments'                    >  mesg_11_comments.txt 
    143139grep 'W A R N I N G:' ocean.output >> mesg_11_comments.txt 
    144140 
     
    148144    printf "Step......................\nGet Real CPU time\n" > mesg_03_step.txt 
    149145    real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}') 
    150     [ $? -ne 0 ] && getout 
    151146    printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime.txt 
    152147else 
    153148    printf "Step......................\nTest InputFiles difference\n" > mesg_03_step.txt 
    154     diff ${inputs_refe} ${inputs_test} 
    155     { [ $? -ne 0 ] && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles.txt } || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles.txt 
    156     getout 
     149    diff inputs_list.txt ${DIR_REFE}/inputs_list.txt 
     150    [ $? -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 
    157152fi 
    158153 
Note: See TracChangeset for help on using the changeset viewer.