- Timestamp:
- 2015-11-26T16:55:09+01:00 (8 years ago)
- Location:
- branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh
r5923 r5929 90 90 [ $TRUS_HPCC == 'X64_ADA' ] && WRAPPER_LDFLAGS='-L/smplocal/pub/IdrMemMPI/1.4/lib -lidrmem '${WRAPPER_LDFLAGS} 91 91 92 for str in ${TRUS_CMP F} ${TRUS_MPIR} ${TRUS_CDFR} ${TRUS_CDOR}; do92 for str in ${TRUS_CMPV} ${TRUS_MPIR} ${TRUS_CDFR} ${TRUS_CDOR}; do 93 93 [ -z "$str" ] && continue 94 94 soft_rel='' … … 98 98 99 99 ## option --version would work for main compilers (gfortran, intel, pgfortran, ...) 100 [ $str == ${TRUS_CMP F} ] && soft_rel=$( $str --version | grep -m1 -oe '\<[0-9. ]*\>' )100 [ $str == ${TRUS_CMPV} ] && soft_rel=$( $str --version | grep -m1 -oe '\<[0-9. ]*\>' ) 101 101 102 102 ## Cleaning characters string to display proper soft name … … 116 116 117 117 get_inputs() { 118 # List archive content & extract it by default 119 local cmd_iol="tar -tvf ${TRUS_FORC}/${TRUS_TARF}" cmd_iof="tar -vxf ${TRUS_FORC}/${TRUS_TARF}" 120 121 ## List & copy files in case of personal inputs 122 if [ -z "${TRUS_TARF}" ]; then 123 cmd_iol="ls ${TRUS_FORC}/*" ; cmd_iof="\cp ${TRUS_FORC}/* ." 124 fi 125 126 ${cmd_iol} > inputs_list.txt 127 ${cmd_iof} > /dev/null 118 ## Extract archive or copy files in case of personal inputs 119 [ -z "${TRUS_TARF}" ] && get_io="cp ${TRUS_FORC}/* ." || get_io="tar -vxf ${TRUS_FORC}/${TRUS_TARF}" 120 121 ${get_io} > /dev/null 122 [ $? -ne 0 ] && get_out 3 || echo 'Success' 123 [ $( find -name '*.gz' -print -quit ) ] && gunzip *.gz 124 125 ls -lh > inputs_list.txt 128 126 } 129 127 … … 137 135 138 136 ## Continue even if input file is not in here (see after) 139 if [ -e ${TRUS_ BHMK}/$file ]; then dif=$( diff -q $file ${TRUS_BHMK}/$file ); else dif=0; fi137 if [ -e ${TRUS_STOR}/$file ]; then dif=$( diff -q $file ${TRUS_STOR}/$file ); else dif=0; fi 140 138 141 139 ## Pass over useless file omission in benckmark directory … … 180 178 for file in 'ocean.output' *.stat; do 181 179 ## Stop if no benchmark files (ocean.output, eventual stat files) 182 [ ! -e ${TRUS_ BHMK}/$file ] && { TRUS_RSLT='FAILED'; get_out 7; }183 184 diff -q $file ${TRUS_ BHMK}/$file180 [ ! -e ${TRUS_STOR}/$file ] && { TRUS_RSLT='FAILED'; get_out 7; } 181 182 diff -q $file ${TRUS_STOR}/$file 185 183 186 184 ## Continue even if it differs … … 200 198 201 199 ## Stop if no benchmark files (ie time.step) 202 [ ! -e ${TRUS_ BHMK}/time.step ] && { TRUS_RSLT='FAILED'; get_out 7; }203 time_step=$( cat ${TRUS_ BHMK}/time.step | tr -d [:space:] )200 [ ! -e ${TRUS_STOR}/time.step ] && { TRUS_RSLT='FAILED'; get_out 7; } 201 time_step=$( cat ${TRUS_STOR}/time.step | tr -d [:space:] ) 204 202 205 203 ## Find all restart files to rebuild … … 222 220 ${TRUS_NGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo -t ${TRUS_NPRO} $file ${nb_dom} \ 223 221 > /dev/null 224 [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc \225 > /dev/null226 222 elif [ ${nb_dom} -eq 0 ]; then 227 223 TRUS_RSLT='FAILED' && get_out 8 … … 232 228 233 229 ## Stop if no benchmark files (restart file) 234 if [ -e ${TRUS_ BHMK}/$file.nc ]; then230 if [ -e ${TRUS_STOR}/$file.nc ]; then 235 231 236 232 ## UNIX `cmp` not suitable (timestamp in .nc file) 237 dif=$( $TRUS_CDOD $file.nc ${TRUS_ BHMK}/$file.nc 2> /dev/null \233 dif=$( $TRUS_CDOD $file.nc ${TRUS_STOR}/$file.nc 2> /dev/null \ 238 234 | awk '/records/ {print $0}' | sed '2 s/^/,/' | tr -d '\n' ) 239 235 … … 325 321 326 322 ## Create or append trusting logfile 327 if [ -f ${TRUS_ BHMK}/trusting_$PATTERNAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi328 329 $cmd ${TRUS_FILE} \330 >> ${TRUS_ BHMK}/trusting_$PATTERNAME.txt323 if [ -f ${TRUS_STOR}/trusting_$PATTERNAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi 324 325 $cmd ${TRUS_FILE} \ 326 >> ${TRUS_STOR}/trusting_$PATTERNAME.txt 331 327 332 328 ## Send mail only when FAILED … … 347 343 ${TRUS_USER}.cfg & ${TRUS_HPCC}.cfg 348 344 349 For more details, look into the testing directoryat:350 ${TRUS_ TEST}345 For more details, look into the testing folder at: 346 ${TRUS_SCRA} 351 347 352 348 An archive has been created to share the questionable configuration for further studies: 353 ${TRUS_ BHMK}/${TRUS_ARCH}349 ${TRUS_STOR}/${TRUS_ARCH} 354 350 355 351 END_MAIL … … 371 367 372 368 ## In case of compilation error 373 cd ${TRUS_ TEST}369 cd ${TRUS_SCRA} 374 370 375 371 if [ ${TRUS_RSLT} == 'FAILED' ]; then … … 410 406 ## Save tested configuration if trusting failed in production mode (-p|--prod) 411 407 if [[ ${TRUS_RSLT} == 'FAILED' && ${TRUS_PROD} -eq 1 ]]; then 412 echo 'Creating archive '${TRUS_ARCH}' under '${TRUS_ BHMK}413 tar -czf ${TRUS_ BHMK}/${TRUS_ARCH} * \408 echo 'Creating archive '${TRUS_ARCH}' under '${TRUS_STOR} 409 tar -czf ${TRUS_STOR}/${TRUS_ARCH} * \ 414 410 -C ${TRUS_NGCM}/CONFIG/${TRUS_CONF}/MY_SRC . \ 415 411 -C ${TRUS_NGCM}/CONFIG/${TRUS_CONF} cpp_${TRUS_CONF}.fcm
Note: See TracChangeset
for help on using the changeset viewer.