Changeset 1115
- Timestamp:
- 10/23/14 19:19:12 (10 years ago)
- Location:
- trunk/libIGCM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r1110 r1115 153 153 if ( [ X${config_Post_DodsCopy} = X${NULL_STR} ] || [ X${config_Post_DodsCopy} = X ] ) ; then 154 154 config_Post_DodsCopy=TRUE 155 fi 156 157 #==================================================== 158 # Define StackFileLocation : directory where we store stack files 159 # Define StackFileName : stack file containing call tree and instrumentation 160 # Stack file containing call tree will be stored there. 161 if ( $DEBUG_debug ) ; then 162 StackFileLocation=${StackFileLocation:=${R_BUF_KSH}} 163 [ ! -d ${StackFileLocation} ] && mkdir -p ${StackFileLocation} 164 if [ X${TaskType} = Xcomputing ]; then 165 StackFileName=computing.stack.$$ 166 elif [ X${TaskType} = Xpost-processing ]; then 167 StackFileName=${Script_Post_Output}.stack.$$ 168 elif [ X${TaskType} = Xchecking ]; then 169 StackFileName=checking.stack.$$ 170 else 171 IGCM_debug_Exit "IGCM_config_CommonConfiguration unknown TaskType : ${TaskType}" 172 IGCM_debug_Verif_Exit 173 fi 174 175 # This boolean will trigger the filling of the stack 176 # Only now we know where things should be ... 177 ActivateStackFilling=true 155 178 fi 156 179 -
trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
r1109 r1115 30 30 # GENERATE RANDOM ERROR ; only apply if ( ${DEBUG_debug} ) 31 31 typeset RandomError=false 32 33 # Stack file containing call tree will be stored there.34 if ( $DEBUG_debug ) ; then35 if [ X${TaskType} = Xcomputing ]; then36 typeset StackFileLocation=${StackFileLocation:=${PWD}/STACK}37 typeset StackFileName=computing.stack.$$38 [ ! -d ${StackFileLocation} ] && mkdir -p ${StackFileLocation}39 elif [ X${TaskType} = Xpost-processing ]; then40 typeset StackFileLocation=${POST_DIR:=${StackFileLocation}}41 typeset StackFileName=post-processing.stack.$$42 elif [ X${TaskType} = Xchecking ]; then43 typeset StackFileLocation=${POST_DIR:=${PWD}}44 typeset StackFileName=checking.stack.$$45 else46 typeset StackFileLocation=${POST_DIR:=${PWD}}47 typeset StackFileName=checking.stack.$$48 fi49 50 if [ -f ${StackFileLocation}/${StackFileName} ] ;51 then52 echo "Stack of an libIGCM job :" >> ${StackFileLocation}/${StackFileName}53 else54 echo "Stack of an libIGCM job :" > ${StackFileLocation}/${StackFileName}55 fi56 fi57 32 58 33 #================================================== … … 229 204 230 205 # Only cosmetics : stack file 231 decal=0 232 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 233 printf ' ' >> ${StackFileLocation}/${StackFileName} 234 (( decal = decal + 1 )) 235 done 236 # Log to stack file using human readable format 237 echo "${Body}" >> ${StackFileLocation}/${StackFileName} 206 if [ X${ActivateStackFilling} = Xtrue ] ; then 207 decal=0 208 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 209 printf ' ' >> ${StackFileLocation}/${StackFileName} 210 (( decal = decal + 1 )) 211 done 212 # Log to stack file using human readable format 213 echo "${Body}" >> ${StackFileLocation}/${StackFileName} 214 fi 238 215 239 216 # Log separately encoded AMQP message command for reuse in a mock up … … 286 263 287 264 # Only cosmetics : stack file 288 echo >> ${StackFileLocation}/${StackFileName} 289 decal=0 290 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 291 printf ' ' >> ${StackFileLocation}/${StackFileName} 292 (( decal = decal + 1 )) 293 done 294 295 # Fill the stack file 296 echo "> ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 265 if [ X${ActivateStackFilling} = Xtrue ] ; then 266 echo >> ${StackFileLocation}/${StackFileName} 267 decal=0 268 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 269 printf ' ' >> ${StackFileLocation}/${StackFileName} 270 (( decal = decal + 1 )) 271 done 272 273 # Fill the stack file 274 echo "> ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 275 fi 297 276 298 277 # Save input list in an indexed array … … 351 330 if [ $((RANDOM%10000)) -le 10 ] ; then 352 331 IGCM_debug_Print 1 "Random error has been triggered" 353 echo "RANDOM ERROR" >> ${StackFileLocation}/${StackFileName} 332 if [ X${ActivateStackFilling} = Xtrue ] ; then 333 echo "RANDOM ERROR" >> ${StackFileLocation}/${StackFileName} 334 fi 354 335 ExitFlag=true 355 336 fi … … 503 484 504 485 # Only cosmetics : stack file 505 decal=0 506 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 507 printf ' ' >> ${StackFileLocation}/${StackFileName} 508 (( decal = decal + 1 )) 509 done 486 if [ X${ActivateStackFilling} = Xtrue ] ; then 487 decal=0 488 while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 489 printf ' ' >> ${StackFileLocation}/${StackFileName} 490 (( decal = decal + 1 )) 491 done 492 fi 510 493 511 494 if ( ${ExitFlag} ) ; then 512 495 # Inform the stack file 513 echo '!!! ExitFlag has been activated !!!' >> ${StackFileLocation}/${StackFileName} 496 if [ X${ActivateStackFilling} = Xtrue ] ; then 497 echo '!!! ExitFlag has been activated !!!' >> ${StackFileLocation}/${StackFileName} 498 fi 514 499 515 500 if [ X${ActivateBigBro} = Xtrue ] ; then … … 523 508 else 524 509 # Inform the stack file 525 echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 510 if [ X${ActivateStackFilling} = Xtrue ] ; then 511 echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 512 fi 513 526 514 if [ X${ActivateBigBro} = Xtrue ] ; then 527 515 # RabbitMQ message code "POPSTACK" … … 780 768 instrumentationContent=$( echo "\"actionName\":\"${actionType}\",\"size_Mo\":\"${entitySizeMo}\",\"duration_ms\":\"${diff_ms}\",\"throughput_Mo_s\":\"${flux_Mo_s}\",\"dirFrom\":\"${dirFrom}\",\"dirTo\":\"${dirTo}\"" ) 781 769 782 echo "{${instrumentationContent}}" 770 if [ X${ActivateStackFilling} = Xtrue ] ; then 771 echo "{${instrumentationContent}}" >> ${StackFileLocation}/${StackFileName} 772 fi 783 773 784 774 # Inform the rabbitMQ queue
Note: See TracChangeset
for help on using the changeset viewer.