- Timestamp:
- Oct 21, 2010, 2:45:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/ippTasks/destreak.pro
r29124 r29515 10 10 book init magicToDS 11 11 book init magicDSToRevert 12 book init magicDSToCleanup13 12 14 13 ### indexes into Database lists … … 30 29 $magicDSRevertStage = 0 31 30 31 macro destreak.show.stages 32 echo $DS_STAGE:n stages enabled for destreak processing 33 for i 0 $DS_STAGE:n 34 echo $i $DS_STAGE:$i 35 end 36 echo current magicDSStage = $magicDSStage 37 echo current magicDSRevertStage = $magicDSRevertStage 38 end 39 32 40 ### Check status of tasks 33 41 macro destreak.status 34 # since echo and listbook output go to different files these do not come in order35 echo magicToDS36 42 book listbook magicToDS 37 echo magicDSToRevert38 43 book listbook magicDSToRevert 39 echo magicDSToCleanup40 book listbook magicDSToCleanup41 44 end 42 45 … … 45 48 book init magicToDS 46 49 book init magicDSToRevert 47 book init magicDSToCleanup48 50 end 49 51 … … 73 75 end 74 76 75 macro destreak.cleanup.on76 task destreak.cleanup.load77 active true78 end79 task destreak.cleanup.run80 active true81 end82 end83 84 77 ### Turn tasks off 85 78 macro destreak.off … … 106 99 end 107 100 end 108 macro destreak.cleanup.off109 task destreak.cleanup.load110 active false111 end112 task destreak.cleanup.run113 active false114 end115 end116 117 101 118 102 task destreak.load … … 203 187 book getword magicToDS $pageName camera -var CAMERA 204 188 book getword magicToDS $pageName streaks_uri -var STREAKS 189 book getword magicToDS $pageName streaks_path_base -var STREAKS_PATH_BASE 205 190 book getword magicToDS $pageName inv_streaks_uri -var INV_STREAKS 191 book getword magicToDS $pageName inv_streaks_path_base -var INV_STREAKS_PATH_BASE 206 192 book getword magicToDS $pageName stage -var STAGE 207 193 book getword magicToDS $pageName stage_id -var STAGE_ID … … 229 215 # TODO: do not add recoveryroot or replace if they are null or zero 230 216 231 $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --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 --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED217 $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks_path_base $STREAKS_PATH_BASE --inv_streaks_path_base $INV_STREAKS_PATH_BASE --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 --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED 232 218 233 219 add_standard_args run … … 274 260 275 261 periods -poll $LOADPOLL 276 #periods -exec $LOADEXEC277 262 periods -exec 30 278 periods -timeout 60263 periods -timeout 300 279 264 npending 1 280 265 … … 293 278 add_poll_args run 294 279 add_poll_labels run 280 # since this command can be expensive, reduce the limit 281 $run = $run -limit 24 295 282 command $run 296 283 end … … 317 304 task destreak.revert.load 318 305 host local 319 320 periods -poll $LOADPOLL 321 periods -exec $LOADEXEC 322 periods -timeout 20 306 periods -poll 60.0 307 periods -exec 120. 308 periods -timeout 120 323 309 npending 1 324 310 active false … … 518 504 end 519 505 520 task destreak.cleanup.load521 host local522 523 periods -poll $LOADPOLL524 periods -exec $LOADEXEC525 periods -timeout 20526 npending 1527 active false528 529 stdout NULL530 stderr $LOGSUBDIR/destreak.cleanup.load.log531 532 task.exec533 $run = magicdstool -tocleanup534 if ($DB:n == 0)535 option DEFAULT536 else537 538 # save the DB name for the exit tasks539 option $DB:$magicDSToCleanup_DB540 $run = $run -dbname $DB:$magicDSToCleanup_DB541 542 # only bump database number after we have gone through all of the stages543 $magicDSToCleanup_DB ++544 if ($magicDSToCleanup_DB >= $DB:n) set magicDSToCleanup_DB = 0545 end546 add_poll_args run547 add_poll_labels run548 command $run549 end550 551 # success552 task.exit 0553 # convert 'stdout' to book format554 ipptool2book stdout magicDSToCleanup -key magic_ds_id -uniq -setword dbname $options:0 -setword pantaskState INIT555 if ($VERBOSE > 2)556 book listbook magicDSToCleanup557 end558 559 # delete existing entries in the appropriate pantaskStates560 process_cleanup magicDSToCleanup561 end562 563 # locked list564 task.exit default565 showcommand failure566 end567 568 task.exit crash569 showcommand crash570 end571 572 # operation times out?573 task.exit timeout574 showcommand timeout575 end576 end577 578 task destreak.cleanup.run579 periods -poll $RUNPOLL580 periods -exec $RUNEXEC581 periods -timeout 60582 active false583 584 task.exec585 stdout $LOGSUBDIR/destreak.cleanup.run.log586 stderr $LOGSUBDIR/destreak.cleanup.run.log587 588 # if we are unable to run the 'exec', use a long retry time589 periods -exec $RUNEXEC590 591 book npages magicDSToCleanup -var N592 if ($N == 0) break593 if ($NETWORK == 0) break594 595 # look for new images (pantaskState == INIT)596 book getpage magicDSToCleanup 0 -var pageName -key pantaskState INIT597 if ("$pageName" == "NULL") break598 599 book setword magicDSToCleanup $pageName pantaskState RUN600 book getword magicDSToCleanup $pageName magic_ds_id -var MAGIC_DS_ID601 book getword magicDSToCleanup $pageName camera -var CAMERA602 book getword magicDSToCleanup $pageName stage -var STAGE603 book getword magicDSToCleanup $pageName outroot -var OUTROOT604 book getword magicDSToCleanup $pageName dbname -var DBNAME605 606 sprintf logfile "%s/mds.%s.cleanup.log" $OUTROOT $MAGIC_DS_ID607 608 host anyhost609 610 $run = magic_destreak_cleanup.pl --magic_ds_id $MAGIC_DS_ID --stage $STAGE --camera $CAMERA --logfile $logfile611 612 add_standard_args run613 614 # save the pageName for future reference below615 options $pageName616 617 # create the command line618 if ($VERBOSE > 1)619 echo command $run620 end621 # if we are ready to run, drop the retry timeout low so we fill up the queue622 periods -exec 0.05623 command $run624 end625 626 # default exit status627 task.exit 0628 process_exit magicDSToCleanup $options:0 $JOB_STATUS629 end630 631 # locked list632 task.exit default633 showcommand failure634 process_exit magicDSToCleanup $options:0 $JOB_STATUS635 end636 637 task.exit crash638 showcommand crash639 book setword magicDSToCleanup $options:0 pantaskState CRASH640 end641 642 # operation timed out?643 task.exit timeout644 showcommand timeout645 book setword magicDSToCleanup $options:0 pantaskState TIMEOUT646 end647 end648
Note:
See TracChangeset
for help on using the changeset viewer.
