Changeset 25419 for trunk/ippTasks/magic.pro
- Timestamp:
- Sep 16, 2009, 9:47:16 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/magic.pro (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/magic.pro
r25021 r25419 10 10 book init magicToTree 11 11 book init magicToProcess 12 book init magicToDS13 book init magicDSToRevert14 12 15 13 ### Database lists 16 14 $magicToTree_DB = 0 17 15 $magicToProcess_DB = 0 18 $magicToDS_DB = 019 $magicDSToRevert_DB = 020 21 #list of stages22 $STAGE:n = 023 list STAGE -add "raw"24 list STAGE -add "chip"25 list STAGE -add "camera"26 list STAGE -add "warp"27 list STAGE -add "diff"28 $magicDSRevertStage = 029 16 30 17 ### Check status of tasks … … 32 19 book listbook magicToTree 33 20 book listbook magicToProcess 34 book listbook magicToDS35 book listbook magicDSToRevert36 21 end 37 22 … … 40 25 book init magicToTree 41 26 book init magicToProcess 42 book init magicToDS43 book init magicDSToRevert44 27 end 45 28 … … 58 41 active true 59 42 end 60 task magic.destreak.load 61 active true 62 end 63 task magic.destreak.run 64 active true 65 end 66 end 67 68 macro magic.ds.revert.on 69 task magic.ds.revert.load 70 active true 71 end 72 task magic.ds.revert.run 73 active true 74 end 75 end 43 end 44 76 45 ### Turn tasks off 77 46 macro magic.off … … 88 57 active false 89 58 end 90 task magic.destreak.load 91 active false 92 end 93 task magic.destreak.run 94 active false 95 end 96 end 97 98 macro magic.ds.revert.off 99 task magic.ds.revert.load 100 active false 101 end 102 task magic.ds.revert.run 103 active false 104 end 105 end 106 macro magic.ds.off 107 task magic.destreak.load 108 active false 109 end 110 task magic.destreak.run 111 active false 112 end 113 end 114 macro magic.ds.on 115 task magic.destreak.load 116 active true 117 end 118 task magic.destreak.run 119 active true 120 end 121 end 122 123 macro magic.ds.status 124 echo magicToDS 125 book listbook magicToDS 126 echo "" 127 echo magicDSToRevert 128 book listbook magicDSToRevert 129 end 130 131 59 end 132 60 133 61 task magic.tree.load … … 400 328 end 401 329 end 402 403 task magic.destreak.load404 host local405 406 periods -poll $LOADPOLL407 # this query can take a long time408 periods -exec 10409 periods -timeout 120410 npending 1411 412 stdout NULL413 stderr $LOGDIR/magic.destreak.log414 415 task.exec416 $run = magicdstool -todestreak -limit 120417 if ($DB:n == 0)418 option DEFAULT419 else420 # save the DB name for the exit tasks421 option $DB:$magicToDS_DB422 $run = $run -dbname $DB:$magicToDS_DB423 $magicToDS_DB ++424 if ($magicToDS_DB >= $DB:n) set magicToDS_DB = 0425 end426 add_poll_args run427 add_poll_labels run428 command $run429 end430 431 # success432 task.exit 0433 # convert 'stdout' to book format434 ipptool2book stdout magicToDS -key magic_ds_id:component -uniq -setword dbname $options:0 -setword pantaskState INIT435 if ($VERBOSE > 2)436 book listbook magicToDS437 end438 439 # delete existing entries in the appropriate pantaskStates440 process_cleanup magicToDS441 end442 443 # locked list444 task.exit default445 showcommand failure446 end447 448 task.exit crash449 showcommand crash450 end451 452 # operation times out?453 task.exit timeout454 showcommand timeout455 end456 end457 458 task magic.destreak.run459 periods -poll $RUNPOLL460 periods -exec $RUNEXEC461 periods -timeout 60462 463 task.exec464 book npages magicToDS -var N465 if ($N == 0) break466 if ($NETWORK == 0) break467 468 # look for new images (pantaskState == INIT)469 book getpage magicToDS 0 -var pageName -key pantaskState INIT470 if ("$pageName" == "NULL") break471 472 book setword magicToDS $pageName pantaskState RUN473 book getword magicToDS $pageName exp_id -var EXP_ID474 book getword magicToDS $pageName magic_ds_id -var MAGIC_DS_ID475 book getword magicToDS $pageName camera -var CAMERA476 book getword magicToDS $pageName streaks_uri -var STREAKS477 book getword magicToDS $pageName inv_streaks_uri -var INV_STREAKS478 book getword magicToDS $pageName stage -var STAGE479 book getword magicToDS $pageName stage_id -var STAGE_ID480 book getword magicToDS $pageName component -var COMPONENT481 book getword magicToDS $pageName uri -var URI482 book getword magicToDS $pageName path_base -var PATH_BASE483 book getword magicToDS $pageName cam_path_base -var CAM_PATH_BASE484 book getword magicToDS $pageName outroot -var OUTROOT485 book getword magicToDS $pageName recoveryroot -var RECROOT486 book getword magicToDS $pageName re_place -var REPLACE487 book getword magicToDS $pageName dbname -var DBNAME488 489 sprintf logfile "%s/%s.mds.%s.%s.%s.log" $OUTROOT $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT490 491 substr $COMPONENT 0 3 COMP_HEAD492 if ("$COMP_HEAD" == "sky")493 set.host.for.skycell $COMPONENT494 else495 # assume component is a class_id, if not we will default to anyhost496 set.host.for.camera $CAMERA $COMPONENT497 end498 499 # TODO: do not add recoveryroot or replace if they are null or zero500 501 $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE502 503 add_standard_args run504 505 # save the pageName for future reference below506 options $pageName507 508 # create the command line509 if ($VERBOSE > 1)510 echo command $run511 end512 command $run513 end514 515 # default exit status516 task.exit 0517 process_exit magicToDS $options:0 $JOB_STATUS518 end519 520 # locked list521 task.exit default522 showcommand failure523 process_exit magicToDS $options:0 $JOB_STATUS524 end525 526 task.exit crash527 showcommand crash528 book setword magicToDS $options:0 pantaskState CRASH529 end530 531 # operation timed out?532 task.exit timeout533 showcommand timeout534 book setword magicToDS $options:0 pantaskState TIMEOUT535 end536 end537 538 task magic.ds.revert.load539 host local540 541 periods -poll $LOADPOLL542 periods -exec $LOADEXEC543 periods -timeout 20544 npending 1545 active false546 547 stdout NULL548 stderr $LOGDIR/magic.ds.revert.log549 550 task.exec551 $run = magicdstool -torevert -stage $STAGE:$magicDSRevertStage552 $magicDSRevertStage ++553 if ($magicDSRevertStage >= $STAGE:n) set magicDSRevertStage = 0554 555 if ($DB:n == 0)556 option DEFAULT557 else558 559 # save the DB name for the exit tasks560 option $DB:$magicDSToRevert_DB561 $run = $run -dbname $DB:$magicDSToRevert_DB562 563 # only bump database number after we have gone through all of the stages564 if ($magicDSRevertStage == 0)565 $magicDSToRevert_DB ++566 end567 if ($magicDSToRevert_DB >= $DB:n) set magicDSToRevert_DB = 0568 end569 add_poll_args run570 add_poll_labels run571 command $run572 end573 574 # success575 task.exit 0576 # convert 'stdout' to book format577 ipptool2book stdout magicDSToRevert -key magic_ds_id:component -uniq -setword dbname $options:0 -setword pantaskState INIT578 if ($VERBOSE > 2)579 book listbook magicDSToRevert580 end581 582 # delete existing entries in the appropriate pantaskStates583 process_cleanup magicDSToRevert584 end585 586 # locked list587 task.exit default588 showcommand failure589 end590 591 task.exit crash592 showcommand crash593 end594 595 # operation times out?596 task.exit timeout597 showcommand timeout598 end599 end600 601 task magic.ds.revert.run602 periods -poll $RUNPOLL603 periods -exec $RUNEXEC604 periods -timeout 60605 active false606 607 task.exec608 book npages magicDSToRevert -var N609 if ($N == 0) break610 if ($NETWORK == 0) break611 612 # look for new images (pantaskState == INIT)613 book getpage magicDSToRevert 0 -var pageName -key pantaskState INIT614 if ("$pageName" == "NULL") break615 616 book setword magicDSToRevert $pageName pantaskState RUN617 book getword magicDSToRevert $pageName exp_id -var EXP_ID618 book getword magicDSToRevert $pageName magic_ds_id -var MAGIC_DS_ID619 book getword magicDSToRevert $pageName camera -var CAMERA620 book getword magicDSToRevert $pageName stage -var STAGE621 book getword magicDSToRevert $pageName stage_id -var STAGE_ID622 book getword magicDSToRevert $pageName component -var COMPONENT623 book getword magicDSToRevert $pageName path_base -var PATH_BASE624 book getword magicDSToRevert $pageName cam_path_base -var CAM_PATH_BASE625 book getword magicDSToRevert $pageName outroot -var OUTROOT626 book getword magciDSToRevert $pageName bytes -var BYTES627 book getword magciDSToRevert $pageName md5sum -var md5sum628 # book getword magicDSToRevert $pageName recoveryroot -var RECROOT629 book getword magicDSToRevert $pageName re_place -var REPLACE630 book getword magicDSToRevert $pageName dbname -var DBNAME631 632 sprintf logfile "%s/%s.mds.revert.%s.%s.%s.log" $OUTROOT $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT633 634 substr $COMPONENT 0 3 COMP_HEAD635 if ("$COMP_HEAD" == "sky")636 set.host.for.skycell $COMPONENT637 else638 # assume component is a class_id, if not we will default to anyhost639 set.host.for.camera $CAMERA $COMPONENT640 end641 642 $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --outroot $OUTROOT --logfile $logfile --replace $REPLACE643 644 add_standard_args run645 646 # save the pageName for future reference below647 options $pageName648 649 # create the command line650 if ($VERBOSE > 1)651 echo command $run652 end653 command $run654 end655 656 # default exit status657 task.exit 0658 process_exit magicDSToRevert $options:0 $JOB_STATUS659 end660 661 # locked list662 task.exit default663 showcommand failure664 process_exit magicDSToRevert $options:0 $JOB_STATUS665 end666 667 task.exit crash668 showcommand crash669 book setword magicDSToRevert $options:0 pantaskState CRASH670 end671 672 # operation timed out?673 task.exit timeout674 showcommand timeout675 book setword magicDSToRevert $options:0 pantaskState TIMEOUT676 end677 end678
Note:
See TracChangeset
for help on using the changeset viewer.
