Changeset 9104 for trunk/ippTasks/phase0.pro
- Timestamp:
- Oct 2, 2006, 12:36:59 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/phase0.pro (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/phase0.pro
r9081 r9104 2 2 ## this file contains the tasks for running the phase 0 stage 3 3 4 ## these tasks use the queue Phase0 PendingImfiles5 ## the Phase0 PendingImfiles queue contains:4 ## these tasks use the queue Phase0Imfiles 5 ## the Phase0Imfiles queue contains: 6 6 ## STATE EXP_KEY CLASS CLASS_ID URI-FITS 7 7 ## queue keys are counted from 0 8 8 9 queueinit Phase0 PendingImfiles10 queueinit Phase0 PendingExposures9 queueinit Phase0Imfiles 10 queueinit Phase0Exposures 11 11 if ($?network == 0) 12 12 $network = 1 … … 17 17 18 18 # select images ready for phase0 analysis 19 # new entries are added to queue Phase0 PendingImfiles19 # new entries are added to queue Phase0Imfiles 20 20 # compare the new list with the ones already selected 21 21 task phase0.imfile.load … … 36 36 # save stdout and stderr 37 37 38 # compare output with Phase0 PendingImfiles queue38 # compare output with Phase0Imfiles queue 39 39 # only add entries which don't exist in queue 40 40 queuesize stdout -var Nqueue 41 41 for i 0 $Nqueue 42 42 queuepop stdout -var line 43 queuepush Phase0 PendingImfiles -uniq -key 1 "NEW $line"43 queuepush Phase0Imfiles -uniq -key 1 "NEW $line" 44 44 end 45 45 46 46 # delete existing entries which are DONE 47 queuedrop Phase0 PendingImfiles -key 0 DONE47 queuedrop Phase0Imfiles -key 0 DONE 48 48 end 49 49 50 50 # locked list 51 51 task.exit default 52 echo " ***phase0 pending imfiles: failure"53 end 54 55 # operation times out? 56 task.exit timeout 57 echo " ***phase0 pending imfiles: timeout"52 echo "phase0 pending imfiles: failure" 53 end 54 55 # operation times out? 56 task.exit timeout 57 echo "phase0 pending imfiles: timeout" 58 58 end 59 59 end 60 60 61 61 # run the phase0imfile script on pending images 62 task phase0.imfile. process62 task phase0.imfile.run 63 63 periods -poll 0.5 64 64 periods -exec 1 … … 66 66 67 67 task.exec 68 queuesize Phase0 PendingImfiles -var N68 queuesize Phase0Imfiles -var N 69 69 if ($N == 0) break 70 70 if ($network == 0) break … … 73 73 # caution with these 'if' statements: syntax errors 74 74 # will make the task fail without given a good status 75 queuepop Phase0 PendingImfiles -var line -key 0 NEW75 queuepop Phase0Imfiles -var line -key 0 NEW 76 76 if ("$line" == "NULL") break 77 77 78 78 strpop line state 79 queuepush Phase0 PendingImfiles -replace -key 1 "RUN $line"80 81 ## the Phase0 PendingImfiles queue contains (line has popped STATE)79 queuepush Phase0Imfiles -replace -key 1 "RUN $line" 80 81 ## the Phase0Imfiles queue contains (line has popped STATE) 82 82 ## STATE EXP_KEY CLASS CLASS_ID URI-FITS 83 83 list word -split $line … … 103 103 task.exit 0 104 104 # phase0imfile.pl updates DB tables, here we just update the queue 105 queuepush Phase0 PendingImfiles -replace -key 1 "DONE $options:0"105 queuepush Phase0Imfiles -replace -key 1 "DONE $options:0" 106 106 end 107 107 … … 109 109 task.exit default 110 110 echo "failure for phase0imfile.pl: $options:0" 111 queuepush Phase0 PendingImfiles -replace -key 1 "FAIL $options:0"111 queuepush Phase0Imfiles -replace -key 1 "FAIL $options:0" 112 112 end 113 113 … … 115 115 task.exit timeout 116 116 echo "timeout for phase0imfile.pl: $options:0" 117 queuepush Phase0 PendingImfiles -replace -key 1 "TIMEOUT $options:0"118 end 119 end 120 121 ## these tasks use the queue Phase0 PendingExposures122 ## the Phase0 PendingExposures queue contains:117 queuepush Phase0Imfiles -replace -key 1 "TIMEOUT $options:0" 118 end 119 end 120 121 ## these tasks use the queue Phase0Exposures 122 ## the Phase0Exposures queue contains: 123 123 ## STATE EXP_KEY CAMERA TELESCOPE TYPE NCLASS 124 124 125 125 # select images ready for phase0 analysis 126 # new entries are added to queue Phase0 PendingExposures126 # new entries are added to queue Phase0Exposures 127 127 # compare the new list with the ones already selected 128 128 task phase0.exp.load … … 141 141 local i Nqueue 142 142 143 # compare output with Phase0 PendingExposures queue143 # compare output with Phase0Exposures queue 144 144 # only add entries which don't exist in queue 145 145 queuesize stdout -var Nqueue 146 146 for i 0 $Nqueue 147 147 queuepop stdout -var line 148 queuepush Phase0 PendingExposures -uniq -key 1 "NEW $line"148 queuepush Phase0Exposures -uniq -key 1 "NEW $line" 149 149 end 150 150 151 151 # delete existing entries which are DONE 152 queuedrop Phase0 PendingExposures -key 0 DONE152 queuedrop Phase0Exposures -key 0 DONE 153 153 end 154 154 … … 165 165 166 166 # run the phase0imfile script on pending images 167 task phase0.exp. process167 task phase0.exp.run 168 168 periods -poll 0.5 169 169 periods -exec 1.0 … … 171 171 172 172 task.exec 173 queuesize Phase0 PendingExposures -var N173 queuesize Phase0Exposures -var N 174 174 if ($N == 0) break 175 175 if ($network == 0) break … … 178 178 # caution with these 'if' statements: syntax errors 179 179 # will make the task fail without given a good status 180 queuepop Phase0 PendingExposures -var line -key 0 NEW180 queuepop Phase0Exposures -var line -key 0 NEW 181 181 if ("$line" == "NULL") break 182 182 183 183 strpop line state 184 queuepush Phase0 PendingExposures -replace -key 1 "RUN $line"185 186 ## the Phase0 PendingExposures queue contains:184 queuepush Phase0Exposures -replace -key 1 "RUN $line" 185 186 ## the Phase0Exposures queue contains: 187 187 ## STATE EXP_KEY CAMERA TELESCOPE TYPE NCLASS 188 188 list word -split $line … … 208 208 task.exit 0 209 209 # phase0exp.pl updates DB tables, here we just update the queue 210 queuepush Phase0 PendingExposures -replace -key 1 "DONE $options:0"210 queuepush Phase0Exposures -replace -key 1 "DONE $options:0" 211 211 end 212 212 213 213 # default exit status 214 214 task.exit default 215 queuepush Phase0 PendingExposures -replace -key 1 "FAIL $options:0"216 end 217 218 # operation times out? 219 task.exit timeout 220 queuepush Phase0 PendingExposures -replace -key 1 "TIMEOUT $options:0"215 queuepush Phase0Exposures -replace -key 1 "FAIL $options:0" 216 end 217 218 # operation times out? 219 task.exit timeout 220 queuepush Phase0Exposures -replace -key 1 "TIMEOUT $options:0" 221 221 end 222 222 end
Note:
See TracChangeset
for help on using the changeset viewer.
