Changeset 11011 for branches/eam_branch_00/ippTasks/phase2.pro
- Timestamp:
- Jan 10, 2007, 12:12:35 PM (20 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_00/ippTasks/phase2.pro (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/phase2.pro
r11008 r11011 1 1 ## this file contains the tasks for running the phase 0 stage 2 ## these tasks use the book p2PendingImfile 2 3 3 ## these tasks use the queue Phase2Imfiles4 ## the Phase2Imfiles queue contains:5 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS6 ## queue keys are counted from 07 8 # XXX change book names to match ippTool values?9 # XXX replace with book init p2pending10 queueinit Phase2Imfiles11 4 if ($?network == 0) 12 5 $network = 1 … … 15 8 $parallel = 0 16 9 end 17 18 $Phase2ImfileFail = 019 20 10 if ($?VERBOSE == 0) 21 11 echo "VERBOSE not defined: load pantasks.pro first" … … 26 16 break 27 17 end 18 28 19 $LOGSUBDIR = $LOGDIR/phase2 29 20 exec mkdir -p $LOGSUBDIR 30 21 22 book init p2PendingImfile 23 31 24 macro phase2.status 32 book listbook p2pending 33 echo "Phase2ImfileFail: $Phase2ImfileFail" 25 book listbook p2PendingImfile 34 26 end 35 27 36 28 # select images ready for phase2 analysis 37 # new entries are added to queue Phase2Imfiles38 # compare the new list with the ones already selected29 # new entries are added to p2PendingImfile 30 # skip already-present entries 39 31 task phase2.imfile.load 40 32 host local … … 48 40 49 41 task.exec 50 # command p2tool -pendingimfile -simple -limit {$Phase2ImfileFail + 20}51 # XXX make sure we remove FAIL and TIMEOUT entries52 42 command p2tool -pendingimfile -limit 20 53 43 end … … 55 45 # success 56 46 task.exit 0 57 # stdout from the task is stored on queue 'stdout'58 47 # convert 'stdout' to book format 59 # only add entries which don't exist in the book 60 # 'state' has value of NULL 61 ipptool2book stdout p2pending -key exp_tag:class_id -uniq 48 ipptool2book stdout p2PendingImfile -key exp_tag:class_id -uniq 62 49 if ($VERBOSE > 2) 63 book listbook p2 pending50 book listbook p2PendingImfile 64 51 end 65 52 66 53 # delete existing entries which are DONE 67 book delpage p2 pending-key state DONE54 book delpage p2PendingImfile -key state DONE 68 55 end 69 56 … … 79 66 end 80 67 81 # run the phase2 imfilescript on pending images68 # run the phase2.pl script on pending images 82 69 task phase2.imfile.run 83 70 periods -poll $runpoll … … 86 73 87 74 task.exec 88 book npages p2 pending-var N75 book npages p2PendingImfile -var N 89 76 if ($N == 0) break 90 77 if ($network == 0) break 91 78 92 # look for new images on the internal p2pending book 93 # caution with these 'if' statements: syntax errors 94 # will make the task fail without given a good status 95 book getpage p2pending 0 -var pageName -key state NULL 96 book setword p2pending $pageName state RUN 79 # look for new images in p2PendingImfile (state == NULL) 80 book getpage p2PendingImfile 0 -var pageName -key state NULL 81 if ($pageName == NULL) break 97 82 98 book getword p2pending $pageName camera -var CAMERA 99 book getword p2pending $pageName exp_tag -var EXP_TAG 100 book getword p2pending $pageName class_id -var CLASS_ID 101 book getword p2pending $pageName uri -var URI 83 book setword p2PendingImfile $pageName state RUN 84 book getword p2PendingImfile $pageName camera -var CAMERA 85 book getword p2PendingImfile $pageName exp_tag -var EXP_TAG 86 book getword p2PendingImfile $pageName class_id -var CLASS_ID 87 book getword p2PendingImfile $pageName uri -var URI 102 88 103 # specify choice of remote host:(need to choose based on chips) 89 # specify choice of remote host 90 # XXX need to choose based on chips 104 91 if ($parallel) 105 92 host anyhost … … 118 105 exec mkdir -p $LOGSUBDIR/$base 119 106 120 # save the p 2pending book pageName for future reference below107 # save the pageName for future reference below 121 108 options $pageName 122 109 … … 130 117 # success 131 118 task.exit 0 132 # phase2imfile.pl updates DB tables, here we just update the queue 133 book setword p2pending $options:0 state DONE 134 # queuepush Phase2Imfiles -replace -key 1:2 "DONE $options:0" 119 # phase2.pl updates DB tables, here we just update the queue 120 book setword p2PendingImfile $options:0 state DONE 135 121 end 136 122 … … 138 124 task.exit default 139 125 showcommand failure 140 book setword p2pending $options:0 state FAIL 141 # queuepush Phase2Imfiles -replace -key 1:2 "FAIL $options:0" 142 # drop failed entries from the book lists? 143 $Phase2ImfileFail ++ 126 book setword p2PendingImfile $options:0 state FAIL 144 127 end 145 128 146 # operation time sout?129 # operation timed out? 147 130 task.exit timeout 148 131 showcommand timeout 149 book setword p2pending $options:0 state TIMEOUT 150 # queuepush Phase2Imfiles -replace -key 1:2 "TIMEOUT $options:0" 151 $Phase2ImfileFail ++ 132 book setword p2PendingImfile $options:0 state TIMEOUT 152 133 end 153 134 end
Note:
See TracChangeset
for help on using the changeset viewer.
