Changeset 1051
- Timestamp:
- 09/11/14 16:19:05 (10 years ago)
- Location:
- trunk/libIGCM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/AA_job
r1036 r1051 166 166 #D- 167 167 #D--------------------------------------------------------------------== 168 #D- 0. SYSTEM ENVIRONMENT169 #D- - Define variables for Number of processors170 #D- - Define MPI variables171 #D- - Define batch scheduler variables172 #D- - Source IGCM Library173 #D- - Get RESOLution in .resol file (temporary)168 #D- 0.0 SYSTEM ENVIRONMENT 169 #D- - Define variables for Number of processors 170 #D- - Define MPI variables 171 #D- - Define batch scheduler variables 172 #D- - Source IGCM Library 173 #D- - Get RESOLution in .resol file (temporary) 174 174 #D--------------------------------------------------------------------== 175 175 … … 200 200 #D- 201 201 #D--------------------------------------------------------------------== 202 #D- 0.1 COMMON ENVIRONMENT 203 #D- - Read libIGCM compatibility version in config.card 204 #D- - Read UserChoices section 205 #D- - Read Ensemble section 206 #D- - Read Post section 207 #D- - Define all netcdf output directories 208 #D--------------------------------------------------------------------== 209 IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card 210 211 # ------------------------------------------------------------------ 212 # Activate BigBrother so as to supervise this simulation 213 # ------------------------------------------------------------------ 214 IGCM_debug_ActivateBigBro 215 216 #D- 217 #D--------------------------------------------------------------------== 202 218 #D- 1. INITIALIZE CONFIGURATION 203 219 #D- - Simulation configuration … … 207 223 #D- - Read or initialize CumulPeriod 208 224 #D- - run.card 209 #D-------------------------------------------------------------------- -==225 #D--------------------------------------------------------------------== 210 226 IGCM_config_Initialize 211 227 … … 248 264 # ------------------------------------------------------------------ 249 265 IGCM_debug_Verif_Exit 250 251 # ------------------------------------------------------------------252 # Activate BigBrother so as to supervise this simulation253 # ------------------------------------------------------------------254 IGCM_debug_ActivateBigBro255 266 256 267 #D- -
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r1049 r1051 176 176 ls -lta ${SUBMIT_DIR} 177 177 fi 178 179 #==================================180 # Read libIGCM compatibility version in config.card181 # Read UserChoices section182 # Read Ensemble section183 # Read Post section184 # Define all netcdf output directories185 #==================================186 IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card187 178 188 179 #================================== … … 1241 1232 code=1100 1242 1233 # RabbitMQ message body 1243 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )1234 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 1244 1235 # Fill the rabbitMQ queue 1245 1236 IGCM_debug_sendAMQP … … 1264 1255 code=0100 1265 1256 # RabbitMQ message body 1266 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"OK\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )1257 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 1267 1258 # Fill the rabbitMQ queue 1268 1259 IGCM_debug_sendAMQP -
trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
r1050 r1051 145 145 #D- * Purpose: Take over AMQP C client using mail as a message recipient 146 146 #D- * One argument : base64 encoded message 147 #D- * Attach encoded config.card when starting the simulation 148 147 149 function IGCM_debug_send_AMQP_msg__MAILTUNNEL { 148 150 … … 183 185 184 186 # send mail 185 if ( [ ${send_messages} -eq 1 ] || [ X${FlushAMQP} = XTRUE ] ) ; then 186 mail -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} < ${buffer} # send buffer 187 rm -f $buffer ; touch ${buffer} # clear buffer 188 touch ${last_mail_date__file} # memorize last mail date 187 188 if [ X${initBigBro}=Xtrue ] ; then 189 mailx -s "[TEMPORARY AMQP CHANNEL]" -a ${SUBMIT_DIR}/config.card.base64 ${mail_recipient} < ${buffer} # send buffer 190 rm -f $buffer ; touch ${buffer} # clear buffer 191 touch ${last_mail_date__file} # memorize last mail date 192 initBigBro=false 193 elif ( [ ${send_messages} -eq 1 ] || [ X${FlushAMQP} = XTRUE ] ) ; then 194 mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} < ${buffer} # send buffer 195 rm -f $buffer ; touch ${buffer} # clear buffer 196 touch ${last_mail_date__file} # memorize last mail date 189 197 fi 190 198 … … 209 217 # Prepare additionnal option 210 218 additionnalOption="-f ${SUBMIT_DIR}/config.card.base64" 219 # 220 initBigBro=true 211 221 else 212 222 additionnalOption= 223 # 224 initBigBro=false 213 225 fi 214 226 … … 237 249 if [ ${status} -gt 0 ] ; then 238 250 IGCM_debug_Print 2 "IGCM_debug_Push/PopStack/ActivateBigBro : command sendAMQPMsg failed error code ${status}" 239 echo 251 echo sendAMQPMsg -h localhost -p 5672 -b "${Body}" 240 252 exit 241 253 fi … … 306 318 code=2000 307 319 # RabbitMQ message body 308 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )320 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 309 321 # Fill the rabbitMQ queue 310 322 IGCM_debug_sendAMQP … … 501 513 code=9000 502 514 # RabbitMQ message body 503 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"NOK\",\"out\":\"true\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )515 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 504 516 # Fill the rabbitMQ queue 505 517 IGCM_debug_sendAMQP … … 512 524 code=3000 513 525 # RabbitMQ message body 514 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"OK\",\"out\":\"true\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )526 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 515 527 # Fill the rabbitMQ queue 516 528 IGCM_debug_sendAMQP … … 541 553 IGCM_debug_PushStack "IGCM_debug_ActivateBigBro" 542 554 555 # Message type standard fields: 556 # https://github.com/Prodiguer/prodiguer-docs/wiki/MQ-Standard-Message-Fields 557 558 # Message type dictionnary and custom fields: 559 # https://github.com/Prodiguer/prodiguer-docs/wiki/Monitoring-Message-Dictionary 560 543 561 if [ X${BigBrother} = Xtrue ] ; then 544 # ID to identify a simulation and the current Job. Still subject to change545 GenericSimulationID=$( echo "\"simulationName\":\"${config_UserChoices_JobName}\",\"Experiment\":\"${config_UserChoices_ExperimentName}\",\"SpaceName\":\"${config_UserChoices_SpaceName}\",\"Model\":\"${config_UserChoices_TagName}\",\"Login\":\"${LOGIN}\",\"Center\":\"${CENTER}\",\"Machine\":\"${MASTER}\",\"CumulPeriod\":\"${CumulPeriod}\"")562 # create a unique ID for this specific job 563 jobuid=$(uuidgen) 546 564 547 565 # RabbitMQ message code 548 566 if ( ${FirstInitialize} ) ; then 549 567 code=0000 568 # create and persist a unique id for this simulation 569 simuid=$(uuidgen) 570 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration simuid ${simuid} 571 572 # Standard fields for the first message 573 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}\"" ) 550 574 else 551 575 code=1000 552 fi 553 # RabbitMQ message body 554 Body=$( echo "{${GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"OK\",\"out\":\"false\",\"nesting\":\"${IGCM_debug_LenStack}\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 576 # 577 # retrieve this simulation's unique id 578 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid 579 simuid=${config_Configuration_simuid} 580 581 # Standard fields for message others than the first one. Still subject to change 582 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 583 fi 584 585 # RabbitMQ message body with specific fields associated message codes treated here 586 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 555 587 # Fill the rabbitMQ queue (specifying config.card must be send) 556 588 IGCM_debug_sendAMQP activate … … 600 632 code=9999 601 633 # RabbitMQ message body 602 Body=$( echo "{${ GenericSimulationID},\"code\":\"${code}\",\"uuid\":\"$(uuidgen)\",\"status\":\"FATAL\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )634 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 603 635 # Fill the rabbitMQ queue 604 636 IGCM_debug_sendAMQP … … 754 786 if [ X${ActivateBigBro} = Xtrue ] ; then 755 787 # RabbitMQ message body 756 Body=$( echo "{${ instrumentationContent},\"uuid\":\"$(uuidgen)\",\"timestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" )788 Body=$( echo "{${genericSimulationID},${instrumentationContent},\"msgCode\":\"7000\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%d-%T-%N" )\"}" ) 757 789 # Fill the rabbitMQ queue 758 790 IGCM_debug_sendAMQP
Note: See TracChangeset
for help on using the changeset viewer.