Ignore:
Timestamp:
09/09/16 18:34:26 (8 years ago)
Author:
sdipsl
Message:
  • add a purge_simulation command. Will inform hermes to purge as well. see #206
File:
1 edited

Legend:

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

    r1354 r1355  
    206206 
    207207#D-#================================================================== 
     208#D-function IGCM_debug_sendAMQP_Purge 
     209#D- * Purpose: Take over AMQP C client using mail as a message recipient 
     210#D- * No argument : send a message indicating a simulation has been purged 
     211 
     212function IGCM_debug_sendAMQP_Purge { 
     213 
     214  typeset mail_recipient encodedBody 
     215  if [ X${ActivateBigBro} = Xtrue ] ; then 
     216    mail_recipient="superviseur@ipsl.jussieu.fr" 
     217    # Clea nup tag on server side 
     218    code=8888 
     219    # Usual AMQP message to route messages on server side 
     220    encodedBody=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" |  base64 -w 0 ) 
     221    # send mail 
     222 
     223    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_Purge" 
     224    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} 
     225  fi 
     226 
     227  # Allways all good for now. 
     228  return 0 
     229} 
     230 
     231#D-#================================================================== 
    208232#D-function IGCM_debug_sendAMQP_Metrics 
    209233#D- * Purpose: Take over AMQP C client using mail as a message recipient 
     
    226250      attachmentsOptions="-a ${metricsFile} ${attachmentsOptions}" 
    227251    done 
    228     IGCM_debug_Print 2 "IGCM_debug_sendAMQP_Metrics " 
     252    IGCM_debug_Print 2 "IGCM_debug_sendAMQP_Metrics" 
    229253    echo ${encodedBody}|mailx -s "[TEMPORARY AMQP CHANNEL]" ${attachmentsOptions} ${mail_recipient} 
    230254  fi 
     
    698722      # Fill the rabbitMQ queue 
    699723      IGCM_debug_sendAMQP 
     724 
     725    elif [ X${TaskType} = Xchecking ]; then 
     726      # retrieve this simulation's unique id 
     727      IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid 
     728      simuid=${run_Configuration_simuid} 
     729      # Using standard fields for message others than the first one. Still subject to change 
     730      genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"N\/A\"" ) 
    700731    fi 
    701732 
Note: See TracChangeset for help on using the changeset viewer.