Changeset 5465
- Timestamp:
- 2015-06-22T23:10:50+02:00 (9 years ago)
- 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 63 63 print_step 'Compiling XIOS' 64 64 cd ${DIR_XIOS} 65 #./make_xios --full --arch $ARCH -job $NPROC #>& /dev/null65 #./make_xios --full --arch $ARCH -job $NPROC >& /dev/null 66 66 [ ! -e ${DIR_XIOS}/lib/libxios.a ] && get_out $STATUS $STEP 67 67 68 68 # NEMO config compiled from scratch 69 69 #--------------------------------------------------- 70 print_step "Compiling ${ CONF_REF} configuration"70 print_step "Compiling ${REFE_CONF} configuration" 71 71 cd ${NEMO_CONF} 72 72 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean 73 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC #>& /dev/null73 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null 74 74 [ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $STATUS $STEP 75 75 76 76 # Get namelists, xml & forced files for running 77 77 #--------------------------------------------------- 78 print_step "Preparing job by copying ${ CONF_REF} input files"78 print_step "Preparing job by copying ${REFE_CONF} input files" 79 79 cd ${TEST_DIR} 80 80 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \; … … 105 105 fi 106 106 107 STATUS='OK' 107 108 # Inspect output text files 108 109 #--------------------------------------------------- 109 110 print_step 'Test ASCII output files diff' 110 111 diff_textfiles 112 if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP 111 113 112 114 # Inspect output NetCDF files … … 114 116 print_step 'Test last restart NetCDF files diff' 115 117 diff_restart 118 if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP 116 119 117 120 # Get computation duration … … 126 129 # End 127 130 #--------------------------------------------------- 128 [ $STATUS== 'OK' ] && STEP='Code is reliable'131 [ "$STATUS" == 'OK' ] && STEP='Code is reliable' 129 132 get_out $STATUS $STEP -
branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
r5464 r5465 5 5 state=$1 6 6 7 if [ $state== 'E R R O R' ]; then7 if [ "$state" == 'E R R O R' ]; then 8 8 if [ -e ocean.output ]; then 9 9 last_time_step=$( cat ${TEST_DIR}/time.step | tr -d [:space:] ) … … 20 20 fi 21 21 22 printf "Comments\n$line\n" | tee mesg_1 0_comments_${CFG_USER}_${CFG_ARCH}.txt22 printf "Comments\n$line\n" | tee mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt 23 23 } 24 24 … … 26 26 # Portability ! 27 27 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}.txt28 printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt 29 29 } 30 30 … … 48 48 done 49 49 50 printf "Input files\n$mesg\n" | tee mesg_0 8_inputfiles_${CFG_USER}_${CFG_ARCH}.txt50 printf "Input files\n$mesg\n" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt 51 51 } 52 52 … … 60 60 61 61 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}' ) 65 65 if [ ${nb_dom} -gt 1 ]; then 66 ${NEMO_TRBD}/rebuild_nemo -t $NPROC $ {base_name}_$comp${nb_dom} > /dev/null66 ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom} > /dev/null 67 67 fi 68 68 69 69 # 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/null71 if [ $? -ne 0]; then72 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" 74 74 else 75 75 printf "identical\n" … … 80 80 81 81 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' 83 83 printf "no restart files found for comparison\n" 84 84 fi … … 89 89 for file in ocean.output $( ls *.stat ); do 90 90 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' 92 92 done 93 93 } … … 97 97 arch_rel=$( echo $LOADEDMODULES | sed "s#.*$rel/\([^:]*\).*#\1#" ) 98 98 [ -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.]* ' ) 100 100 echo $rel ${arch_rel} >> model.log 101 101 done 102 102 103 sed -n 4p model.log | sed 'i\Compiler' > mesg_0 5_compiler_${CFG_USER}_${CFG_ARCH}.txt104 sed -n 5p model.log | sed 'i\MPI libs' > mesg_0 6_mpi_${CFG_USER}_${CFG_ARCH}.txt105 sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_0 7_netcdf_${CFG_USER}_${CFG_ARCH}.txt103 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 106 106 } 107 107 … … 125 125 126 126 # 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 129 131 continue 130 132 fi 131 133 132 ${svn_cmd} $dir134 echo ${svn_cmd} $dir': '$( ${svn_cmd} $dir ) 133 135 rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' ) 134 136 (( ${rev_loc} >= $rev )) && rev=${rev_loc} 135 137 done 136 138 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 139 144 } 140 145 … … 153 158 154 159 # Send mail only when FAILED 155 if [[ ! -z $EMAIL && $STATUS== 'FAILED' ]]; then160 if [[ ! -z $EMAIL && "$STATUS" == 'FAILED' ]]; then 156 161 cat << END_MAIL > trusting.mail 157 162 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX … … 159 164 160 165 The trusting sequence for ${CONF_REF} has failed at step: 161 `tail -n 1 ${TEST_DIR}/mesg_0 4_step_${CFG_USER}_${CFG_ARCH}.txt`166 `tail -n 1 ${TEST_DIR}/mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt` 162 167 Directory : ${TEST_DIR} 163 168 … … 180 185 181 186 get_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 182 198 mesg_make; mesg_publish 183 184 # Save tested configuration if trusting failed185 if [ $STATUS == 'FAILED' ]; then186 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}.txt189 #tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz *190 fi191 192 printf "Status\n$STATUS\n" > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt193 printf "Step.....\n$STEP\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt194 199 195 200 exit 1
Note: See TracChangeset
for help on using the changeset viewer.