Changeset 873


Ignore:
Timestamp:
06/11/13 14:59:11 (11 years ago)
Author:
sdipsl
Message:
  • Send message related to end of job and end of simulation
File:
1 edited

Legend:

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

    r862 r873  
    11841184  echo 
    11851185 
     1186  if ( $DEBUG_debug ) ; then 
     1187    # Inform the rabbitMQ queue 
     1188 
     1189    # TO BE A FUNCTION BEGIN # 
     1190 
     1191    if [ X${ActivateBigBro} = Xtrue ] ; then 
     1192      # Only cosmetics 
     1193      decal=0 
     1194      while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 
     1195        printf ' ' >> ${StackFileLocation}/stack 
     1196        (( decal = decal + 1 )) 
     1197      done 
     1198      # RabbitMQ message 
     1199      code=1100 
     1200      # 
     1201      Body=$( echo "{\"code\":\"${code}\",\"simuid\":\"${simuid}\",\"jobid\":\"${jobid}\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T" )\"}" ) 
     1202      encodedBody=$( echo "${Body}" | base64 -w 0 ) 
     1203      # 
     1204      #sendAMQPMsg -h localhost -p 5672 -f ${SUBMIT_DIR}/config.card -b ${encodedBody} 
     1205      echo sendAMQPMsg -h localhost -p 5672 -b "${Body}"      >> ${StackFileLocation}/stack 
     1206      echo sendAMQPMsg -h localhost -p 5672 -b ${encodedBody} >> /tmp/send.AMQP.${jobid}.history.txt 
     1207      sendAMQPMsg -h localhost -p 5672 -b ${encodedBody} 
     1208      status=$? 
     1209      if [ ${status} -gt 0 ] ; then 
     1210        IGCM_debug_Print 2 "IGCM_debug_PopStack : command sendAMQPMsg failed error code ${status}" 
     1211        echo  sendAMQPMsg -h localhost -p 5672 -b "${Body}" 
     1212        exit 
     1213      fi 
     1214    fi 
     1215 
     1216    # TO BE A FUNCTION END # 
     1217 
     1218  fi 
     1219 
    11861220  if [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ; then 
    11871221    #==========================# 
     
    11951229    IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Completed" 
    11961230    IGCM_debug_Print 1 "Normal End of computation." 
     1231 
    11971232    if ( $DEBUG_debug ) ; then 
     1233      # Inform the rabbitMQ queue 
     1234 
     1235      # TO BE A FUNCTION BEGIN # 
     1236 
     1237      if [ X${ActivateBigBro} = Xtrue ] ; then 
     1238        # Only cosmetics 
     1239        decal=0 
     1240        while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do 
     1241          printf ' ' >> ${StackFileLocation}/stack 
     1242          (( decal = decal + 1 )) 
     1243        done 
     1244        # RabbitMQ message 
     1245        code=0100 
     1246        # 
     1247        Body=$( echo "{\"code\":\"${code}\",\"simuid\":\"${simuid}\",\"jobid\":\"${jobid}\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T" )\"}" ) 
     1248        encodedBody=$( echo "${Body}" | base64 -w 0 ) 
     1249        # 
     1250        #sendAMQPMsg -h localhost -p 5672 -f ${SUBMIT_DIR}/config.card -b ${encodedBody} 
     1251        echo sendAMQPMsg -h localhost -p 5672 -b "${Body}"      >> ${StackFileLocation}/stack 
     1252        echo sendAMQPMsg -h localhost -p 5672 -b ${encodedBody} >> /tmp/send.AMQP.${jobid}.history.txt 
     1253        sendAMQPMsg -h localhost -p 5672 -b ${encodedBody} 
     1254        status=$? 
     1255        if [ ${status} -gt 0 ] ; then 
     1256          IGCM_debug_Print 2 "IGCM_debug_PopStack : command sendAMQPMsg failed error code ${status}" 
     1257          echo  sendAMQPMsg -h localhost -p 5672 -b "${Body}" 
     1258          exit 
     1259        fi 
     1260      fi 
     1261 
     1262      # TO BE A FUNCTION END # 
     1263 
    11981264      echo 
    11991265      IGCM_debug_Print 1 "Your files on ${R_SAVE} :" 
Note: See TracChangeset for help on using the changeset viewer.