- Timestamp:
- 2017-11-27T14:10:49+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh
r8808 r8818 53 53 54 54 ## Loop on essential NEMO directories 55 for dir in ${TRUST_SVN_CO} ${TRUST_ DIR_XIOS}; do55 for dir in ${TRUST_SVN_CO} ${TRUST_IO_XIOS}; do 56 56 57 57 ## For time being, just get revision from XIOS with no action on directory 58 if [ $dir == ${TRUST_ DIR_XIOS} ]; then58 if [ $dir == ${TRUST_IO_XIOS} ]; then 59 59 rev_loc=$( svn info $dir | awk '/Last Changed Rev/ {print $NF}' ) 60 60 echo 'XIOS '${rev_loc} \ 61 61 >> model.log 62 echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\"> \ 63 ${rev_loc} \ 64 </a>" \ 62 echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\">${rev_loc}</a>" 65 63 >> ${file_xios} 66 64 continue … … 77 75 echo 'NEMOGCM '$rev \ 78 76 >> model.log 79 echo "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\"> \ 80 $rev \ 81 </a> " \ 77 echo "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" 82 78 >> ${file_nemo} 83 79 } … … 91 87 for str in ${TRUST_COMPILE_FORTRAN} \ 92 88 ${TRUST_COMPILE_MPI} ${TRUST_COMPILE_NETCDF} \ 93 ${TRUST_ CDO}; do89 ${TRUST_IO_CDO} ; do 94 90 [ -z "$str" ] && continue 95 91 ver='' … … 99 95 100 96 ## option --version would work for main Fortran compilers and CDO 101 if [[ $str =~ ${TRUST_COMPILE_FORTRAN}|${TRUST_ CDO} ]]; then97 if [[ $str =~ ${TRUST_COMPILE_FORTRAN}|${TRUST_IO_CDO} ]]; then 102 98 ver=$( $str --version 2>&1 | grep -m1 -oe '\<[0-9. ]*\>' \ 103 99 | xargs echo $str ) … … 121 117 122 118 get_inputs() { 123 # List archive content & extract it by default119 # List archive content & extract it by default 124 120 local inputs_list=$( eval " 125 for archive in ${TRUST_CFG_FORC}; do126 tar -tvf ${TRUST_DIR_FORC}/\$archive >> inputs_list.txt;127 128 121 for archive in ${TRUST_IO_FORC_TAR}; do 122 tar -tvf ${TRUST_IO_FORC_PATH}/\$archive >> inputs_list.txt; 123 done 124 " ) 129 125 local inputs_get=$( eval " 130 for archive in ${TRUST_CFG_FORC}; do131 tar -vxf ${TRUST_DIR_FORC}/\$archive > /dev/null;132 133 134 126 for archive in ${TRUST_IO_FORC_TAR}; do 127 tar -vxf ${TRUST_IO_FORC_PATH}/\$archive > /dev/null; 128 done 129 " ) 130 135 131 ## List & copy files without archive 136 if [ -z "${TRUST_ CFG_FORC}" ]; then137 inputs_list=" ls -lh ${TRUST_DIR_FORC}/* >> inputs_list.txt"138 inputs_get=" \cp ${TRUST_DIR_FORC}/* . "132 if [ -z "${TRUST_IO_FORC_TAR}" ]; then 133 inputs_list=" ls -lh ${TRUST_IO_FORC_PATH}/* >> inputs_list.txt" 134 inputs_get=" \cp ${TRUST_IO_FORC_PATH}/* . " 139 135 fi 140 136 141 137 ${inputs_list}; ${inputs_get} 138 139 # for entry in ${TRUST_IO_FORC_PATH}; do 140 # 141 # If path to file (assuming it is an archive) 142 # if [ -e $entry ]; then 143 # tar -tvf $entry >> inputs_list.txt; 144 # tar -vxf $entry > /dev/null; 145 # If path to directory 146 # elif [ -d $entry ]; then 147 # inputs_list=" ls -lh ${TRUST_IO_FORC_PATH}/* >> inputs_list.txt" 148 # inputs_get=" \cp ${TRUST_IO_FORC_PATH}/* . " 149 # fi 150 151 # done 142 152 143 153 if [ $( find -name '*.gz' -print -quit ) ]; then … … 150 160 local files_list='' mesg='Same' 151 161 162 ################################### 163 ## Think of copying initial test ## 164 ################################### 165 152 166 ## Simple diff 153 for file in 'inputs_list.txt' *namelist_* *.xml cpp_*; do167 for file in cpp_* 'inputs_list.txt' *namelist_* *.xml; do 154 168 dif='' 155 169 156 170 ## Continue even if input file is not in here (see after) 157 if [ -e ${TRUST_ DIR_STORE}/$file ]; then158 dif=$( diff -q $file ${TRUST_ DIR_STORE}/$file )171 if [ -e ${TRUST_TEST_BENCHMARK}/$file ]; then 172 dif=$( diff -q $file ${TRUST_TEST_BENCHMARK}/$file ) 159 173 else 160 174 dif=0 … … 209 223 local files_list='' mesg='Same' 210 224 225 ################################### 226 ## Think of copying initial test ## 227 ################################### 228 211 229 ## Simple diff 212 230 for file in 'ocean.output' *.stat; do 213 231 ## Stop if no minimal benchmark files (ocean.output, eventual stat files) 214 if [ ! -e ${TRUST_DIR_STORE}/$file ]; then 215 TRUST_FLAG_RESULT='FAILED' 216 get_out 7 217 fi 218 219 diff -q $file ${TRUST_DIR_STORE}/$file 232 [ ! -e ${TRUST_TEST_BENCHMARK}/$file ] && get_out 7 233 234 diff -q $file ${TRUST_TEST_BENCHMARK}/$file 220 235 221 236 ## Continue even if it differs 222 if [ $? -ne 0 ]; then 223 TRUST_FLAG_RESULT='FAILED' 224 mesg='Different' 225 files_list+=$file' ' 226 fi 237 if [ $? -ne 0 ]; then mesg='Different'; files_list+=$file' '; fi 227 238 228 239 done … … 241 252 ## Find all restart files to rebuild 242 253 if [ $( find -regex ".*_restart.*[0-9]\.nc" -print -quit ) ]; then 243 ############################################################### #244 ## Think to set the conf giguration name in the 'namelist_cfg' ##245 ############################################################### #254 ############################################################### 255 ## Think to set the configuration name in the 'namelist_cfg' ## 256 ############################################################### 246 257 filebases=$( find -regextype sed -regex ".*${TRUST_CFG_NEW}.*_[0-9]\{4\}\.nc" \ 247 258 | sed 's/\(.*\)_.*/\1/' | sort -u ) … … 252 263 | wc -l | awk '{print $1}' ) 253 264 254 [ $ndomain -eq 0 ] && TRUST_FLAG_RESULT='FAILED' && get_out 8 265 [ $ndomain -eq 0 ] && get_out X 266 267 ##################################################### 268 ## Handle 2 possibilities of 'rebuild_nemo' origin ## 269 ##################################################### 255 270 256 271 ${TRUST_DIR_NEMOGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo \ … … 259 274 260 275 ## Possibility of remaining decomposed restarts (even after rebuild) 261 [ $? -eq 0 ] && rm -f ${filebase}_[0-9]*.nc \ 262 > /dev/null 276 if [ $? -eq 0 ]; then 277 rm -f ${filebase}_[0-9]*.nc \ 278 > /dev/null 279 else 280 get_out X 281 fi 263 282 264 283 ## Stop if no benchmark files (restart file) 265 if [ -e ${TRUST_ DIR_STORE}/$filebase.nc ]; then284 if [ -e ${TRUST_TEST_BENCHMARK}/$filebase.nc ]; then 266 285 267 286 #bcmk='true' 268 cdo diffn $filebase.nc ${TRUST_ DIR_STORE}/$filebase.nc \287 cdo diffn $filebase.nc ${TRUST_TEST_BENCHMARK}/$filebase.nc \ 269 288 > cdo_diff.out 2> /dev/null 270 289 … … 275 294 276 295 if [ -n "$dif" ]; then 277 export TRUST_FLAG_RESULT='FAILED'278 296 files_list+=$filebase' ' && echo $filebase'.nc: '$dif 279 297 let dif_sum+=$( echo $dif | sed '|^\([0-9]*\).*|\1|' ) … … 283 301 284 302 done 285 286 ## No benchmark files287 #if [ $bcmk == 'false' ]; then288 # TRUST_FLAG_RESULT='FAILED'289 # get_out 7290 #fi291 303 292 304 ## List modified restart(s) for web comment with sum of differences … … 384 396 385 397 For more details, look into the testing folder at: 386 ${TRUST_ DIR_SCRATCH}398 ${TRUST_TEST_DIR} 387 399 An archive is also available to share the questionable configuration: 388 ${TRUST_ DIR_STORE}/${TRUST_TEST_BACKUP}400 ${TRUST_TEST_BENCHMARK}/${TRUST_TEST_BACKUP} 389 401 390 402 END_MAIL … … 392 404 ## Send with detailed subject 393 405 mail -s "[NEMO Trusting][${TRUST_CFG_REF}][${TRUST_SVN_BRANCH}] \ 394 ${TRUST_FLAG_RESULT} ${TRUST_FLAG_ERROR}" 395 ${TRUST_TEST_MAILING} \406 ${TRUST_FLAG_RESULT} ${TRUST_FLAG_ERROR}" \ 407 ${TRUST_TEST_MAILING} \ 396 408 < trusting.mail 397 409 fi … … 408 420 409 421 ## In case of compilation error 410 cd ${TRUST_ DIR_SCRATCH}422 cd ${TRUST_TEST_DIR} 411 423 412 424 if [ ${TRUST_FLAG_RESULT} == 'FAILED' ]; then … … 455 467 ## Save tested configuration if trusting failed in production mode (-p|--prod) 456 468 if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} -eq 1 ]]; then 457 echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_ DIR_STORE}458 tar -czf ${TRUST_ DIR_STORE}/${TRUST_TEST_BACKUP} * \469 echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_TEST_BENCHMARK} 470 tar -czf ${TRUST_TEST_BENCHMARK}/${TRUST_TEST_BACKUP} * \ 459 471 -C ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/MY_SRC . \ 460 472 -C ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW} \
Note: See TracChangeset
for help on using the changeset viewer.