IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 25, 2009, 4:22:33 PM (17 years ago)
Author:
watersc1
Message:

Commented out clean up stages, and moved that code to science.cleanup.pro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/fake.pro

    r24098 r24595  
    77
    88book init fakePendingImfile
    9 book init fakePendingCleanup
     9#book init fakePendingCleanup
    1010
    1111macro fake.status
    1212  book listbook fakePendingImfile
    13   book listbook fakePendingCleanup
     13#  book listbook fakePendingCleanup
    1414end
    1515
    1616macro fake.reset
    1717  book init fakePendingImfile
    18   book init fakePendingCleanup
     18#  book init fakePendingCleanup
    1919end
    2020
     
    4343end
    4444
    45 macro fake.cleanup.on
    46   task fake.cleanup.load
    47     active true
    48   end
    49   task fake.cleanup.run
    50     active true
    51   end
    52 end
    53 
    54 macro fake.cleanup.off
    55   task fake.cleanup.load
    56     active false
    57   end
    58   task fake.cleanup.run
    59     active false
    60   end
    61 end
     45# macro fake.cleanup.on
     46#   task fake.cleanup.load
     47#     active true
     48#   end
     49#   task fake.cleanup.run
     50#     active true
     51#   end
     52# end
     53
     54# macro fake.cleanup.off
     55#   task fake.cleanup.load
     56#     active false
     57#   end
     58#   task fake.cleanup.run
     59#     active false
     60#   end
     61# end
    6262
    6363# this variable will cycle through the known database names
     
    249249end
    250250
    251 # this variable will cycle through the known database names
    252 $fake_cleanup_DB = 0
    253 
    254 # select images ready for fake analysis
    255 # new entries are added to fakePendingImfile
    256 # skip already-present entries
    257 task           fake.cleanup.load
    258   host         local
    259 
    260   periods      -poll $LOADPOLL
    261   periods      -exec $LOADEXEC
    262   periods      -timeout 30
    263   npending     1
    264   active       false
    265 
    266   stdout NULL
    267   stderr $LOGDIR/fake.cleanup.log
    268 
    269   task.exec
    270     if ($LABEL:n == 0) break
    271     $run = faketool -pendingcleanuprun
    272     if ($DB:n == 0)
    273       option DEFAULT
    274       command
    275     else
    276       # save the DB name for the exit tasks
    277       option $DB:$fake_cleanup_DB
    278       $run = $run -dbname $DB:$fake_cleanup_DB
    279       $fake_cleanup_DB ++
    280       if ($fake_cleanup_DB >= $DB:n) set fake_cleanup_DB = 0
    281     end
    282     add_poll_args run
    283     add_poll_labels run
    284     command $run
    285   end
    286 
    287   # success
    288   task.exit    0
    289     # convert 'stdout' to book format
    290     ipptool2book stdout fakePendingCleanup -key fake_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    291     if ($VERBOSE > 2)
    292       book listbook fakePendingCleanup
    293     end
    294 
    295     # delete existing entries in the appropriate pantaskStates
    296     process_cleanup fakePendingCleanup
    297   end
    298 
    299   # locked list
    300   task.exit    default
    301     showcommand failure
    302   end
    303 
    304   task.exit    crash
    305     showcommand crash
    306   end
    307 
    308   # operation times out?
    309   task.exit    timeout
    310     showcommand timeout
    311   end
    312 end
    313 
    314 # run the ipp_cleanup.pl script on pending images
    315 task           fake.cleanup.run
    316   periods      -poll $RUNPOLL
    317   periods      -exec $RUNEXEC
    318   periods      -timeout 60
    319   active       false
    320 
    321   task.exec
    322     book npages fakePendingCleanup -var N
    323     if ($N == 0) break
    324     if ($NETWORK == 0) break
     251# # this variable will cycle through the known database names
     252# $fake_cleanup_DB = 0
     253
     254# # select images ready for fake analysis
     255# # new entries are added to fakePendingImfile
     256# # skip already-present entries
     257# task         fake.cleanup.load
     258#   host         local
     259
     260#   periods      -poll $LOADPOLL
     261#   periods      -exec $LOADEXEC
     262#   periods      -timeout 30
     263#   npending     1
     264#   active       false
     265
     266#   stdout NULL
     267#   stderr $LOGDIR/fake.cleanup.log
     268
     269#   task.exec
     270#     if ($LABEL:n == 0) break
     271#     $run = faketool -pendingcleanuprun
     272#     if ($DB:n == 0)
     273#       option DEFAULT
     274#       command
     275#     else
     276#       # save the DB name for the exit tasks
     277#       option $DB:$fake_cleanup_DB
     278#       $run = $run -dbname $DB:$fake_cleanup_DB
     279#       $fake_cleanup_DB ++
     280#       if ($fake_cleanup_DB >= $DB:n) set fake_cleanup_DB = 0
     281#     end
     282#     add_poll_args run
     283#     add_poll_labels run
     284#     command $run
     285#   end
     286
     287#   # success
     288#   task.exit    0
     289#     # convert 'stdout' to book format
     290#     ipptool2book stdout fakePendingCleanup -key fake_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     291#     if ($VERBOSE > 2)
     292#       book listbook fakePendingCleanup
     293#     end
     294
     295#     # delete existing entries in the appropriate pantaskStates
     296#     process_cleanup fakePendingCleanup
     297#   end
     298
     299#   # locked list
     300#   task.exit    default
     301#     showcommand failure
     302#   end
     303
     304#   task.exit    crash
     305#     showcommand crash
     306#   end
     307
     308#   # operation times out?
     309#   task.exit    timeout
     310#     showcommand timeout
     311#   end
     312# end
     313
     314# # run the ipp_cleanup.pl script on pending images
     315# task         fake.cleanup.run
     316#   periods      -poll $RUNPOLL
     317#   periods      -exec $RUNEXEC
     318#   periods      -timeout 60
     319#   active       false
     320
     321#   task.exec
     322#     book npages fakePendingCleanup -var N
     323#     if ($N == 0) break
     324#     if ($NETWORK == 0) break
    325325   
    326     # look for new images in fakePendingCleanup (pantaskState == INIT)
    327     book getpage fakePendingCleanup 0 -var pageName -key pantaskState INIT
    328     if ("$pageName" == "NULL") break
    329 
    330     book setword fakePendingCleanup $pageName pantaskState RUN
    331     book getword fakePendingCleanup $pageName camera -var CAMERA
    332     book getword fakePendingCleanup $pageName state -var CLEANUP_MODE
    333     book getword fakePendingCleanup $pageName fake_id -var FAKE_ID
    334     book getword fakePendingCleanup $pageName dbname -var DBNAME
    335 
    336     # specify choice of local or remote host based on camera and fake (class_id)
    337     set.host.for.camera $CAMERA FPA
    338 
    339     stdout $LOGDIR/fake.cleanup.log
    340     stderr $LOGDIR/fake.cleanup.log
    341 
    342     # XXX is everything listed here needed?
    343     $run = ipp_cleanup.pl --stage fake --stage_id $FAKE_ID --camera $CAMERA --mode $CLEANUP_MODE
    344     add_standard_args run
    345 
    346     # save the pageName for future reference below
    347     options $pageName
    348 
    349     # create the command line
    350     if ($VERBOSE > 1)
    351       echo command $run
    352     end
    353     command $run
    354   end
    355 
    356   # default exit status
    357   task.exit    default
    358     process_exit fakePendingCleanup $options:0 $JOB_STATUS
    359   end
    360 
    361   task.exit    crash
    362     showcommand crash
    363     book setword fakePendingCleanup $options:0 pantaskState CRASH
    364   end
    365 
    366   # operation timed out?
    367   task.exit    timeout
    368     showcommand timeout
    369     book setword fakePendingCleanup $options:0 pantaskState TIMEOUT
    370   end
    371 end
     326#     # look for new images in fakePendingCleanup (pantaskState == INIT)
     327#     book getpage fakePendingCleanup 0 -var pageName -key pantaskState INIT
     328#     if ("$pageName" == "NULL") break
     329
     330#     book setword fakePendingCleanup $pageName pantaskState RUN
     331#     book getword fakePendingCleanup $pageName camera -var CAMERA
     332#     book getword fakePendingCleanup $pageName state -var CLEANUP_MODE
     333#     book getword fakePendingCleanup $pageName fake_id -var FAKE_ID
     334#     book getword fakePendingCleanup $pageName dbname -var DBNAME
     335
     336#     # specify choice of local or remote host based on camera and fake (class_id)
     337#     set.host.for.camera $CAMERA FPA
     338
     339#     stdout $LOGDIR/fake.cleanup.log
     340#     stderr $LOGDIR/fake.cleanup.log
     341
     342#     # XXX is everything listed here needed?
     343#     $run = ipp_cleanup.pl --stage fake --stage_id $FAKE_ID --camera $CAMERA --mode $CLEANUP_MODE
     344#     add_standard_args run
     345
     346#     # save the pageName for future reference below
     347#     options $pageName
     348
     349#     # create the command line
     350#     if ($VERBOSE > 1)
     351#       echo command $run
     352#     end
     353#     command $run
     354#   end
     355
     356#   # default exit status
     357#   task.exit    default
     358#     process_exit fakePendingCleanup $options:0 $JOB_STATUS
     359#   end
     360
     361#   task.exit    crash
     362#     showcommand crash
     363#     book setword fakePendingCleanup $options:0 pantaskState CRASH
     364#   end
     365
     366#   # operation timed out?
     367#   task.exit    timeout
     368#     showcommand timeout
     369#     book setword fakePendingCleanup $options:0 pantaskState TIMEOUT
     370#   end
     371# end
Note: See TracChangeset for help on using the changeset viewer.