Changeset 18787
- Timestamp:
- Jul 30, 2008, 11:53:27 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/fake.pro (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/fake.pro
r18607 r18787 7 7 8 8 book init fakePendingImfile 9 book init fakePendingExp 9 10 10 11 macro fake.status 11 12 book listbook fakePendingImfile 13 book listbook fakePendingExp 12 14 end 13 15 14 16 macro fake.reset 15 17 book init fakePendingImfile 18 book init fakePendingExp 16 19 end 17 20 … … 23 26 active true 24 27 end 28 task fake.exp.load 29 active true 30 end 31 task fake.exp.run 32 active true 33 end 25 34 end 26 35 … … 32 41 active false 33 42 end 43 task fake.exp.load 44 active false 45 end 46 task fake.exp.run 47 active false 48 end 34 49 end 35 50 36 51 # this variable will cycle through the known database names 37 $fake_DB = 0 52 $fakeImfile_DB = 0 53 $fakeExp_DB = 0 38 54 39 55 # select images ready for fake analysis … … 57 73 else 58 74 # save the DB name for the exit tasks 59 option $DB:$fake _DB60 command faketool -pendingimfile -limit 20 -dbname $DB:$fake _DB61 $fake _DB ++62 if ($fake _DB >= $DB:n) set fake_DB = 075 option $DB:$fakeImfile_DB 76 command faketool -pendingimfile -limit 20 -dbname $DB:$fakeImfile_DB 77 $fakeImfile_DB ++ 78 if ($fakeImfile_DB >= $DB:n) set fakeImfile_DB = 0 63 79 end 64 80 end … … 153 169 end 154 170 end 171 172 173 174 175 # select exposures ready for fake analysis 176 # new entries are added to fakePendingExp 177 # skip already-present entries 178 task fake.exp.load 179 host local 180 181 periods -poll $LOADPOLL 182 periods -exec $LOADEXEC 183 periods -timeout 30 184 npending 1 185 186 stdout NULL 187 stderr $LOGDIR/fake.exp.log 188 189 task.exec 190 if ($DB:n == 0) 191 option DEFAULT 192 command faketool -pendingexp -limit 20 193 else 194 # save the DB name for the exit tasks 195 option $DB:$fakeExp_DB 196 command faketool -pendingexp -limit 20 -dbname $DB:$fakeExp_DB 197 $fakeExp_DB ++ 198 if ($fakeExp_DB >= $DB:n) set fakeExp_DB = 0 199 end 200 end 201 202 # success 203 task.exit 0 204 # convert 'stdout' to book format 205 ipptool2book stdout fakePendingExp -key fake_id -uniq -setword dbname $options:0 -setword pantaskState INIT 206 if ($VERBOSE > 2) 207 book listbook fakePendingExp 208 end 209 210 # delete existing entries in the appropriate pantaskStates 211 process_cleanup fakePendingExp 212 end 213 214 # locked list 215 task.exit default 216 showcommand failure 217 end 218 219 # operation times out? 220 task.exit timeout 221 showcommand timeout 222 end 223 end 224 225 # run the fake_exp.pl script on pending images 226 task fake.exp.run 227 periods -poll $RUNPOLL 228 periods -exec $RUNEXEC 229 periods -timeout 60 230 231 task.exec 232 book npages fakePendingExp -var N 233 if ($N == 0) break 234 if ($NETWORK == 0) break 235 236 # look for new exposures in fakePendingExp (pantaskState == INIT) 237 book getpage fakePendingExp 0 -var pageName -key pantaskState INIT 238 if ("$pageName" == "NULL") break 239 240 book setword fakePendingExp $pageName pantaskState RUN 241 book getword fakePendingExp $pageName camera -var CAMERA 242 book getword fakePendingExp $pageName exp_id -var EXP_ID 243 book getword fakePendingExp $pageName exp_tag -var EXP_TAG 244 book getword fakePendingExp $pageName fake_id -var FAKE_ID 245 book getword fakePendingExp $pageName workdir -var WORKDIR_TEMPLATE 246 book getword fakePendingExp $pageName dbname -var DBNAME 247 book getword fakePendingExp $pageName reduction -var REDUCTION 248 249 # specify choice of local or remote host based on camera and fake 250 set.host.for.camera $CAMERA FPA 251 252 # set the WORKDIR variable 253 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 254 255 ## generate outroot specific to this exposure (& chip) 256 sprintf outroot "%s/%s/%s.fk.%s" $WORKDIR $EXP_TAG $EXP_TAG $FAKE_ID 257 258 stderr $LOGDIR/fake.exp.log 259 stderr $LOGDIR/fake.exp.log 260 261 $run = fake_exp.pl --exp_id $EXP_ID --fake_id $FAKE_ID --camera $CAMERA --outroot $outroot 262 if ("$REDUCTION" != "NULL") 263 $run = $run --reduction $REDUCTION 264 end 265 add_standard_args run 266 267 # save the pageName for future reference below 268 options $pageName 269 270 # create the command line 271 if ($VERBOSE > 1) 272 echo command $run 273 end 274 command $run 275 end 276 277 # default exit status 278 task.exit default 279 process_exit fakePendingExp $options:0 $JOB_STATUS 280 end 281 282 # operation timed out? 283 task.exit timeout 284 showcommand timeout 285 book setword fakePendingExp $options:0 pantaskState TIMEOUT 286 end 287 end
Note:
See TracChangeset
for help on using the changeset viewer.
