Ignore:
Timestamp:
10/23/14 19:19:12 (10 years ago)
Author:
sdipsl
Message:
  • stack files will go in /Out. see #230 Examples:
    • create_ts.19301231.2D.out
    • create_ts.19301231.2D.stack.$$
  • instrumentation information will only be within stack file see #231
  • plateform users should not worry about those stack files ...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1109 r1115  
    3030# GENERATE RANDOM ERROR ; only apply if ( ${DEBUG_debug} ) 
    3131typeset RandomError=false 
    32  
    33 # Stack file containing call tree will be stored there. 
    34 if ( $DEBUG_debug ) ; then 
    35   if [ X${TaskType} = Xcomputing ]; then 
    36     typeset StackFileLocation=${StackFileLocation:=${PWD}/STACK} 
    37     typeset StackFileName=computing.stack.$$ 
    38     [ ! -d ${StackFileLocation} ] && mkdir -p ${StackFileLocation} 
    39   elif [ X${TaskType} = Xpost-processing ]; then 
    40     typeset StackFileLocation=${POST_DIR:=${StackFileLocation}} 
    41     typeset StackFileName=post-processing.stack.$$ 
    42   elif [ X${TaskType} = Xchecking ]; then 
    43     typeset StackFileLocation=${POST_DIR:=${PWD}} 
    44     typeset StackFileName=checking.stack.$$ 
    45   else 
    46     typeset StackFileLocation=${POST_DIR:=${PWD}} 
    47     typeset StackFileName=checking.stack.$$ 
    48   fi 
    49  
    50   if [ -f ${StackFileLocation}/${StackFileName} ] ; 
    51   then 
    52     echo "Stack of an libIGCM job :" >> ${StackFileLocation}/${StackFileName} 
    53   else 
    54     echo "Stack of an libIGCM job :" >  ${StackFileLocation}/${StackFileName} 
    55   fi 
    56 fi 
    5732 
    5833#================================================== 
     
    229204 
    230205  # 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 
    238215 
    239216  # Log separately encoded AMQP message command for reuse in a mock up 
     
    286263 
    287264    # 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 
    297276 
    298277    # Save input list in an indexed array 
     
    351330      if [ $((RANDOM%10000)) -le 10 ] ; then 
    352331        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 
    354335        ExitFlag=true 
    355336      fi 
     
    503484 
    504485    # 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 
    510493 
    511494    if ( ${ExitFlag} ) ; then 
    512495      # 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 
    514499 
    515500      if [ X${ActivateBigBro} = Xtrue ] ; then 
     
    523508    else 
    524509      # 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 
    526514      if [ X${ActivateBigBro} = Xtrue ] ; then 
    527515        # RabbitMQ message code "POPSTACK" 
     
    780768  instrumentationContent=$( echo "\"actionName\":\"${actionType}\",\"size_Mo\":\"${entitySizeMo}\",\"duration_ms\":\"${diff_ms}\",\"throughput_Mo_s\":\"${flux_Mo_s}\",\"dirFrom\":\"${dirFrom}\",\"dirTo\":\"${dirTo}\"" ) 
    781769 
    782   echo "{${instrumentationContent}}" 
     770  if [ X${ActivateStackFilling} = Xtrue ] ; then 
     771    echo "{${instrumentationContent}}" >> ${StackFileLocation}/${StackFileName} 
     772  fi 
    783773 
    784774  # Inform the rabbitMQ queue 
Note: See TracChangeset for help on using the changeset viewer.