Changeset 5355
- Timestamp:
- 2015-06-04T20:09:56+02:00 (10 years ago)
- Location:
- branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/X64_CURIE.cfg
r5292 r5355 3 3 # Available softwares: 4 4 CDO=cdo 5 COMPILER=i fort5 COMPILER=intel 6 6 MPI=bullxmpi 7 7 NETCDF=netcdf … … 13 13 JOB_DELE=ccc_mdel 14 14 15 # 16 [ -z "$NPROC" ] && NPROC=117 [ -z "$ TIME_LIMI" ] && TIME_LIMI=10800 # 3h15 # Compiling & computing settings 16 [ -z "$NPROC" ] && NPROC=16 17 [ -z "${TIME_LIMI}" ] && TIME_LIMI=10800 # 3h 18 18 19 19 # Architecture environment (be careful with compliance with XIOS) 20 ARCH_ENV=${DIR_XIOS}/arch/arch-${ ARCH}.env20 ARCH_ENV=${DIR_XIOS}/arch/arch-${CFG_ARCH}.env -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/arch_template.cfg
r5293 r5355 4 4 5 5 # Available softwares: 6 CDO='' # CDO (Climate Data Operators) (to get application version with `$CDO --version`)7 COMPILER='' # ifort/gfortran/pgfortran/$FC/... ("" " " compiler " " "" `$COMPILER --version`)8 MPI='' # MPI libraries (root directory name in $LOADEDMODULES or $PATH variable)9 NETCDF='' # NetCDF " " ( "" " " "" "" "" "" " " "")6 CDO='' # CDO (Climate Data Operators) (root directory name in $LOADEDMODULES or $PATH) 7 COMPILER='' # ifort/gfortran/pgfortran/... ( "" " " "" "" "" "" " " ) 8 MPI='' # MPI libraries ( "" " " "" "" "" "" " " ) 9 NETCDF='' # NetCDF " " ( "" " " "" "" "" "" " " ) 10 10 11 11 # Job commands: 12 JOB_SUBM='' # Command to submit a job && get his ID in return13 JOB_LIST='' # " " to list submitted jobs (to know if the job is in progress with his ID)14 JOB_VIEW='' # " " to get job informations (to increment a log during computing from job ID)15 JOB_DELE='' # " " to stop a job (not used currently)12 JOB_SUBM='' # Submit a job && get his ID in return 13 JOB_LIST='' # List submitted jobs (to know if the job is in progress with his ID) 14 JOB_VIEW='' # Get job informations (to increment a log during computing from job ID) 15 JOB_DELE='' # Stop a job (not used currently) 16 16 17 # 18 [ -z "$NPROC" ] && NPROC=1 # Number of processing units for compilation19 [ -z "$ TIME_LIMI" ] && TIME_LIMI='' # Timeout in s for computation(pending & running)17 # Compiling & computing settings 18 [ -z "$NPROC" ] && NPROC=1 # Number of processing units 19 [ -z "${TIME_LIMI}" ] && TIME_LIMI='' # Timeout in s (pending & running) 20 20 21 21 # Architecture environment (be careful with compliance with XIOS) 22 ARCH_ENV='' # ${DIR_WORK}/XIOS/arch/arch-${ARCH}.env22 ARCH_ENV='' # ${DIR_WORK}/XIOS/arch/arch-${CFG_ARCH}.env -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/user_template.cfg
r5292 r5355 11 11 # NEMO overall configuration: 12 12 [ -z "${NEMO_BRAN}" ] && NEMO_BRAN='' # trunk, dev_v3_4_STABLE_2012, ... 13 [ -z "${CONF_REFE}" ] && CONF_REFE='' # ORCA2_LIM_PISCES, GYRE, ...14 [ -z "${CONF_TEST}" ] && CONF_TEST='' # ${CONF_REFE}_trust, ...13 [ -z "${CONF_REFE}" ] && REFE_CONF='' # ORCA2_LIM_PISCES, GYRE, ... 14 [ -z "${CONF_TEST}" ] && TEST_CONF='' # ${CONF_REFE}_trust, ... 15 15 NEMO_HOME='' # NEMOGCM equivalent root directory to find ./ARCH,./CONFIG, ... 16 16 # (${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM, ...) 17 17 18 18 # Comparatives directories localization: 19 DIR_REFE='' # ${DIR_STOR}/${CONF_REFE}/${NEMO_BRAN}20 DIR_TEST='' # ${DIR_SCRA}/${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR}19 REFE_DIR='' # ${DIR_STOR}/${CONF_REFE}/${NEMO_BRAN} 20 TEST_DIR='' # ${DIR_SCRA}/${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR} 21 21 22 22 # External softs directories: -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env
r5292 r5355 7 7 8 8 # Sourcing user configuration 9 [ ! find ./cfg -name ${CFG_USER}.cfg ] && { echo 'No configuration file in ./cfg for '${CFG_USER}; exit; } 10 . cfg/${CFG_USER}.cfg9 #-------------------------------------- 10 . ${NEMO_TRUS}/cfg/${CFG_USER}.cfg 11 11 export DIR_WORK DIR_SCRA DIR_STOR 12 export NEMO_HOME NEMO_BRAN CONF_REFE CONF_TEST13 export DIR_REFE DIR_TEST12 export NEMO_HOME NEMO_BRAN 13 export REFE_CONF TEST_CONF REFE_DIR TEST_DIR 14 14 export DIR_XIOS DIR_OASI 15 15 export NEMO_FORC FORC_TARF 16 16 17 NEMO_ARCH=${NEMO_HOME}/ARCH ; NEMO_CONF=${NEMO_HOME}/CONFIG ; NEMO_ENGI=${NEMO_HOME}/NEMO 18 NEMO_ EFCM=${NEMO_HOME}/EXTERNAL/fcm ; NEMO_IPSL=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_TRUS=${NEMO_HOME}/SETTE19 NEMO_ TCMP=${NEMO_HOME}/TOOLS/COMPILE17 # Only interest for essential NEMO directories 18 NEMO_ARCH=${NEMO_HOME}/ARCH ; NEMO_CONF=${NEMO_HOME}/CONFIG ; NEMO_ENGI=${NEMO_HOME}/NEMO 19 NEMO_EFCM=${NEMO_HOME}/EXTERNAL/fcm; NEMO_IPSL=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE 20 20 export NEMO_ARCH NEMO_CONF NEMO_EFCM 21 export NEMO_ENGI NEMO_IPSL NEMO_TRUS 22 export NEMO_TCMP 21 export NEMO_ENGI NEMO_IPSL NEMO_TCMP 23 22 24 23 # Sourcing super-computer configuration 25 [ ! find ./cfg -name ${CFG_ARCH}.cfg ] && { echo 'No configuration file in ./cfg for '${CFG_ARCH}; exit; } 26 . cfg/${CFG_ARCH}.cfg24 #-------------------------------------- 25 . ${NEMO_TRUS}/cfg/${CFG_ARCH}.cfg 27 26 export CDO COMPILER MPI NETCDF 28 27 export JOB_SUBM JOB_LIST JOB_VIEW JOB_DELE 29 28 export NPROC TIME_LIMI 30 29 export ARCH_ENV 31 32 [ ! find ${NEMO_ARCH} -name arch-$ARCH.fcm ] && { echo 'No fcm file in '${NEMO_ARCH}' for '$ARCH ; exit; } -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
r5292 r5355 9 9 10 10 # Set defaults 11 #--------------------------------------------------- 12 NEMO_TRUS=$( pwd $( dirname $0 ) ) 11 13 DEBUG=0; PUBLISH=0; status='OK' 12 14 13 # Get options to replace some initials settings 15 # Get options for replacing some initials settings 16 #--------------------------------------------------- 14 17 while [ $# -ne 0 ]; do 15 18 case $1 in 16 19 -b|--branch ) NEMO_BRAN=$2 ; shift 2;; -d|--debug ) set -vx; DEBUG=1 ; shift ;; 17 20 -e|--email ) MAIL=$2 ; shift 2;; -j|--job ) NPROC=$2 ; shift 2;; 18 -h|--help ) cat trusting_help.txt; exit 19 -n|--newconf) CONF_TEST=$2 ; shift 2;; -r|--refconf) CONF_REFE=$2 ; shift 2;;21 -h|--help ) cat trusting_help.txt; exit 1;; -m|--machine) CFG_ARCH=$2 ; shift 2;; 22 -n|--newconf) TEST_CONF=$2 ; shift 2;; -r|--refconf) REFE_CONF=$2 ; shift 2;; 20 23 -t|--time ) TIME_LIMI=$2 ; shift 2;; -p|--publish) PUBLISH=1 ; shift ;; 21 24 -u|--user ) CFG_USER=$2 ; shift 2;; -v|--version) NEMO_REVI=$2 ; shift 2;; 22 *) cat trusting_help.txt; exit 25 *) cat trusting_help.txt; exit 1;; 23 26 esac 24 27 done 25 28 26 # Set super-computer & user environment 27 [[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]] && . trusting.env || { ./trusting.sh -h && exit; } 28 export DEBUG PUBLISH 29 30 # Initialization 31 #============================================= 32 33 echo ${DIR_TEST} 34 mkdir -p ${DIR_TEST} ${DIR_REFE} 35 cd ${DIR_TEST} 36 datestr1=$( LC_ALL=C date -d"$DATE_STR" +%Y-%m-%dT%H:%M ) 37 printf "Date\n%s\n" $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 38 39 printf "Status\nFAILED\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt # Only at end status will change to OK 40 41 . trusting_func.sh 42 #============================================= 29 #export DEBUG PUBLISH 43 30 44 31 45 # 46 #============================================= 32 # Initialization (super-computer & user environment) 33 #--------------------------------------------------- 34 if [[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]]; then 35 36 if [ ! $( find ${NEMO_TRUS}/cfg -name ${CFG_USER}.cfg ) ]; then 37 echo 'No configuration file in '${NEMO_TRUS}'/cfg for '${CFG_USER}; exit 1 38 elif [ ! $( find ${NEMO_TRUS}/cfg -name ${CFG_ARCH}.cfg ) ]; then 39 echo 'No configuration file in '${NEMO_TRUS}'/cfg for '${CFG_ARCH}; exit 1 40 else 41 . ${NEMO_TRUS}/trusting.env 42 fi 43 44 else 45 cat ${NEMO_TRUS}/trusting_help.txt; exit 1 46 fi 47 48 datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 49 . ./trusting_func.sh 50 51 mkdir -p ${TEST_DIR} ${REFE_DIR} 52 echo ${TEST_DIR} && cd ${TEST_DIR} 53 printf "Date\n%s\n" $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 54 # Only at end status will change to OK 55 printf "Status\nFAILED\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 56 57 58 # Check softwares versions 59 #--------------------------------------------------- 60 printf "Step......................\nGet softwares release\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 47 61 for rel in $CDO $COMPILER $MPI $NETCDF; do 48 printf "Step......................\nGet $rel release\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt49 62 arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 50 63 [ -z "${arch_rel}" ] && arch_rel=$( echo $PATH | sed "s#.*$rel/\([^/]*\).*#\1#" ) 51 [ $( echo $rel | grep "$CDO\|$COMPILER" ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ')64 # [ $( echo $rel | grep $COMPILER ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' >/dev/null ) 52 65 echo $rel ${arch_rel} >> model.log 53 66 done 54 67 55 sed -n 1p model.log | sed 'i\Fortran compiler' > mesg_04_compiler_${CFG_USER}_${CFG_ARCH}.txt56 sed -n 2p model.log | sed 'i\MPI libraries ' > mesg_05_mpi_${CFG_USER}_${CFG_ARCH}.txt57 sed -n 3p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_${CFG_USER}_${CFG_ARCH}.txt68 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 58 71 59 72 60 # ---------------------------------------------61 printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 73 # SVN action on XIOS & NEMO essentials directories 74 #--------------------------------------------------- 62 75 svn_cmd='svn status' 63 64 76 # If -v|--version option has been set, modify svn command 65 77 [ $( echo ${NEMO_VERS} | grep "up\|update" ) ] && svn_cmd='svn update' 66 78 [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && svn_cmd='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 67 79 80 printf "Step......................\nGet NEMO SVN revision with: ${svn_cmd}\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 68 81 rev=0 82 69 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 70 85 [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 71 86 ${svn_cmd} $dir … … 76 91 77 92 78 #--------------------------------------------- 79 printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 93 # NEMO config compiled from scratch 94 #--------------------------------------------------- 95 printf "Step......................\nCompiling ${CONF_REF} configuration\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 80 96 cd ${NEMO_CONF} 81 . ${ARCH_ENV} # Sourcing architecture environment82 #[ -d ${ CONF_TEST} ] && ./makenemo -n ${CONF_TEST} clean83 ./makenemo -n ${ CONF_TEST} -r ${CONF_REFE} -m $ARCH -j $NPROC #> /dev/null 2>&184 [ ! -e ${ CONF_TEST}/BLD/bin/nemo.exe ] && getout97 . ${ARCH_ENV} > /dev/null # Sourcing architecture environment 98 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 99 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC > /dev/null 2>&1 100 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 85 101 86 102 87 #--------------------------------------------- 88 printf "Step......................\nPreparing job\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 89 cd ${DIR_TEST} 90 find ${NEMO_CONF}/${CONF_TEST}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 103 # Get namelists, xml & forced files for running 104 #--------------------------------------------------- 105 printf "Step......................\nPreparing job\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 106 cd ${TEST_DIR} 107 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; 91 108 92 109 if [ ! -z "${NEMO_FORC}" ]; then 93 110 cp ${NEMO_FORC}/${FORC_TAR} . 94 tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR} 95 [ $? -ne 0 ] && get out111 tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR} > /dev/null 112 [ $? -ne 0 ] && get_out 96 113 gunzip *.gz 97 114 else … … 100 117 101 118 102 # ---------------------------------------------103 printf "Step......................\nRunning\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 104 #${JOB_SUB} ${DIR_TEST}/../../batch.sh 105 job_num=$( ${JOB_SUB } ${DIR_TEST}/../../batch.sh | awk '{print $NF}')106 [ $? -ne 0 ] && get out119 # Job submission & computing 120 #--------------------------------------------------- 121 printf "Step......................\nRunning\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM} 122 job_num=$( ${JOB_SUBM} | awk '{print $NF}' ) 123 [ $? -ne 0 ] && get_out 107 124 108 time_elapsed=0; time_increment=30 0125 time_elapsed=0; time_increment=30 109 126 sleep ${time_increment} 110 while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${TIME_LIMI} ]] 127 while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${TIME_LIMI} ]]; do 111 128 printf "\n####################################################" >> computation.log 112 129 ${JOB_VIEW} $job_num >> computation.log … … 116 133 117 134 118 #--------------------------------------------- 119 printf "Step......................\nTest if ASCII output files exist\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 120 if [ ! -f ${output_test} ]; then 121 122 getout 123 else if [ ] 124 125 grep 'E R R O R' ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 126 sed 's/^/Time step :/' time.step >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 135 # Eventual crash during computing 136 #--------------------------------------------------- 137 printf "Step......................\nTest if ASCII output files exist\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 138 if [ ! -f ocean.output ]; then 139 printf "Step......................\nOpa crashed at initialization\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 140 status='FAILED' 141 elif [ $( 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 145 status='FAILED' 127 146 fi 128 147 129 148 130 #--------------------------------------------- 131 printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 149 # Inspect output text files 150 #--------------------------------------------------- 151 printf "Step......................\nTest ASCII output files difference\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 132 152 for file in ocean.output solver.stat tracer.stat; do 133 diff $file ${ DIR_REFE}/$file153 diff $file ${REFE_DIR}/$file 134 154 [ $? -ne 0 ] && status='FAILED' 135 155 done 136 156 137 157 138 #--------------------------------------------- 139 printf "Step......................\nTest last restart files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 140 diff_trusting 2>/dev/null 158 # Inspect output NetCDF files 159 #--------------------------------------------------- 160 printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 161 diff_restart 2>/dev/null 141 162 [ $? -ne 0 ] && status='FAILED' 142 163 143 164 144 #--------------------------------------------- 165 # Comments 166 #--------------------------------------------------- 145 167 echo 'Comments' > mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 146 168 grep 'W A R N I N G:' ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 147 169 148 170 149 #--------------------------------------------- 171 # Finals tests 172 #--------------------------------------------------- 150 173 if [ $status != 'FAILED' ]; then 151 printf "Step......................\nGet Real CPU time\n" >mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt152 real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}' )174 printf "Step......................\nGet real CPU time\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 175 real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}' ) 153 176 printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt 154 177 else 155 printf "Step......................\nTest InputFiles difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 156 diff inputs_list.txt ${DIR_REFE}/inputs_list.txt 157 [ $? -ne 0 ] && getout 158 [[ $? -ne 0 && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 178 printf "Step......................\nTest input files difference\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 179 diff inputs_list.txt ${REFE_DIR}/inputs_list.txt 180 181 if [ $? -ne 0]; then 182 printf "Input files\nDifferent" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 183 else 184 printf "Input files\nSame" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 185 fi 186 187 get_out 159 188 fi 160 189 161 190 162 #--------------------------------------------- 191 # So far, everything is good 192 #--------------------------------------------------- 163 193 printf "Status\nOK\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt 164 printf "Step......................\nCode is reliable\n" >mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt194 printf "Step......................\nCode is reliable\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 165 195 166 #--------------------------------------------- 167 getout 196 197 # End 198 #--------------------------------------------------- 199 get_out -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
r5292 r5355 1 1 #!/bin/bash 2 2 3 function mesg_make { 3 function mesg_make { 4 4 paste -d ';' mesg_*_${CFG_USER}_${CFG_ARCH}.txt > trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt 5 5 cat trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt … … 7 7 8 8 #============================================= 9 function mesg_publish { 9 function mesg_publish { 10 10 11 11 if [ $PUBLISH -eq 1 ]; then 12 12 13 if [ -f ${ DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt ] ; then14 tail -1 trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${ DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt13 if [ -f ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ] ; then 14 tail -1 trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 15 15 else 16 cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${ DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt16 cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 17 17 fi 18 18 19 cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${ DIR_TEST}20 # chmod o+r ${ DIR_TEST}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt19 cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${TEST_DIR} 20 # chmod o+r ${TEST_DIR}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt 21 21 22 22 # rm -rf ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 23 # cp -alf ${ DIR_TEST} ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF}23 # cp -alf ${TEST_DIR} ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 24 24 # chmod o+rX ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF} 25 25 26 26 # Send mail only when FAILED 27 if [[ grep 'FAILED' mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt&& ! -z $MAIL ]]; then28 cat << END_MAIL > ${ DIR_TEST}/trusting.mail27 if [[ $( grep 'FAILED' mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt ) && ! -z $MAIL ]]; then 28 cat << END_MAIL > ${TEST_DIR}/trusting.mail 29 29 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 30 30 Dear $USER, … … 34 34 35 35 Failed at step: `tail -n 1 mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt` 36 Directory : ${ DIR_TEST}36 Directory : ${TEST_DIR} 37 37 38 38 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 39 39 40 40 END_MAIL 41 mail -s "[trusting ${CONF_REF}] FAILED" $MAIL < ${ DIR_TEST}/trusting.mail41 mail -s "[trusting ${CONF_REF}] FAILED" $MAIL < ${TEST_DIR}/trusting.mail 42 42 fi 43 43 … … 47 47 48 48 #============================================= 49 function get out {50 cd ${ DIR_TEST}49 function get_out { 50 cd ${TEST_DIR} 51 51 mesg_make; mesg_publish 52 52 … … 60 60 61 61 #============================================= 62 function diff nc {62 function diff_nc { 63 63 stat=100; file1=$1; file2=$2 64 64 65 65 cdo diffv $file1 $file2 > out_tmp 66 ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 "records differ" out_tmp | awk '-Fof''{print $1}' )66 ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 'records differ' out_tmp | awk -Fof '{print $1}' ) 67 67 [ -f out_tmp ] && rm out_tmp 68 68 … … 71 71 72 72 #--------------------------------------------- 73 function diff_trusting { 74 75 name_first=${JOB_NAME} 76 name_second=EXP00C 77 rep_ref=EXP00C_REFE 78 experiment_name=trusting 79 tagname=TEST 80 #listcomp="ATM SBG SRF CPL ICE MBG OCE" 81 listcomp="ATM SRF CPL ICE MBG OCE" 73 function diff_restart { 74 last_time_step=$( cat ${REFE_DIR}/time.step ) 82 75 result_final=0 83 76 84 # Output 85 cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first} 86 for comp in ${listcomp}; do 87 echo ${comp} 88 cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first}/${comp}/Output 89 listfreq=$(ls -d MO/ DA/) 90 for freq in ${listfreq}; do 91 echo ${freq} 92 cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first}/${comp}/Output/${freq} 93 listfile=$( ls *.nc ) 94 for file in ${listfile}; do 95 var=$( echo $file | sed -e "s/^${name_first}//" ) 96 result=$( diffnc ${name_first}${var} ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${CONFIG_WORK}/${rep_ref}/${comp}/Output/${freq}${name_second}${var} ) 97 result=$? 98 echo 'diffnc '${name_first}${var} ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/TEST/${CONFIG_WORK}/${rep_ref}/${comp}/Output/${freq}${name_second}${var} 99 echo $result 100 (( result_final = result_final + result )) 101 done 77 echo 'Last time step: '${last_time_step} 78 79 if [ $( find ${REFE_DIR} -name *restart*_${last_time_step}.nc ) ]; then 80 81 for file in find ${REFE_DIR} -name *restart*_${last_time_step}.nc; do 82 echo ${TEST_DIR}'/*'${file}'_'${last_time_step}'.nc: ' 83 result=$( diff_nc $file ) 84 printf "diffnc $result\n" 85 (( result_final = result_final + result )) 102 86 done 103 done104 return $result_final105 87 88 else 89 echo 'No restart files found for comparison' 90 fi 91 92 return ${result_final} 106 93 }
Note: See TracChangeset
for help on using the changeset viewer.