New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 5465 – NEMO

Changeset 5465


Ignore:
Timestamp:
2015-06-22T23:10:50+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE End of main script trusting.sh size reduction

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

    r5464 r5465  
    6363print_step 'Compiling XIOS' 
    6464cd ${DIR_XIOS} 
    65 #./make_xios --full --arch $ARCH -job $NPROC #>& /dev/null 
     65#./make_xios --full --arch $ARCH -job $NPROC >& /dev/null 
    6666[ ! -e ${DIR_XIOS}/lib/libxios.a ] && get_out $STATUS $STEP 
    6767 
    6868# NEMO config compiled from scratch 
    6969#--------------------------------------------------- 
    70 print_step "Compiling ${CONF_REF} configuration" 
     70print_step "Compiling ${REFE_CONF} configuration" 
    7171cd ${NEMO_CONF} 
    7272#[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 
    73 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC #>& /dev/null 
     73./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null 
    7474[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $STATUS $STEP 
    7575 
    7676# Get namelists, xml & forced files for running 
    7777#--------------------------------------------------- 
    78 print_step "Preparing job by copying ${CONF_REF} input files" 
     78print_step "Preparing job by copying ${REFE_CONF} input files" 
    7979cd ${TEST_DIR} 
    8080find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 
     
    105105fi 
    106106 
     107STATUS='OK' 
    107108# Inspect output text files 
    108109#--------------------------------------------------- 
    109110print_step 'Test ASCII output files diff' 
    110111diff_textfiles 
     112if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP 
    111113 
    112114# Inspect output NetCDF files 
     
    114116print_step 'Test last restart NetCDF files diff' 
    115117diff_restart 
     118if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP 
    116119 
    117120# Get computation duration 
     
    126129# End 
    127130#--------------------------------------------------- 
    128 [ $STATUS == 'OK' ] && STEP='Code is reliable' 
     131[ "$STATUS" == 'OK' ] && STEP='Code is reliable' 
    129132get_out $STATUS $STEP 
  • branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh

    r5464 r5465  
    55    state=$1 
    66 
    7     if [ $state == 'E R R O R' ]; then 
     7    if [ "$state" == 'E R R O R' ]; then 
    88   if [ -e ocean.output ]; then 
    99       last_time_step=$( cat ${TEST_DIR}/time.step | tr -d [:space:] ) 
     
    2020    fi 
    2121 
    22     printf "Comments\n$line\n" | tee mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 
     22    printf "Comments\n$line\n" | tee mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
    2323} 
    2424 
     
    2626    # Portability ! 
    2727    real_cpu_time=$( ${JOB_VIEW} ${JOB_ID} | awk 'END{print $9}' ) 
    28     printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
     28    printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
    2929} 
    3030 
     
    4848    done 
    4949 
    50     printf "Input files\n$mesg\n" | tee mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
     50    printf "Input files\n$mesg\n" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 
    5151} 
    5252 
     
    6060 
    6161   for comp in restart restart_ice restart_trc; do 
    62        printf "${base_name}_${comp}.nc: " 
    63  
    64        nb_dom=$( find ${TEST_DIR} -name "${base_name}_${comp}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
     62       file=${base_name}'_'${comp} && printf "$file'.nc': " 
     63 
     64       nb_dom=$( find ${TEST_DIR} -name "${file}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
    6565       if [ ${nb_dom} -gt 1 ]; then 
    66       ${NEMO_TRBD}/rebuild_nemo -t $NPROC ${base_name}_$comp ${nb_dom} > /dev/null 
     66      ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom} > /dev/null 
    6767       fi 
    6868 
    6969       # UNIX `cmp` not suitable (filename & timestamp in .nc file) 
    70        $CDO diffn ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 2> /dev/null 
    71        if [ $? -ne 0 ]; then 
    72       STATUS='FAILED'; STEP='Restart files different' 
    73       #printf "$CDO diffn\n" 
     70       nc_diff=$( $CDO diffn ${TEST_DIR}/$file'.nc' ${REFE_DIR}/$file'.nc' 2> /dev/null | sed -n '$p' ) 
     71       if [ ! -z "${nc_diff}" ]; then 
     72      export STATUS='FAILED' STEP='Restart files different' 
     73      printf "$CDO diffn ${nc_diff}\n" 
    7474       else 
    7575      printf "identical\n" 
     
    8080 
    8181    else 
    82    STATUS='FAILED'; STEP='No restart files found at last time step' 
     82   export STATUS='FAILED'; STEP='No restart files found at last time step' 
    8383   printf "no restart files found for comparison\n" 
    8484    fi 
     
    8989    for file in ocean.output $( ls *.stat ); do 
    9090   diff $file ${REFE_DIR}/$file 
    91    [ $? -ne 0 ] && STATUS='FAILED' && STEP='ASCII output file diff' 
     91   [ $? -ne 0 ] && export STATUS='FAILED' STEP='ASCII output file diff' 
    9292    done 
    9393} 
     
    9797                                 arch_rel=$( echo $LOADEDMODULES | sed  "s#.*$rel/\([^:]*\).*#\1#" ) 
    9898   [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH          | sed  "s#.*$rel/\([^/]*\).*#\1#" ) 
    99    [ $rel == $COMPILER ] && arch_rel=$( $rel --version      | grep -m1 -o ' [0-9.]* '         ) 
     99   [ "$rel" == "$COMPILER" ] && arch_rel=$( $rel --version      | grep -m1 -o ' [0-9.]* '         ) 
    100100   echo $rel ${arch_rel} >> model.log 
    101101    done 
    102102 
    103     sed -n 4p model.log | sed 'i\Compiler'    > mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 
    104     sed -n 5p model.log | sed 'i\MPI libs'    > mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 
    105     sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
     103    sed -n 4p model.log | sed 'i\Compiler'    > mesg_06_compiler_${CFG_USER}_${CFG_ARCH}.txt 
     104    sed -n 5p model.log | sed 'i\MPI libs'    > mesg_07_mpi_${CFG_USER}_${CFG_ARCH}.txt 
     105    sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_08_netcdf_${CFG_USER}_${CFG_ARCH}.txt 
    106106} 
    107107 
     
    125125 
    126126   # For time being, just get revision number from XIOS 
    127    if [ $dir == ${DIR_XIOS} ]; then 
    128        echo 'XIOS '$( svn info $dir | awk '(NR == 5) {print $NF}' ) >> model.log 
     127   if [ "$dir" == "${DIR_XIOS}" ]; then 
     128       rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' ) 
     129       echo   'XIOS '${rev_loc}         >> model.log 
     130       printf "XIOS rev.\n${rev_loc}\n" >  mesg_05_xios__${CFG_USER}_${CFG_ARCH}.txt 
    129131       continue 
    130132   fi 
    131133 
    132    ${svn_cmd} $dir 
     134   echo ${svn_cmd} $dir': '$( ${svn_cmd} $dir ) 
    133135   rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' ) 
    134136   (( ${rev_loc} >= $rev )) && rev=${rev_loc} 
    135137    done 
    136138 
    137     echo   "NEMOGCM $rev"         >> model.log 
    138     printf "NEMOGCM rev.\n$rev\n" >  mesg_02_nemogcm_${CFG_USER}_${CFG_ARCH}.txt 
     139    echo   'NEMOGCM '$rev         >> model.log 
     140#   printf "NEMOGCM rev.\n$rev\n" >  mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt 
     141    printf "NEMOGCM rev.\n\ 
     142            <a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \ 
     143    >  mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt 
    139144} 
    140145 
     
    153158 
    154159  # Send mail only when FAILED 
    155   if [[ ! -z $EMAIL && $STATUS == 'FAILED' ]]; then 
     160  if [[ ! -z $EMAIL && "$STATUS" == 'FAILED' ]]; then 
    156161      cat << END_MAIL > trusting.mail 
    157162XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
     
    159164 
    160165The trusting sequence for ${CONF_REF} has failed at step: 
    161 `tail -n 1 ${TEST_DIR}/mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt` 
     166`tail -n 1 ${TEST_DIR}/mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt` 
    162167Directory : ${TEST_DIR} 
    163168 
     
    180185 
    181186get_out() { 
     187    # Save tested configuration if trusting failed 
     188    if [ "$STATUS" == 'FAILED' ]; then 
     189   cd ${TEST_DIR} 
     190   touch mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt \ 
     191         mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 
     192   #tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
     193    fi 
     194 
     195    printf "Status\n$STATUS\n"  > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 
     196    printf "Step.....\n$STEP\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 
     197 
    182198    mesg_make; mesg_publish 
    183  
    184     # Save tested configuration if trusting failed 
    185     if [ $STATUS == 'FAILED' ]; then 
    186    cd ${TEST_DIR} 
    187    touch mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt \ 
    188          mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt 
    189    #tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
    190     fi 
    191  
    192     printf "Status\n$STATUS\n"  > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 
    193     printf "Step.....\n$STEP\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 
    194199 
    195200    exit 1 
Note: See TracChangeset for help on using the changeset viewer.