- Timestamp:
- 04/14/15 17:00:21 (9 years ago)
- Location:
- trunk/libIGCM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/AA_job
r1184 r1189 241 241 # Activate BigBrother so as to supervise this simulation 242 242 # ------------------------------------------------------------------ 243 IGCM_debug_ ActivateBigBro243 IGCM_debug_BigBro_Initialize 244 244 245 245 #D- -
trunk/libIGCM/AA_metrics_LMDZ
r1184 r1189 118 118 IGCM_config_CommonConfiguration ${CARD_DIR}/config.card 119 119 120 # ------------------------------------------------------------------ 121 # Activate BigBrother so as to supervise this job 122 # ------------------------------------------------------------------ 123 IGCM_debug_BigBro_Initialize 124 120 125 #================================== 121 126 # Then set up several directories … … 181 186 # Clean RUN_DIR_PATH (necessary for cesium and titane only) 182 187 IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} 188 189 # ------------------------------------------------------------------ 190 # Finalize BigBrother to inform that the jobs end 191 # ------------------------------------------------------------------ 192 IGCM_debug_BigBro_Finalize -
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r1173 r1189 1248 1248 # End of entire simulation # 1249 1249 #==========================# 1250 simulationIsOver=true 1250 1251 1251 1252 # Mail notification … … 1256 1257 IGCM_debug_Print 1 "Normal End of computation." 1257 1258 1258 if ( $DEBUG_debug ) ; then1259 if [ X${ActivateBigBro} = Xtrue ] ; then1260 # RabbitMQ message code "END OF SIMULATION"1261 code=01001262 # RabbitMQ message body1263 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )1264 # Fill the rabbitMQ queue1265 IGCM_debug_sendAMQP1266 fi1267 fi1268 1269 # To be sure we flush message buffer and clean up behind us before the end of the simulation1270 FlushAMQP=TRUE1271 1272 1259 else 1273 1260 #=================# 1274 1261 # Submit next job # 1275 1262 #=================# 1263 simulationIsOver=false 1276 1264 1277 1265 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "OnQueue" … … 1291 1279 fi 1292 1280 1293 # Supress Non Deleted Boundary files1294 #if [ ${DRYRUN} -le 2 ] ; then1295 # IGCM_comp_DelFixeBoundaryFiles1296 # ls -la1297 #fi1298 1299 1281 # Clean ${RUN_DIR}=${RUN_DIR_PATH}/${config_UserChoices_JobName}.${$} 1300 1282 # Only for production run (No clean up in DEV or DEB mode) … … 1303 1285 [ X${JobType} = XRUN ] && IGCM_sys_RmRunDir -rf ${RUN_DIR_PATH} 1304 1286 1305 if ( $DEBUG_debug ) ; then 1306 # Inform the rabbitMQ queue 1307 if [ X${ActivateBigBro} = Xtrue ] ; then 1308 # RabbitMQ message code "WAITING" 1309 code=1100 1310 # RabbitMQ message body 1311 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 1312 # Fill the rabbitMQ queue 1313 IGCM_debug_sendAMQP 1314 fi 1315 fi 1287 # Inform the rabbitMQ queue 1288 IGCM_debug_BigBro_Finalize 1316 1289 1317 1290 IGCM_debug_PopStack "IGCM_config_Finalize" -
trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
r1162 r1189 171 171 fi 172 172 173 if [ X${FlushAMQP} = XTRUE ]; then173 if ( ${FlushAMQP} ) ; then 174 174 mailx -s "[TEMPORARY AMQP CHANNEL]" ${mail_recipient} < ${buffer} # send buffer 175 175 rm -f ${buffer} # cleaning behind us … … 325 325 fi 326 326 327 # Unplugged message 2000 handling for now. To ease downstream treatment.327 # Unplugged message 4000 handling for now. To ease downstream treatment. 328 328 #if [ X${ActivateBigBro} = Xtrue ] ; then 329 329 # # RabbitMQ message code "PUSHSTACK" 330 # code= 2000330 # code=4000 331 331 # # RabbitMQ message body 332 332 # 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" )\"}" ) … … 530 530 if [ X${ActivateBigBro} = Xtrue ] ; then 531 531 # RabbitMQ message code "ERROR HAS BEEN TRIGGERED" 532 code= 9000532 code=4900 533 533 # RabbitMQ message body 534 534 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) … … 542 542 fi 543 543 544 # Unplugged message 3000 handling for now. To ease downstream treatment.544 # Unplugged message 4100 handling for now. To ease downstream treatment. 545 545 #if [ X${ActivateBigBro} = Xtrue ] ; then 546 546 # # RabbitMQ message code "POPSTACK" 547 # code= 3000547 # code=4100 548 548 # # RabbitMQ message body 549 549 # Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) … … 570 570 571 571 #D-#================================================================== 572 #D-function IGCM_debug_ ActivateBigBro572 #D-function IGCM_debug_BigBro_Initialize 573 573 #D-* Purpose: switch rabbitMQ on 574 574 #D- 575 function IGCM_debug_ ActivateBigBro{576 IGCM_debug_PushStack "IGCM_debug_ ActivateBigBro"575 function IGCM_debug_BigBro_Initialize { 576 IGCM_debug_PushStack "IGCM_debug_BigBro_Initialize" 577 577 578 578 # Message type standard fields: … … 586 586 jobuid=$(uuidgen) 587 587 588 if ( ${FirstInitialize} ) ; then 589 # RabbitMQ message code "BEGIN A SIMULATION" 590 code=0000 591 # create and persist a unique id for this simulation 592 simuid=$(uuidgen) 593 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration simuid ${simuid} 594 # Standard fields for the first message 595 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}\"" ) 596 # RabbitMQ message body with specific fields associated message codes treated here 597 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 598 # Fill the rabbitMQ queue (the config.card in use will be sent) 599 IGCM_debug_sendAMQP activate 600 else 601 # RabbitMQ message code "A NEW JOB IS RUNNING PART OF A SIMULATION" 602 code=1000 588 if [ X${TaskType} = Xcomputing ]; then 589 if ( ${FirstInitialize} ) ; then 590 # RabbitMQ message code "BEGIN A SIMULATION" 591 code=0000 592 # create and persist a unique id for this simulation 593 simuid=$(uuidgen) 594 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration simuid ${simuid} 595 # Standard fields for the first message 596 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}\"" ) 597 # RabbitMQ message body with specific fields associated message codes treated here 598 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 599 # Fill the rabbitMQ queue (the config.card in use will be sent) 600 IGCM_debug_sendAMQP activate 601 else 602 # RabbitMQ message code "A NEW COMPUTING JOB IS RUNNING PART OF A SIMULATION" 603 code=1000 604 # retrieve this simulation's unique id 605 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid 606 simuid=${run_Configuration_simuid} 607 # Using standard fields for message others than the first one. Still subject to change 608 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 609 # RabbitMQ message body with specific fields associated message codes treated here 610 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 611 # Fill the rabbitMQ queue 612 IGCM_debug_sendAMQP 613 fi 614 615 # NOT VERY NICE BUT ... IT WORKS 616 # Be sure that the genericSimulationID will be small from now on 617 # Using standard fields for messages others than the first one. Still subject to change 618 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 619 620 elif [ X${TaskType} = Xpost-processing ]; then 621 # RabbitMQ message code "A NEW POST-PROCESSING JOB IS RUNNING PART OF A SIMULATION" 622 code=2000 603 623 # retrieve this simulation's unique id 604 624 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration simuid … … 611 631 IGCM_debug_sendAMQP 612 632 fi 613 614 # NOT VERY NICE BUT ... IT WORKS615 # Be sure that the genericSimulationID will be small from now on616 # Using standard fields for messages others than the first one. Still subject to change617 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"cumulPeriod\":\"${CumulPeriod}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )618 619 633 # Turn the flag on 620 634 ActivateBigBro=true 621 fi 622 IGCM_debug_PopStack "IGCM_debug_ActivateBigBro" 635 # Dont flush by default 636 FlushAMQP=false 637 fi 638 IGCM_debug_PopStack "IGCM_debug_BigBro_Initialize" 639 } 640 641 #D-#================================================================== 642 #D-function IGCM_debug_BigBro_Finalize 643 #D-* Purpose: Finalize rabbitMQ messages exchanges 644 #D- 645 function IGCM_debug_BigBro_Finalize { 646 IGCM_debug_PushStack "IGCM_debug_BigBro_Finalize" 647 648 # Message type standard fields: 649 # https://github.com/Prodiguer/prodiguer-docs/wiki/MQ-Standard-Message-Fields 650 651 # Message type dictionnary and custom fields: 652 # https://github.com/Prodiguer/prodiguer-docs/wiki/Monitoring-Message-Dictionary 653 654 if ( $DEBUG_debug ) ; then 655 if [ X${ActivateBigBro} = Xtrue ] ; then 656 if [ X${TaskType} = Xcomputing ]; then 657 if ( ${simulationIsOver} ) ; then 658 # RabbitMQ message code "SIMULATION ENDS" 659 code=0100 660 FlushAMQP=true 661 else 662 # RabbitMQ message code "COMPUTING JOB ENDS" 663 code=1100 664 fi 665 elif [ X${TaskType} = Xpost-processing ]; then 666 # RabbitMQ message code "POST-PROCESSING JOB ENDS" 667 code=2100 668 FlushAMQP=true 669 fi 670 # RabbitMQ message body 671 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 672 # Fill the rabbitMQ queue 673 IGCM_debug_sendAMQP 674 fi 675 fi 676 677 IGCM_debug_PopStack "IGCM_debug_BigBro_Finalize" 623 678 } 624 679 … … 663 718 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 664 719 # To be sure we flush message buffer and clean up behind us before the end of the simulation 665 FlushAMQP= TRUE720 FlushAMQP=true 666 721 # Fill the rabbitMQ queue 667 722 IGCM_debug_sendAMQP
Note: See TracChangeset
for help on using the changeset viewer.