Changeset 1076


Ignore:
Timestamp:
10/01/14 11:54:19 (10 years ago)
Author:
sdipsl
Message:
  • Have smaller message, except the very first one
  • stack files will go in ${SUBMIT_DIR}/STACK directory. Just for debug...
  • Comments and cosmetics
Location:
trunk/libIGCM
Files:
2 edited

Legend:

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

    r1057 r1076  
    12191219  echo 
    12201220 
    1221   if ( $DEBUG_debug ) ; then 
    1222     # Inform the rabbitMQ queue 
    1223     if [ X${ActivateBigBro} = Xtrue ] ; then 
    1224       # RabbitMQ message code 
    1225       code=1100 
    1226       # RabbitMQ message body 
    1227       Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    1228       # Fill the rabbitMQ queue 
    1229       IGCM_debug_sendAMQP 
    1230     fi 
    1231   fi 
    1232  
    12331221  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then 
    12341222    #==========================# 
     
    12451233    if ( $DEBUG_debug ) ; then 
    12461234      if [ X${ActivateBigBro} = Xtrue ] ; then 
    1247         # RabbitMQ message code 
     1235        # RabbitMQ message code "END OF SIMULATION" 
    12481236        code=0100 
    12491237        # RabbitMQ message body 
     
    12921280  [ X${JobType} = XRUN ] && IGCM_sys_RmRunDir -rf ${RUN_DIR_PATH} 
    12931281 
     1282  if ( $DEBUG_debug ) ; then 
     1283    # Inform the rabbitMQ queue 
     1284    if [ X${ActivateBigBro} = Xtrue ] ; then 
     1285      # RabbitMQ message code "WAITING" 
     1286      code=1100 
     1287      # RabbitMQ message body 
     1288      Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     1289      # Fill the rabbitMQ queue 
     1290      IGCM_debug_sendAMQP 
     1291    fi 
     1292  fi 
     1293 
    12941294  # To be sure we flush message buffer before exiting the job 
    12951295  FlushAMQP=TRUE 
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1072 r1076  
    3434if ( $DEBUG_debug ) ; then 
    3535  if [ X${TaskType} = Xcomputing ]; then 
    36     typeset StackFileLocation=${StackFileLocation:=${PWD}} 
     36    typeset StackFileLocation=${StackFileLocation:=${PWD}/STACK} 
    3737    typeset StackFileName=computing.stack.$$ 
     38    [ ! -d ${StackFileLocation} ] && mkdir -p ${StackFileLocation} 
    3839  elif [ X${TaskType} = Xpost-processing ]; then 
    3940    typeset StackFileLocation=${POST_DIR:=${StackFileLocation}} 
     
    150151 
    151152  typeset b64_encoded_msg mail_recipient 
    152   typeset buffer send_messages mail_frequency  
     153  typeset buffer send_messages mail_frequency 
    153154  typeset last_mail_date__file 
    154155 
     
    160161  mail_frequency=3600 # in seconds 
    161162  # use to keep track when was last mail sent (maybe to be replaced with global variable) 
    162   last_mail_date__file=/tmp/stamp.$$  
     163  last_mail_date__file=/tmp/stamp.$$ 
    163164 
    164165  # init 
     
    217218    # Prepare additionnal option 
    218219    additionnalOption="-f ${SUBMIT_DIR}/config.card.base64" 
    219     #  
     220    # 
    220221    initBigBro=true 
    221222  else 
     
    316317 
    317318    if [ X${ActivateBigBro} = Xtrue ] ; then 
    318       # RabbitMQ message code 
     319      # RabbitMQ message code "PUSHSTACK" 
    319320      code=2000 
    320321      # RabbitMQ message body 
     
    511512 
    512513      if [ X${ActivateBigBro} = Xtrue ] ; then 
    513         # RabbitMQ message code 
     514        # RabbitMQ message code "ERROR HAS BEEN TRIGGERED" 
    514515        code=9000 
    515516        # RabbitMQ message body 
     
    522523      echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 
    523524      if [ X${ActivateBigBro} = Xtrue ] ; then 
    524         # RabbitMQ message code 
     525        # RabbitMQ message code "POPSTACK" 
    525526        code=3000 
    526527        # RabbitMQ message body 
     
    564565    jobuid=$(uuidgen) 
    565566 
    566     # RabbitMQ message code 
    567567    if ( ${FirstInitialize} ) ; then 
     568      # RabbitMQ message code "BEGIN A SIMULATION" 
    568569      code=0000 
    569570      # create and persist a unique id for this simulation 
     
    574575      genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"activity\":\"IPSL\",\"name\":\"${config_UserChoices_JobName}\",\"cumulPeriod\":\"${CumulPeriod}\",\"experiment\":\"${config_UserChoices_ExperimentName}\",\"space\":\"${config_UserChoices_SpaceName}\",\"model\":\"${config_UserChoices_TagName}\",\"startDate\":\"${config_UserChoices_DateBegin}\",\"endDate\":\"${config_UserChoices_DateEnd}\",\"login\":\"${LOGIN}\",\"centre\":\"${CENTER}\",\"machine\":\"${MASTER}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 
    575576    else 
     577      # RabbitMQ message code "A NEW JOB IS RUNNING PART OF A SIMULATION" 
    576578      code=1000 
    577579      # 
    578       # retrieve this simulation's unique id  
     580      # retrieve this simulation's unique id 
    579581      IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid 
    580582      simuid=${config_Configuration_simuid} 
    581583 
    582       # Standard fields for message others than the first one. Still subject to change 
     584      # Using standard fields for message others than the first one. Still subject to change 
    583585      genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 
    584586    fi 
     
    586588    # RabbitMQ message body with specific fields associated message codes treated here 
    587589    Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    588     # Fill the rabbitMQ queue (specifying config.card must be send) 
     590 
     591    # Fill the rabbitMQ queue (the config.card in use will be sent) 
    589592    IGCM_debug_sendAMQP activate 
     593 
     594    # NOT VERY NICE BUT ... IT WORKS 
     595    # Be sure that the genericSimulationID will be small from now on 
     596    # Using standard fields for messages others than the first one. Still subject to change 
     597    genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 
    590598 
    591599    # Turn the flag on 
     
    630638 
    631639    if [ X${ActivateBigBro} = Xtrue ] ; then 
    632       # RabbitMQ message code 
     640      # RabbitMQ message code "EXIT THE JOBS BECAUSE ERROR(S) HAS BEEN TRIGGERED" 
    633641      code=9999 
    634642      # RabbitMQ message body 
Note: See TracChangeset for help on using the changeset viewer.