Changeset 1150


Ignore:
Timestamp:
01/13/15 19:20:09 (9 years ago)
Author:
sdipsl
Message:

adressing #242
message 2000 and 3000 (pushstack and popstack) has been turned off for the moment to ease downstream processing

Location:
trunk/libIGCM
Files:
7 edited

Legend:

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

    r1127 r1150  
    9595  # Define STORAGE : Dedicated to small/medium files 
    9696  # Define R_OUT   : Output tree located on ARCHIVE 
     97  # Define R_BUF   : Output tree located on STORAGE (files waiting treatment, or file lcoation when SpaceName=!PROD) 
    9798  # Define R_FIG   : Output tree located on STORAGE hosting figures (monitoring and atlas, and/or small files) 
    98   # Define R_BUF   : USELESS and DEPRECATED output tree. 
     99  # Define R_TMP   : A temporary space used by IGCM_debug_send_AMQP_msg__MAILTUNNEL. Must be persistent in between jobs 
    99100  IGCM_sys_defineArchives 
    100101 
     
    12621263      fi 
    12631264    fi 
     1265 
     1266    # To be sure we flush message buffer and clean up behind us before the end of the simulation 
     1267    FlushAMQP=TRUE 
     1268 
    12641269  else 
    12651270    #=================# 
     
    13071312  fi 
    13081313 
    1309   # To be sure we flush message buffer before exiting the job 
    1310   FlushAMQP=TRUE 
    1311  
    13121314  IGCM_debug_PopStack "IGCM_config_Finalize" 
    13131315} 
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1140 r1150  
    131131  b64_encoded_msg=$1 
    132132 
    133   # R_TMP point to RUN_DIR_PATH on Ada and on /tmp otherwise 
    134   buffer=${R_TMP}/buffer.$$ 
    135133  mail_recipient="superviseur@ipsl.jussieu.fr" 
    136134  send_messages=0 
    137135  mail_frequency=3600 # in seconds 
    138136  # use to keep track when was last mail sent (maybe to be replaced with global variable) 
    139   last_mail_date__file=${R_TMP}/stamp.$$ 
     137  last_mail_date__file=${R_BUF}/.stamp.${config_UserChoices_TagName}.${config_UserChoices_JobName} 
     138  # use to accumulate messages before sending them 
     139  buffer=${R_BUF}/.buffer.${config_UserChoices_TagName}.${config_UserChoices_JobName} 
    140140 
    141141  # init 
    142142  if [ ! -f "${buffer}" ]; then 
    143     touch "${buffer}" 
    144   fi 
    145  
    146   # retrieve pending messages number 
    147   messages_count=$( wc -l ${buffer} | gawk {'print $1'} ) 
     143    touch ${buffer} 
     144  fi 
    148145 
    149146  if [ ! -f "${last_mail_date__file}" ]; then 
    150     # if we are here, it means no mail has been sent yet 
    151     # send the first mail 
    152     [ ${messages_count} -gt 0 ] && send_messages=1 
     147    touch ${last_mail_date__file} 
    153148  else 
    154      # compute last time the file was changed (in seconds) 
     149    # compute last time the file was changed (in seconds) 
    155150    seconds_since_last_mail=$(( $(date +%s) - $(stat -c %Y ${last_mail_date__file}) )) 
    156151    # send message when exceeding threshold 
     
    169164    touch ${last_mail_date__file}                                      # memorize last mail date 
    170165    initBigBro=false 
    171   elif ( [ ${send_messages} -eq 1 ] || [ X${FlushAMQP} = XTRUE ] ) ; then 
     166  elif [ ${send_messages} -eq 1 ] ; then 
    172167    #echo $(date +"%Y-%m-%dT%H:%M:%S.%N%z") >> ${SUBMIT_DIR}/mail.txt 
    173168    mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient}  < ${buffer} # send buffer 
    174     rm -f $buffer ; touch ${buffer}                                    # clear buffer 
     169    rm -f ${buffer} ; touch ${buffer}                                  # flush the buffer 
    175170    touch ${last_mail_date__file}                                      # memorize last mail date 
     171  fi 
     172 
     173  if [ X${FlushAMQP} = XTRUE ] ; then 
     174    mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient}  < ${buffer} # send buffer 
     175    rm -f ${buffer}                                                    # cleaning behind us 
     176    rm -f ${last_mail_date__file}                                      # cleaning behind us 
    176177  fi 
    177178 
     
    297298    fi 
    298299 
    299     if [ X${ActivateBigBro} = Xtrue ] ; then 
    300       # RabbitMQ message code "PUSHSTACK" 
    301       code=2000 
    302       # RabbitMQ message body 
    303       Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${IGCM_debug_Stack[0]}\",\"arguments\":[\"${IGCM_debug_StackArgs[0]}\"],\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    304       # Fill the rabbitMQ queue 
    305       IGCM_debug_sendAMQP 
    306     fi 
     300    # Unplugged message 2000 handling for now. To ease downstream treatment. 
     301    #if [ X${ActivateBigBro} = Xtrue ] ; then 
     302    #  # RabbitMQ message code "PUSHSTACK" 
     303    #  code=2000 
     304    #  # RabbitMQ message body 
     305    #  Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${IGCM_debug_Stack[0]}\",\"arguments\":[\"${IGCM_debug_StackArgs[0]}\"],\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     306    #  # Fill the rabbitMQ queue 
     307    #  IGCM_debug_sendAMQP 
     308    #fi 
    307309 
    308310    # Increment LenStack 
     
    513515      fi 
    514516 
    515       if [ X${ActivateBigBro} = Xtrue ] ; then 
    516         # RabbitMQ message code "POPSTACK" 
    517         code=3000 
    518         # RabbitMQ message body 
    519         Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    520         # Fill the rabbitMQ queue 
    521         IGCM_debug_sendAMQP 
    522       fi 
     517      # Unplugged message 3000 handling for now. To ease downstream treatment. 
     518      #if [ X${ActivateBigBro} = Xtrue ] ; then 
     519      #  # RabbitMQ message code "POPSTACK" 
     520      #  code=3000 
     521      #  # RabbitMQ message body 
     522      #  Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     523      #  # Fill the rabbitMQ queue 
     524      #  IGCM_debug_sendAMQP 
     525      #fi 
    523526    fi 
    524527 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh

    r1148 r1150  
    211211  #- R_BUF (ONLY FOR double copy an scratch) 
    212212  R_BUF=${WORKDIR}/IGCM_OUT 
    213  
    214   #==================================================== 
    215   #- R_TMP (point a space acting as /tmp) 
    216   R_TMP=${RUN_DIR_PATH} 
    217213 
    218214  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r1147 r1150  
    245245  #- R_BUF (ONLY FOR double copy an scratch) 
    246246  R_BUF=${SCRATCHDIR}/IGCM_OUT 
    247  
    248   #==================================================== 
    249   #- R_TMP (point a space acting as /tmp) 
    250   R_TMP=/tmp 
    251247 
    252248  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r1147 r1150  
    188188  #- R_BUF (ONLY FOR double copy an scratch) 
    189189  R_BUF=${STORAGE}/IGCM_OUT 
    190  
    191   #==================================================== 
    192   #- R_TMP (point a space acting as /tmp) 
    193   R_TMP=/tmp 
    194190 
    195191  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh

    r1147 r1150  
    196196  #- R_BUF (ONLY FOR double copy an scratch) 
    197197  R_BUF=${WORKDIR}/IGCM_OUT 
    198  
    199   #==================================================== 
    200   #- R_TMP (point a space acting as /tmp) 
    201   R_TMP=/tmp 
    202198 
    203199  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r1147 r1150  
    198198  #- R_BUF (ONLY FOR double copy an scratch) 
    199199  R_BUF=${STORAGE}/IGCM_OUT 
    200  
    201   #==================================================== 
    202   #- R_TMP (point a space acting as /tmp) 
    203   R_TMP=/tmp 
    204200 
    205201  IGCM_debug_Print 1 "R_OUT has been defined = ${R_OUT}" 
Note: See TracChangeset for help on using the changeset viewer.