Changeset 19089 for trunk/ippTasks/diff.pro
- Timestamp:
- Aug 16, 2008, 1:06:59 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/diff.pro (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/diff.pro
r18509 r19089 8 8 check.globals 9 9 10 $LOGSUBDIR = $LOGDIR/diff11 exec mkdir -p $LOGSUBDIR12 13 10 ### Initialise the books containing the tasks to do 14 11 book init diffSkyfile 12 book init diffCleanup 15 13 16 14 ### Database lists 17 15 $diffSkycell_DB = 0 16 $diffCleanup_DB = 0 18 17 19 18 ### Check status of diffing tasks 20 19 macro diff.status 21 20 book listbook diffSkyfile 21 book listbook diffCleanup 22 22 end 23 23 … … 25 25 macro diff.reset 26 26 book init diffSkyfile 27 book init diffCleanup 27 28 end 28 29 … … 35 36 active true 36 37 end 38 task diff.cleanup.load 39 active true 40 end 41 task diff.cleanup.run 42 active true 43 end 37 44 end 38 45 … … 43 50 end 44 51 task diff.skycell.run 52 active false 53 end 54 task diff.cleanup.load 55 active false 56 end 57 task diff.cleanup.run 45 58 active false 46 59 end … … 59 72 60 73 stdout NULL 61 stderr $LOG SUBDIR/diff.skycell.log74 stderr $LOGDIR/diff.skycell.log 62 75 63 76 task.exec … … 122 135 123 136 ### XXX Instead of setting these by camera, need to set by skycell_id 137 ### XXX change these to use the --redirect scheme 124 138 # set.host.for.camera $CAMERA $DIFF_ID 125 139 # set.workdir.by.camera $CAMERA $DIFF_ID $WORKDIR_TEMPLATE $default_host WORKDIR … … 167 181 end 168 182 183 # select images ready for diff analysis 184 # new entries are added to diffPendingImfile 185 # skip already-present entries 186 task diff.cleanup.load 187 host local 188 189 periods -poll $LOADPOLL 190 periods -exec $LOADEXEC 191 periods -timeout 30 192 npending 1 193 active true 194 195 stdout NULL 196 stderr $LOGDIR/diff.cleanup.log 197 198 task.exec 199 if ($DB:n == 0) 200 option DEFAULT 201 command difftool -pendingcleanuprun -limit 20 202 else 203 # save the DB name for the exit tasks 204 option $DB:$diffCleanup_DB 205 command difftool -pendingcleanuprun -limit 20 -dbname $DB:$diffCleanup_DB 206 $diffCleanup_DB ++ 207 if ($diffCleanup_DB >= $DB:n) set diffCleanup_DB = 0 208 end 209 end 210 211 # success 212 task.exit 0 213 # convert 'stdout' to book format 214 ipptool2book stdout diffCleanup -key diff_id -uniq -setword dbname $options:0 -setword pantaskState INIT 215 if ($VERBOSE > 2) 216 book listbook diffCleanup 217 end 218 219 # delete existing entries in the appropriate pantaskStates 220 process_cleanup diffCleanup 221 end 222 223 # locked list 224 task.exit default 225 showcommand failure 226 end 227 228 # operation times out? 229 task.exit timeout 230 showcommand timeout 231 end 232 end 233 234 # run the ipp_cleanup.pl script on pending images 235 task diff.cleanup.run 236 periods -poll $RUNPOLL 237 periods -exec $RUNEXEC 238 periods -timeout 60 239 active true 240 241 task.exec 242 book npages diffCleanup -var N 243 if ($N == 0) break 244 if ($NETWORK == 0) break 245 246 # look for new images in diffCleanup (pantaskState == INIT) 247 book getpage diffCleanup 0 -var pageName -key pantaskState INIT 248 if ("$pageName" == "NULL") break 249 250 book setword diffCleanup $pageName pantaskState RUN 251 book getword diffCleanup $pageName camera -var CAMERA 252 book getword diffCleanup $pageName state -var CLEANUP_MODE 253 book getword diffCleanup $pageName diff_id -var DIFF_ID 254 book getword diffCleanup $pageName dbname -var DBNAME 255 256 # specify choice of local or remote host based on camera and diff (class_id) 257 set.host.for.camera $CAMERA FPA 258 259 stdout $LOGDIR/diff.cleanup.log 260 stderr $LOGDIR/diff.cleanup.log 261 262 # XXX is everything listed here needed? 263 $run = ipp_cleanup.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --mode $CLEANUP_MODE 264 add_standard_args run 265 266 # save the pageName for future reference below 267 options $pageName 268 269 # create the command line 270 if ($VERBOSE > 1) 271 echo command $run 272 end 273 command $run 274 end 275 276 # default exit status 277 task.exit default 278 process_exit diffCleanup $options:0 $JOB_STATUS 279 end 280 281 # operation timed out? 282 task.exit timeout 283 showcommand timeout 284 book setword diffCleanup $options:0 pantaskState TIMEOUT 285 end 286 end
Note:
See TracChangeset
for help on using the changeset viewer.
