Changeset 11011 for branches/eam_branch_00/ippTasks/phase0.pro
- Timestamp:
- Jan 10, 2007, 12:12:35 PM (20 years ago)
- File:
-
- 1 edited
-
branches/eam_branch_00/ippTasks/phase0.pro (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_00/ippTasks/phase0.pro
r10746 r11011 1 1 ## this file contains the tasks for running the phase 0 stage 2 3 ## these tasks use the queue Phase0Imfiles 4 ## the Phase0Imfiles queue contains: 5 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS 6 ## queue keys are counted from 0 7 8 queueinit Phase0Imfiles 9 queueinit Phase0Exposures 2 ## these tasks use the books Phase0Imfiles and Phase0Exposures 3 10 4 if ($?network == 0) 11 5 $network = 1 … … 14 8 $parallel = 0 15 9 end 16 17 $Phase0ImfileFail = 018 $Phase0ExpFail = 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/phase0 29 20 exec mkdir -p $LOGSUBDIR 30 21 22 book init Phase0Imfiles 23 book init Phase0Exposures 24 31 25 macro phase0.status 32 queueprint Phase0Imfiles 33 queueprint Phase0Exposures 34 echo "Phase0ImfileFail: $Phase0ImfileFail" 35 echo "Phase0ExpFail: $Phase0ExpFail" 26 book listbook Phase0Imfiles 27 book listbook Phase0Exposures 36 28 end 37 29 … … 50 42 51 43 task.exec 52 command p0tool -pendingimfile - simple -limit {$Phase0ImfileFail + 20}44 command p0tool -pendingimfile -limit 20 53 45 end 54 46 55 47 # success 56 48 task.exit 0 57 local i Nqueue 58 59 # compare output with Phase0Imfiles queue 60 # only add entries which don't exist in queue 61 queuesize stdout -var Nqueue 62 for i 0 $Nqueue 63 queuepop stdout -var line 64 if ($VERBOSE > 2) 65 echo $line 66 end 67 list word -split $line 68 $EXP_TAG = $word:0 69 $CLASS = $word:1 70 $CLASS_ID = $word:2 71 $URI = $word:3 72 queuepush Phase0Imfiles -uniq -key 1 "NEW $EXP_TAG $CLASS $CLASS_ID $URI" 49 # convert 'stdout' to book format 50 ipptool2book stdout Phase0Imfiles -key exp_tag -uniq 51 if ($VERBOSE > 2) 52 book listbook Phase0Imfiles 73 53 end 74 54 75 55 # delete existing entries which are DONE 76 queuedrop Phase0Imfiles -key 0DONE56 book delpage Phase0Imfiles -key state DONE 77 57 end 78 58 … … 88 68 end 89 69 90 91 92 # run the phase0imfile script on pending images 70 # run the phase0_imfile.pl script on pending images 93 71 task phase0.imfile.run 94 72 periods -poll $runpoll … … 97 75 98 76 task.exec 99 queuesizePhase0Imfiles -var N77 book npages Phase0Imfiles -var N 100 78 if ($N == 0) break 101 79 if ($network == 0) break 102 80 103 # look for new images on the internal DetrendImfilesToProcess queue 104 # caution with these 'if' statements: syntax errors 105 # will make the task fail without given a good status 106 queuepop Phase0Imfiles -var line -key 0 NEW 107 if ("$line" == "NULL") break 108 109 strpop line state 110 queuepush Phase0Imfiles -replace -key 1 "RUN $line" 111 112 ## the Phase0Imfiles queue contains (line has popped STATE) 113 ## STATE EXP_TAG CLASS CLASS_ID URI-FITS 114 list word -split $line 115 $EXP_TAG = $word:0 116 $CLASS = $word:1 117 $CLASS_ID = $word:2 118 $URI = $word:3 119 120 # specify choice of remote host:(need to choose based on chips) 81 # look for new images in Phase0Imfiles 82 book getpage Phase0Imfiles 0 -var pageName -key state NULL 83 if ($pageName == NULL) break 84 85 book setword Phase0Imfiles $pageName state RUN 86 book getword Phase0Imfiles $pageName exp_tag -var EXP_TAG 87 book getword Phase0Imfiles $pageName class -var CLASS 88 book getword Phase0Imfiles $pageName class_id -var CLASS_ID 89 book getword Phase0Imfiles $pageName uri -var URI 90 91 # specify choice of remote host 121 92 if ($parallel) 122 93 host anyhost … … 133 104 exec mkdir -p $LOGSUBDIR/$base 134 105 106 # save the pageName for future reference below 107 options $pageName 108 135 109 # create the command line 136 options "$line"137 110 if ($VERBOSE > 1) 138 111 echo command phase0_imfile.pl --exp_tag $EXP_TAG --class_id $CLASS_ID --uri $URI … … 143 116 # success 144 117 task.exit 0 145 # phase0 imfile.pl updates DB tables, here we just update the queue146 queuepush Phase0Imfiles -replace -key 1 "DONE $options:0"118 # phase0_imfile.pl updates DB tables, here we just update the queue 119 book setword Phase0Imfiles $options:0 state DONE 147 120 end 148 121 … … 150 123 task.exit default 151 124 showcommand failure 152 queuepush Phase0Imfiles -replace -key 1 "FAIL $options:0" 153 $Phase0ImfileFail ++ 125 book setword Phase0Imfiles $options:0 state FAIL 154 126 end 155 127 … … 157 129 task.exit timeout 158 130 showcommand timeout 159 queuepush Phase0Imfiles -replace -key 1 "TIMEOUT $options:0" 160 $Phase0ImfileFail ++ 161 end 162 end 163 164 165 166 ## these tasks use the queue Phase0Exposures 167 ## the Phase0Exposures queue contains: 168 ## STATE EXP_TAG CAMERA TELESCOPE TYPE NCLASS 169 170 # select images ready for phase0 analysis 171 # new entries are added to queue Phase0Exposures 172 # compare the new list with the ones already selected 131 book setword Phase0Imfiles $options:0 state TIMEOUT 132 end 133 end 134 135 # select exposures ready for phase0_exp.pl 173 136 task phase0.exp.load 174 137 host local … … 182 145 183 146 task.exec 184 command p0tool -pendingexp - simple -limit {$Phase0ExpFail + 20}147 command p0tool -pendingexp -limit 20 185 148 end 186 149 187 150 # success 188 151 task.exit 0 189 local i Nqueue 190 191 # compare output with Phase0Exposures queue 192 # only add entries which don't exist in queue 193 queuesize stdout -var Nqueue 194 for i 0 $Nqueue 195 queuepop stdout -var line 196 if ($VERBOSE > 2) 197 echo $line 198 end 199 list word -split $line 200 $EXP_TAG = $word:0 201 # $EXP_ID = $word:1 202 # $CAMERA = $word:2 203 # $TELESCOPE = $word:3 204 # $DATEOBS = $word:4 205 # $TYPE = $word:5 206 # $IMFILES = $word:6 207 queuepush Phase0Exposures -uniq -key 1 "NEW $EXP_TAG" 152 # convert 'stdout' to book format 153 ipptool2book stdout Phase0Exposures -key exp_tag -uniq 154 if ($VERBOSE > 2) 155 book listbook Phase0Exposures 208 156 end 209 157 210 158 # delete existing entries which are DONE 211 queuedrop Phase0Exposures -key 0DONE159 book delpage Phase0Exposures -key state DONE 212 160 end 213 161 214 162 # default exit status 215 163 task.exit default 216 showcommand 217 end 218 219 # operation times out? 220 task.exit timeout 221 showcommand 222 end 223 end 224 225 226 227 # run the phase0imfile script on pending images 164 showcommand failure 165 end 166 167 # operation times out? 168 task.exit timeout 169 showcommand timeout 170 end 171 end 172 173 # run the phase0_exp.pl script on pending exposures 228 174 task phase0.exp.run 229 175 periods -poll $runpoll … … 232 178 233 179 task.exec 234 queuesizePhase0Exposures -var N180 book npages Phase0Exposures -var N 235 181 if ($N == 0) break 236 182 if ($network == 0) break 237 183 238 # look for new images on the internal DetrendImfilesToProcess queue239 # caution with these 'if' statements: syntax errors240 # will make the task fail without given a good status241 queuepop Phase0Exposures -var line -key 0 NEW 242 if ("$line" == "NULL") break243 244 strpop line state 245 queuepush Phase0Exposures -replace -key 1 "RUN $line"246 247 ## the Phase0Exposures queue contains:248 ## STATE EXP_TAG CAMERA TELESCOPE TYPE NCLASS249 list word -split $line250 $EXP_TAG = $word:0184 # look for new images in Phase0Exposures (state == NULL) 185 book getpage Phase0Exposures 0 -var pageName -key state NULL 186 if ($pageName == NULL) break 187 188 book setword Phase0Exposures $pageName state RUN 189 book getword Phase0Exposures $pageName exp_tag -var EXP_TAG 190 191 # specify choice of remote host:(need to choose based on chips) 192 if ($parallel) 193 host anyhost 194 else 195 host local 196 end 251 197 252 198 # XXX this is still a lame rule … … 258 204 exec mkdir -p $LOGSUBDIR/$base 259 205 260 # specify choice of remote host:(need to choose based on chips) 261 if ($parallel) 262 host anyhost 263 else 264 host local 265 end 206 # save the pageName for future reference below 207 options $pageName 266 208 267 209 # create the command line 268 options "$line"269 210 if ($VERBOSE > 1) 270 211 echo command phase0_exp.pl --exp_tag $EXP_TAG … … 276 217 task.exit 0 277 218 # phase0exp.pl updates DB tables, here we just update the queue 278 queuepush Phase0Exposures -replace -key 1 "DONE $options:0"219 book setword Phase0Exposures $options:0 state DONE 279 220 end 280 221 … … 282 223 task.exit default 283 224 showcommand 284 queuepush Phase0Exposures -replace -key 1 "FAIL $options:0" 285 $Phase0ExpFail 225 book setword Phase0Exposures $options:0 state FAIL 286 226 end 287 227 … … 289 229 task.exit timeout 290 230 showcommand 291 queuepush Phase0Exposures -replace -key 1 "TIMEOUT $options:0" 292 $Phase0ExpFail 231 book setword Phase0Exposures $options:0 state TIMEOUT 293 232 end 294 233 end
Note:
See TracChangeset
for help on using the changeset viewer.
