Changeset 1244 for trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
- Timestamp:
- 10/09/15 16:04:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
r1243 r1244 29 29 #================================================== 30 30 # GENERATE RANDOM ERROR ; only apply if ( ${DEBUG_debug} ) 31 typeset RandomError=false31 typeset -r RandomError=false 32 32 33 33 #================================================== … … 39 39 # libIGCM_CurrentTag 40 40 # Current libIGCM tag, check compatibilty with *.card 41 typeset -r libIGCM _CurrentTag="1.0"41 typeset -r libIGCMVersion="2.7" 42 42 43 43 #================================================== … … 337 337 IGCM_debug_StackArgs[0]=$(echo ${INPUTS[*]:1} | sed -e "s/\ /\",\"/g" ) 338 338 fi 339 340 # Unplugged message 4000 handling for now. To ease downstream treatment.341 #if [ X${ActivateBigBro} = Xtrue ] ; then342 # # RabbitMQ message code "PUSHSTACK"343 # code=4000344 # # RabbitMQ message body345 # 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" )\"}" )346 # # Fill the rabbitMQ queue347 # IGCM_debug_sendAMQP348 #fi349 339 350 340 # Increment LenStack … … 542 532 543 533 # Unplugged message 4900 handling for now. To ease downstream treatment. 544 #if [ X${ActivateBigBro} = Xtrue ] ; then 545 # # RabbitMQ message code "ERROR HAS BEEN TRIGGERED" 546 # code=4900 547 # # RabbitMQ message body 548 # Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 549 # # Fill the rabbitMQ queue 550 # IGCM_debug_sendAMQP 551 #fi 534 if [ X${ActivateBigBro} = Xtrue ] ; then 535 if [ X${TaskType} = Xcomputing ]; then 536 # RabbitMQ message code "COMPUTING JOBs COMMAND FAILURE" 537 code=1900 538 elif [ X${TaskType} = Xpost-processing ]; then 539 # RabbitMQ message code "POST-PROCESSING JOBs COMMAND FAILURE" 540 code=2900 541 elif [ X${TaskType} = Xchecking ]; then 542 # RabbitMQ message code "POST-PROCESSING FROM CHECKER JOBs COMMAND FAILURE" 543 code=3900 544 fi 545 # RabbitMQ message body 546 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 547 548 # Fill the rabbitMQ queue 549 IGCM_debug_sendAMQP 550 fi 552 551 else 553 552 # Inform the stack file … … 555 554 echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName} 556 555 fi 557 558 # Unplugged message 4100 handling for now. To ease downstream treatment.559 #if [ X${ActivateBigBro} = Xtrue ] ; then560 # # RabbitMQ message code "POPSTACK"561 # code=4100562 # # RabbitMQ message body563 # Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )564 # # Fill the rabbitMQ queue565 # IGCM_debug_sendAMQP566 #fi567 556 fi 568 557 … … 590 579 IGCM_debug_PushStack "IGCM_debug_BigBro_Initialize" 591 580 592 typeset postProcessing Name postProcessingDate postProcessingDimn postProcessingComp postProcessingFile581 typeset postProcessingIDLength postProcessingName postProcessingDate postProcessingDimn postProcessingComp postProcessingFile 593 582 594 583 # Message type standard fields: … … 601 590 # create a unique ID for this specific job 602 591 jobuid=$(uuidgen) 592 593 # get the assigned id by the scheduler for that job 594 IGCM_sys_getJobSchedulerID jobSchedulerID 603 595 604 596 if [ X${TaskType} = Xcomputing ]; then … … 610 602 IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration simuid ${simuid} 611 603 # Standard fields for the first message 612 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\" activity\":\"IPSL\",\"name\":\"${config_UserChoices_JobName}\",\"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}\"" )604 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"activity\":\"IPSL\",\"name\":\"${config_UserChoices_JobName}\",\"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}\"" ) 613 605 # RabbitMQ message body with specific fields associated message codes treated here 614 606 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) … … 622 614 simuid=${run_Configuration_simuid} 623 615 # Using standard fields for message others than the first one. Still subject to change 624 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\" simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )616 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 625 617 # RabbitMQ message body with specific fields associated message codes treated here 626 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\" msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" )618 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"jobSchedulerID\":\"${jobSchedulerID}\",\"jobSubmissionPath\":\"${SUBMIT_DIR}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 627 619 # Fill the rabbitMQ queue 628 620 IGCM_debug_sendAMQP … … 632 624 # Be sure that the genericSimulationID will be small from now on 633 625 # Using standard fields for messages others than the first one. Still subject to change 634 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\" simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )626 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 635 627 636 628 elif [ X${TaskType} = Xpost-processing ]; then … … 641 633 simuid=${run_Configuration_simuid} 642 634 # Using standard fields for message others than the first one. Still subject to change 643 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\" simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" )635 genericSimulationID=$( echo "\"msgApplication\":\"monitoring\",\"msgProducer\":\"libigcm\",\"msgProducerVersion\":\"${libIGCMVersion}\",\"simuid\":\"${simuid}\",\"jobuid\":\"${jobuid}\"" ) 644 636 645 637 # Specify the post-processing task we are dealing with 646 n=$( echo "${Script_Post_Output}" | tr -d -c "\." | wc -c )638 postProcessingIDLength=$( echo "${Script_Post_Output}" | tr -d -c "\." | wc -c ) 647 639 postProcessingName=$( echo "${Script_Post_Output}" | gawk -F. '{print $1}' ) 648 640 postProcessingDate=$( echo "${Script_Post_Output}" | gawk -F. '{print $2}' ) … … 650 642 postProcessingComp="null" 651 643 postProcessingFile="null" 652 if [ ${ n} -eq 3 ] ; then644 if [ ${postProcessingIDLength} -eq 3 ] ; then 653 645 postProcessingDimn=$( echo "${Script_Post_Output}" | gawk -F. '{print $3}' ) 654 elif [ ${ n} -eq 5 ] ; then646 elif [ ${postProcessingIDLength} -eq 5 ] ; then 655 647 postProcessingComp=$( echo "${Script_Post_Output}" | gawk -F. '{print $4}' ) 656 648 postProcessingFile=$( echo "${Script_Post_Output}" | gawk -F. '{print $5}' ) … … 658 650 659 651 # RabbitMQ message body with specific fields associated message codes treated here 660 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\" msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\",\"postProcessingName\":\"${postProcessingName}\",\"postProcessingDate\":\"${postProcessingDate}\",\"postProcessingDimn\":\"${postProcessingDimn}\",\"postProcessingComp\":\"${postProcessingComp}\",\"postProcessingFile\":\"${postProcessingFile}\"}" )652 Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"accountingProject\":\"${PROJECT}\",\"jobWarningDelay\":\"${jobWarningDelay}\",\"jobSchedulerID\":\"${jobSchedulerID}\",\"jobSubmissionPath\":\"${SUBMIT_DIR}\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\",\"postProcessingName\":\"${postProcessingName}\",\"postProcessingDate\":\"${postProcessingDate}\",\"postProcessingDimn\":\"${postProcessingDimn}\",\"postProcessingComp\":\"${postProcessingComp}\",\"postProcessingFile\":\"${postProcessingFile}\"}" ) 661 653 # Fill the rabbitMQ queue 662 654 IGCM_debug_sendAMQP … … 692 684 elif ( ${ExitFlag} ) ; then 693 685 # RabbitMQ message code "EXIT THE JOBS BECAUSE ERROR(S) HAS BEEN TRIGGERED" 694 code= 9999686 code=1999 695 687 FlushAMQP=true 696 688 else … … 701 693 if ( ${ExitFlag} ) ; then 702 694 # RabbitMQ message code "POST-PROCESSING JOB FAILS" 703 code=29 00695 code=2999 704 696 FlushAMQP=true 705 697 else 706 698 # RabbitMQ message code "POST-PROCESSING JOB ENDS" 707 699 code=2100 700 FlushAMQP=true 701 fi 702 elif [ X${TaskType} = Xchecking ]; then 703 if ( ${ExitFlag} ) ; then 704 # RabbitMQ message code "POST-PROCESSING JOB FAILS" 705 code=3999 706 FlushAMQP=true 707 else 708 # RabbitMQ message code "POST-PROCESSING JOB ENDS" 709 code=3100 708 710 FlushAMQP=true 709 711 fi
Note: See TracChangeset
for help on using the changeset viewer.