Changeset 5383
- Timestamp:
- 2015-06-09T11:13:36+02:00 (9 years ago)
- Location:
- branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/user_template.cfg
r5355 r5383 15 15 NEMO_HOME='' # NEMOGCM equivalent root directory to find ./ARCH,./CONFIG, ... 16 16 # (${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM, ...) 17 NEMO_RBDN='' # NEMO rebuild executable 17 18 18 19 # Comparatives directories localization: -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env
r5355 r5383 16 16 17 17 # Only interest for essential NEMO directories 18 NEMO_ARCH=${NEMO_HOME}/ARCH ; NEMO_CONF=${NEMO_HOME}/CONFIG; NEMO_ENGI=${NEMO_HOME}/NEMO19 NEMO_E FCM=${NEMO_HOME}/EXTERNAL/fcm; NEMO_IPSL=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE20 export NEMO_ARCH NEMO_CONF NEMO_E FCM21 export NEMO_E NGI NEMO_IPSLNEMO_TCMP18 NEMO_ARCH=${NEMO_HOME}/ARCH ; NEMO_CONF=${NEMO_HOME}/CONFIG ; NEMO_ENGI=${NEMO_HOME}/NEMO 19 NEMO_EIOI=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_EFCM=${NEMO_HOME}/EXTERNAL/fcm; NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE 20 export NEMO_ARCH NEMO_CONF NEMO_ENGI 21 export NEMO_EIOI NEMO_EFCM NEMO_TCMP 22 22 23 23 # Sourcing super-computer configuration -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
r5355 r5383 11 11 #--------------------------------------------------- 12 12 NEMO_TRUS=$( pwd $( dirname $0 ) ) 13 SVN_CMD='svn status' 13 14 DEBUG=0; PUBLISH=0; status='OK' 14 15 … … 22 23 -n|--newconf) TEST_CONF=$2 ; shift 2;; -r|--refconf) REFE_CONF=$2 ; shift 2;; 23 24 -t|--time ) TIME_LIMI=$2 ; shift 2;; -p|--publish) PUBLISH=1 ; shift ;; 24 -u|--user ) CFG_USER=$2 ; shift 2;; -v|--version) NEMO_ REVI=$2 ; shift 2;;25 -u|--user ) CFG_USER=$2 ; shift 2;; -v|--version) NEMO_VERS=$2 ; shift 2;; 25 26 *) cat trusting_help.txt; exit 1;; 26 27 esac … … 46 47 fi 47 48 49 # If -v|--version option has been set, modify svn command 50 [ $( echo ${NEMO_VERS} | grep "up\|update" ) ] && SVN_CMD='svn update' 51 [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 52 48 53 datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M ) 49 54 . ./trusting_func.sh … … 53 58 printf "Date\n%s\n" $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt 54 59 # Only at end status will change to OK 55 printf "Status\nFAILED\n" > mesg_0 2_status_${CFG_USER}_${CFG_ARCH}.txt60 printf "Status\nFAILED\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 56 61 57 62 58 63 # Check softwares versions 59 64 #--------------------------------------------------- 60 printf "Step......................\nGet softwares release\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 61 for rel in $CDO $COMPILER $MPI $NETCDF; do 62 arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" ) 63 [ -z "${arch_rel}" ] && arch_rel=$( echo $PATH | sed "s#.*$rel/\([^/]*\).*#\1#" ) 64 # [ $( echo $rel | grep $COMPILER ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' >/dev/null ) 65 echo $rel ${arch_rel} >> model.log 66 done 67 68 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 65 printf "Step......................\nGet softwares release\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 66 . ${ARCH_ENV} > /dev/null # Sourcing architecture environment 67 get_rel 68 sed -n 2p model.log | sed 'i\Fortran compiler' > mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt 69 sed -n 3p model.log | sed 'i\MPI libraries ' > mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt 70 sed -n 4p model.log | sed 'i\NetCDF libraries' > mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt 71 71 72 72 73 73 # SVN action on XIOS & NEMO essentials directories 74 74 #--------------------------------------------------- 75 svn_cmd='svn status' 76 # If -v|--version option has been set, modify svn command 77 [ $( echo ${NEMO_VERS} | grep "up\|update" ) ] && svn_cmd='svn update' 78 [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && svn_cmd='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) 79 80 printf "Step......................\nGet NEMO SVN revision with: ${svn_cmd}\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt 81 rev=0 82 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 85 [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 86 ${svn_cmd} $dir 87 rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 88 (( ${rev_loc} >= $rev )) && rev=${rev_loc} 89 done 90 echo 'NEMO '$rev >> model.log 75 printf "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 91 78 92 79 93 80 # NEMO config compiled from scratch 94 81 #--------------------------------------------------- 95 printf "Step......................\nCompiling ${CONF_REF} configuration\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt82 printf "Step......................\nCompiling ${CONF_REF} configuration\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 96 83 cd ${NEMO_CONF} 97 . ${ARCH_ENV} > /dev/null # Sourcing architecture environment98 84 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 99 85 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC > /dev/null 2>&1 … … 103 89 # Get namelists, xml & forced files for running 104 90 #--------------------------------------------------- 105 printf "Step......................\nPreparing job\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt91 printf "Step......................\nPreparing job\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 106 92 cd ${TEST_DIR} 107 93 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; … … 119 105 # Job submission & computing 120 106 #--------------------------------------------------- 121 printf "Step......................\nRunning\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM}107 printf "Step......................\nRunning\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM} 122 108 job_num=$( ${JOB_SUBM} | awk '{print $NF}' ) 123 109 [ $? -ne 0 ] && get_out … … 135 121 # Eventual crash during computing 136 122 #--------------------------------------------------- 137 printf "Step......................\nTest if ASCII output files exist\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt123 printf "Step......................\nTest if ASCII output files exist\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 138 124 if [ ! -f ocean.output ]; then 139 printf "Step......................\nOpa crashed at initialization\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt125 printf "Step......................\nOpa crashed at initialization\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 140 126 status='FAILED' 141 127 elif [ $( grep 'E R R O R' ocean.output ) ]; then 142 printf "Step......................\nOpa crashed\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt143 grep 'E R R O R' ocean.output >> mesg_1 1_comments_${CFG_USER}_${CFG_ARCH}.txt144 sed 's/^/Time step :/' time.step >> mesg_1 1_comments_${CFG_USER}_${CFG_ARCH}.txt128 printf "Step......................\nOpa crashed\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 129 grep 'E R R O R' ocean.output >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 130 sed 's/^/Time step :/' time.step >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 145 131 status='FAILED' 146 132 fi … … 149 135 # Inspect output text files 150 136 #--------------------------------------------------- 151 printf "Step......................\nTest ASCII output files difference\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt137 printf "Step......................\nTest ASCII output files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 152 138 for file in ocean.output solver.stat tracer.stat; do 153 139 diff $file ${REFE_DIR}/$file … … 158 144 # Inspect output NetCDF files 159 145 #--------------------------------------------------- 160 printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt146 printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 161 147 diff_restart 2>/dev/null 162 148 [ $? -ne 0 ] && status='FAILED' … … 165 151 # Comments 166 152 #--------------------------------------------------- 167 echo 'Comments' > mesg_1 1_comments_${CFG_USER}_${CFG_ARCH}.txt168 grep 'W A R N I N G:' ocean.output >> mesg_1 1_comments_${CFG_USER}_${CFG_ARCH}.txt153 echo 'Comments' > mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 154 grep 'W A R N I N G:' ocean.output >> mesg_12_comments_${CFG_USER}_${CFG_ARCH}.txt 169 155 170 156 … … 172 158 #--------------------------------------------------- 173 159 if [ $status != 'FAILED' ]; then 174 printf "Step......................\nGet real CPU time\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt160 printf "Step......................\nGet real CPU time\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 175 161 real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}' ) 176 printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_0 8_realcputime_${CFG_USER}_${CFG_ARCH}.txt162 printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt 177 163 else 178 printf "Step......................\nTest input files difference\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt164 printf "Step......................\nTest input files difference\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 179 165 diff inputs_list.txt ${REFE_DIR}/inputs_list.txt 180 166 181 if [ $? -ne 0 ]; then182 printf "Input files\nDifferent" > mesg_ 09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt167 if [ $? -ne 0 ]; then 168 printf "Input files\nDifferent" > mesg_10_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 183 169 else 184 printf "Input files\nSame" > mesg_ 09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt170 printf "Input files\nSame" > mesg_10_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 185 171 fi 186 172 … … 191 177 # So far, everything is good 192 178 #--------------------------------------------------- 193 printf "Status\nOK\n" > mesg_0 2_status_${CFG_USER}_${CFG_ARCH}.txt194 printf "Step......................\nCode is reliable\n" | tee mesg_0 3_step_${CFG_USER}_${CFG_ARCH}.txt179 printf "Status\nOK\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt 180 printf "Step......................\nCode is reliable\n" | tee mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt 195 181 196 182 -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
r5355 r5383 1 1 #!/bin/bash 2 2 3 function mesg_make { 3 4 diff_nc() { 5 stat=100; file1=$1; file2=$2 6 7 cdo diffv $file1 $file2 > out_tmp 8 ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 'records differ' out_tmp | awk -Fof '{print $1}' ) 9 [ -f out_tmp ] && rm out_tmp 10 11 return $stat 12 } 13 14 diff_restart() { 15 last_time_step=$( cat ${REFE_DIR}/time.step ) 16 result_final=0 17 18 echo 'Last time step: '${last_time_step} 19 20 for file in restart restart_ice restart_trc; do 21 printf ${TEST_DIR}'/*'${last_time_step}'_'${file}'.nc: ' 22 23 if [ $( find ${TEST_DIR} -name *${last_time_step}_$file.nc ) ]; then 24 ${NEMO_RBDN} -t $NPROC ${TEST_CONF} $(( ${last_time_step} + 1 )) 25 result=$( diff_nc ${TEST_DIR}/*${last_time_step}_$file.nc ${REFE_DIR}/*${last_time_step}_$file.nc ) 26 printf "cdo diffv $result\n" 27 (( result_final = result_final + result )) 28 else 29 printf "no restart files found for comparison\n" 30 fi 31 32 done 33 34 return ${result_final} 35 } 36 37 get_rel() { 38 for rel in $CDO $COMPILER $MPI $NETCDF; do 39 arch_rel=$( echo $LOADEDMODULES | sed "s#.*$rel/\([^:]*\).*#\1#" ) 40 [ -z "${arch_rel}" ] && arch_rel=$( echo $PATH | sed "s#.*$rel/\([^/]*\).*#\1#" ) 41 # [ $( echo $rel | grep $COMPILER ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' >/dev/null ) 42 echo $rel ${arch_rel} >> model.log 43 done 44 } 45 46 get_rev() { 47 rev=0 48 49 for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \ 50 ${NEMO_EFCM} ${NEMO_TRUS} ${NEMO_TCMP} ${NEMO_TRBD} ; do 51 # For time being, just get revision number from XIOS 52 [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue 53 ${SVN_CMD} $dir 54 rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 55 (( ${rev_loc} >= $rev )) && rev=${rev_loc} 56 done 57 58 echo 'NEMO '$rev >> model.log 59 } 60 61 mesg_make() { 4 62 paste -d ';' mesg_*_${CFG_USER}_${CFG_ARCH}.txt > trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt 5 63 cat trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt 6 64 } 7 65 8 #============================================= 9 function mesg_publish { 66 mesg_publish() { 10 67 11 68 if [ $PUBLISH -eq 1 ]; then … … 43 100 44 101 fi 45 46 102 } 47 103 48 #============================================= 49 function get_out { 104 get_out() { 50 105 cd ${TEST_DIR} 51 106 mesg_make; mesg_publish … … 58 113 exit 59 114 } 60 61 #=============================================62 function diff_nc {63 stat=100; file1=$1; file2=$264 65 cdo diffv $file1 $file2 > out_tmp66 ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 'records differ' out_tmp | awk -Fof '{print $1}' )67 [ -f out_tmp ] && rm out_tmp68 69 return $stat70 }71 72 #---------------------------------------------73 function diff_restart {74 last_time_step=$( cat ${REFE_DIR}/time.step )75 result_final=076 77 echo 'Last time step: '${last_time_step}78 79 if [ $( find ${REFE_DIR} -name *restart*_${last_time_step}.nc ) ]; then80 81 for file in find ${REFE_DIR} -name *restart*_${last_time_step}.nc; do82 echo ${TEST_DIR}'/*'${file}'_'${last_time_step}'.nc: '83 result=$( diff_nc $file )84 printf "diffnc $result\n"85 (( result_final = result_final + result ))86 done87 88 else89 echo 'No restart files found for comparison'90 fi91 92 return ${result_final}93 }
Note: See TracChangeset
for help on using the changeset viewer.