Changeset 5444


Ignore:
Timestamp:
2015-06-19T17:40:51+02:00 (5 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Ping pong updates between Curie & Ada to finalize

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

    r5438 r5444  
    1111#--------------------------------------------------- 
    1212NEMO_TRUS=$( pwd $( dirname $0 ) ) 
    13 SVN_OPT='status' 
    14 DEBUG=0; PUBLISH=0; status='OK' 
     13DEBUG=0; PUBLISH=0; STATUS='OK' 
    1514 
    1615# Get options for replacing some initials settings 
     
    5352printf "Date\n$datestr1\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 
    5453# Only at end status will change to OK 
    55 status='FAILED' 
     54STATUS='FAILED' 
     55 
     56# SVN action on XIOS & NEMO essentials directories 
     57#--------------------------------------------------- 
     58pstep "Get NEMO SVN state with: ${SVN_OPT}" 
     59get_nemo_rev 
    5660 
    5761# Check softwares versions (source arch environment) 
     
    6064. ${ARCH_ENV} > /dev/null 
    6165get_soft_rel 
     66cat model.log 
    6267 
    63 # SVN action on XIOS & NEMO essentials directories 
     68# XIOS compiling 
    6469#--------------------------------------------------- 
    65 pstep "Get NEMO SVN state with: ${SVN_OPT}" 
    66 get_nemo_rev 
    67 exit 0 
     70pstep 'Compiling XIOS' 
     71cd ${DIR_XIOS} 
     72#./make_xios --arch $ARCH -job $NPROC >& /dev/null 
     73 
    6874# NEMO config compiled from scratch 
    6975#--------------------------------------------------- 
     
    7278#[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 
    7379./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null 
    74 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $step $status 
     80[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $STEP $STATUS 
    7581 
    7682# Get namelists, xml & forced files for running 
    7783#--------------------------------------------------- 
    7884pstep 'Preparing job' 
     85cd ${TEST_DIR} 
    7986find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 
    8087 
     
    8693 
    8794${cmd_iol} > inputs_list.txt && ${cmd_iof} > /dev/null 
    88 [ $? -ne 0 ] && get_out $step $status 
     95[ $? -ne 0 ] && get_out $STEP $STATUS 
    8996[ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz 
    9097 
     
    93100pstep 'Test input files difference' 
    94101diff_inputs 
    95  
     102get_out $STEP $STATUS 
    96103# Job submission & computing 
    97104#--------------------------------------------------- 
    98105pstep 'Running' 
    99106job_num=$( ${JOB_SUBM} | awk '{print $NF}' ) 
    100 [ $? -ne 0 ] && get_out $step $status 
     107[ $? -ne 0 ] && get_out $STEP $STATUS 
    101108 
    102109time_elapsed=0; time_increment=30 
     
    115122if   [[ ! -f ocean.output || $( grep 'E R R O R' ocean.output ) ]]; then 
    116123    ${JOB_DELE} ${job_num} &> /dev/null 
    117     [ ! -f ocean.output                  ] && step='nemo.exe crashed at initialization' 
    118     [ $( grep 'E R R O R' ocean.output ) ] && step='nemo.exe crashed' 
     124    [ ! -f ocean.output                  ] && STEP='nemo.exe crashed at initialization' 
     125    [ $( grep 'E R R O R' ocean.output ) ] && STEP='nemo.exe crashed' 
    119126    comments('E R R O R') 
    120127    ${JOB_DELE} ${job_num} >/dev/null 2>&1 
    121     status='FAILED' 
    122     get_out $step $status 
     128    STATUS='FAILED' 
     129    get_out $STEP $STATUS 
    123130else 
    124     status='OK' 
     131    STATUS='OK' 
    125132 
    126133    # Inspect output text files 
     
    129136    for file in ocean.output solver.stat tracer.stat; do 
    130137   diff $file ${REFE_DIR}/$file 
    131    [ $? -ne 0 ] && status='FAILED' 
     138   [ $? -ne 0 ] && STATUS='FAILED' 
    132139    done 
    133140 
     
    136143    pstep 'Test last restart NetCDF files diff' 
    137144    diff_restart #2> /dev/null 
    138     [ $? -ne 0 ] && status='FAILED' 
     145    [ $? -ne 0 ] && STATUS='FAILED' 
    139146 
    140147    # Get computation duration 
     
    148155# End 
    149156#--------------------------------------------------- 
    150 if [ $status == 'FAILED' ]; then step='Test outputs difference'; else step='Code is reliable'; fi 
    151 get_out $step $status 
     157if [ $STATUS == 'FAILED' ]; then STEP='Test outputs difference'; else STEP='Code is reliable'; fi 
     158get_out $STEP $STATUS 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh

    r5438 r5444  
    1010    # Portability ! 
    1111    real_cpu_time=$( ${JOB_VIEW} ${job_num} | awk 'END{print $9}' ) 
    12     printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     12    printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
    1313} 
    1414 
     
    2121    done 
    2222 
    23     printf "Input files\n$mesg" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
     23    printf "Input files\n$mesg" | tee mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    2424} 
    2525 
     
    4242       cmp ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 
    4343       if [ $? -ne 0 ]; then 
    44       status='FAILED' 
     44      export STATUS='FAILED' 
    4545      printf "$CDO diffn\n" 
    4646      $CDO diffn ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 2> /dev/null 
     
    6565    done 
    6666 
    67     sed -n 2p model.log | sed 'i\Compiler'    | tee mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 
    68     sed -n 3p model.log | sed 'i\MPI libs'    | tee mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 
    69     sed -n 4p model.log | sed 'i\NetCDF libs' | tee mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
     67    sed -n 4p model.log | sed 'i\Compiler'    > mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 
     68    sed -n 5p model.log | sed 'i\MPI libs'    > mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 
     69    sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
    7070} 
    7171 
    7272get_nemo_rev() { 
    73     rev=0 
     73    svn_opt='status' 
    7474 
    7575    # If -v|--version option has been set, modify svn command 
    76     if   [ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ]; then SVN_OPT='update' 
    77     elif [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ]; then SVN_OPT='checkout' 
    78    rev=$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 
     76    if [[    $( echo ${NEMO_VERS} | grep  "HEAD\|up\|update"   ) \ 
     77     || $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' )  ]]; then 
     78   rev=$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) || rev='HEAD' 
     79   svn_cmd='svn update -r '$rev  
     80    else 
     81   svn_cmd='svn '${svn_opt} 
    7982    fi 
    8083 
    81     for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \ 
    82           ${NEMO_EFCM} ${NEMO_TRUS} ${NEMO_TCMP} ${NEMO_TRBD}               ; do 
     84    rev=0 
     85    for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} \ 
     86          ${NEMO_EIOI} ${NEMO_EFCM} ${NEMO_TCMP} ${NEMO_TRBD}  ; do 
    8387 
    8488   # For time being, just get revision number from XIOS 
     
    8892   fi 
    8993 
    90    #  
    91    if [ $( echo ${SVN_OPT} | grep 'checkout' ) ]; then 
    92        cd ../$dir  
    93        url=$( svn info $dir | grep URL | awk '{print $NF}' ) 
    94        svn ${SVN_OPT} $url -r $rev $dir && cd - 
    95    else 
    96        svn ${SVN_OPT} $dir 
    97    fi 
    98  
     94   ${svn_cmd} $dir 
    9995   rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' ) 
    10096   (( ${rev_loc} >= $rev )) && rev=${rev_loc} 
    10197    done 
    10298 
    103     echo 'NEMO '$rev >> model.log 
    104     sed -n 6p model.log | sed 'i\NEMOGCM rev.' | tee mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt 
     99    echo 'NEMOGCM '$rev >> model.log 
     100    sed -n 2p model.log | sed 'i\NEMO rev.' > mesg_02_nemogcm_${CFG_USER}_${CFG_ARCH}.txt 
    105101} 
    106102 
     
    139135 
    140136pstep() { 
     137    STEP=$1 
     138    export STEP 
    141139    printf "Step.....\n$1\n" 
    142140} 
    143141 
    144142get_out() { 
    145     step=$1; status=$2 
    146143    mesg_make; mesg_publish 
    147144 
    148145    # Save tested configuration if trusting failed 
    149     if [ $status == 'FAILED' ]; then 
    150    touch mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 
    151    cd ${REFE_DIR} 
    152    tar -czf trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.tar.gz ${TEST_DIR}/* 
    153    cd - 
     146    if [ "$STATUS" == 'FAILED' ]; then 
     147   touch mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt \ 
     148         mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 
     149   tar -czf ${REFE_DIR}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
    154150    fi 
    155151 
    156     printf "Status\n$status\n"  > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 
    157     printf "Step.....\n$step\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
     152    printf "Status\n$STATUS\n"  > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 
     153    printf "Step.....\n$STEP\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    158154 
    159155    exit 1 
Note: See TracChangeset for help on using the changeset viewer.