IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippTasks/stack.pro

    r23230 r25027  
    1010### Initialise the books containing the tasks to do
    1111book init stackSumSkyfile
    12 book init stackCleanup
     12#book init stackCleanup
    1313
    1414### Database lists
    1515$stackSkycell_DB = 0
    16 $stackCleanup_DB = 0
     16#$stackCleanup_DB = 0
    1717
    1818### Check status of stacking tasks
    1919macro stack.status
    2020  book listbook stackSumSkyfile
    21   book listbook stackCleanup
     21#  book listbook stackCleanup
    2222end
    2323
     
    2525macro stack.reset
    2626  book init stackSumSkyfile
    27   book init stackCleanup
     27#  book init stackCleanup
    2828end
    2929
     
    4848end
    4949
    50 macro stack.cleanup.on
    51   task stack.cleanup.load
    52     active true
    53   end
    54   task stack.cleanup.run
    55     active true
    56   end
    57 end
    58 
    59 macro stack.cleanup.off
    60   task stack.cleanup.load
    61     active false
    62   end
    63   task stack.cleanup.run
    64     active false
    65   end
    66 end
     50# macro stack.cleanup.on
     51#   task stack.cleanup.load
     52#     active true
     53#   end
     54#   task stack.cleanup.run
     55#     active true
     56#   end
     57# end
     58
     59# macro stack.cleanup.off
     60#   task stack.cleanup.load
     61#     active false
     62#   end
     63#   task stack.cleanup.run
     64#     active false
     65#   end
     66# end
    6767
    6868
     
    8181
    8282  task.exec
     83    if ($LABEL:n == 0) break
    8384    $run = stacktool -tosum
    8485    if ($DB:n == 0)
     
    9293    end
    9394    add_poll_args run
     95    add_poll_labels run
    9496    command $run
    9597  end
     
    143145    book getword stackSumSkyfile $pageName skycell_id -var SKYCELL_ID
    144146    book getword stackSumSkyfile $pageName workdir -var WORKDIR_TEMPLATE
     147    book getword stackSumSkyfile $pageName reduction -var REDUCTION
    145148    book getword stackSumSkyfile $pageName dbname -var DBNAME
    146149    book getword stackSumSkyfile $pageName state -var RUN_STATE
     
    161164
    162165    $run = stack_skycell.pl --threads @MAX_THREADS@ --stack_id $STACK_ID --outroot $outroot --redirect-output --run-state $RUN_STATE
     166    if ("$REDUCTION" != "NULL")
     167      $run = $run --reduction $REDUCTION
     168    end
    163169    add_standard_args run
    164170
     
    193199
    194200
    195 # select images ready for stack analysis
    196 # new entries are added to stackCleanup
    197 # skip already-present entries
    198 task           stack.cleanup.load
    199   host         local
    200 
    201   periods      -poll $LOADPOLL
    202   periods      -exec $LOADEXEC
    203   periods      -timeout 30
    204   npending     1
    205   active       false
    206 
    207   stdout NULL
    208   stderr $LOGDIR/stack.cleanup.log
    209 
    210   task.exec
    211     $run = stacktool -pendingcleanuprun
    212     if ($DB:n == 0)
    213       option DEFAULT
    214     else
    215       # save the DB name for the exit tasks
    216       option $DB:$stackCleanup_DB
    217       $run = $run -dbname $DB:$stackCleanup_DB
    218       $stackCleanup_DB ++
    219       if ($stackCleanup_DB >= $DB:n) set stackCleanup_DB = 0
    220     end
    221     add_poll_args run
    222     command $run
    223   end
    224 
    225   # success
    226   task.exit    0
    227     # convert 'stdout' to book format
    228     ipptool2book stdout stackCleanup -key stack_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    229     if ($VERBOSE > 2)
    230       book listbook stackCleanup
    231     end
    232 
    233     # delete existing entries in the appropriate pantaskStates
    234     process_cleanup stackCleanup
    235   end
    236 
    237   # locked list
    238   task.exit    default
    239     showcommand failure
    240   end
    241 
    242   task.exit    crash
    243     showcommand crash
    244   end
    245 
    246   # operation times out?
    247   task.exit    timeout
    248     showcommand timeout
    249   end
    250 end
    251 
    252 # run the ipp_cleanup.pl script on pending images
    253 task           stack.cleanup.run
    254   periods      -poll $RUNPOLL
    255   periods      -exec $RUNEXEC
    256   periods      -timeout 60
    257   active       false
    258 
    259   task.exec
    260     book npages stackCleanup -var N
    261     if ($N == 0) break
    262     if ($NETWORK == 0) break
     201# # select images ready for stack analysis
     202# # new entries are added to stackCleanup
     203# # skip already-present entries
     204# task         stack.cleanup.load
     205#   host         local
     206
     207#   periods      -poll $LOADPOLL
     208#   periods      -exec $LOADEXEC
     209#   periods      -timeout 30
     210#   npending     1
     211#   active       false
     212
     213#   stdout NULL
     214#   stderr $LOGDIR/stack.cleanup.log
     215
     216#   task.exec
     217#     if ($LABEL:n == 0) break
     218#     $run = stacktool -pendingcleanuprun
     219#     if ($DB:n == 0)
     220#       option DEFAULT
     221#     else
     222#       # save the DB name for the exit tasks
     223#       option $DB:$stackCleanup_DB
     224#       $run = $run -dbname $DB:$stackCleanup_DB
     225#       $stackCleanup_DB ++
     226#       if ($stackCleanup_DB >= $DB:n) set stackCleanup_DB = 0
     227#     end
     228#     add_poll_args run
     229#     add_poll_labels run
     230#     command $run
     231#   end
     232
     233#   # success
     234#   task.exit    0
     235#     # convert 'stdout' to book format
     236#     ipptool2book stdout stackCleanup -key stack_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     237#     if ($VERBOSE > 2)
     238#       book listbook stackCleanup
     239#     end
     240
     241#     # delete existing entries in the appropriate pantaskStates
     242#     process_cleanup stackCleanup
     243#   end
     244
     245#   # locked list
     246#   task.exit    default
     247#     showcommand failure
     248#   end
     249
     250#   task.exit    crash
     251#     showcommand crash
     252#   end
     253
     254#   # operation times out?
     255#   task.exit    timeout
     256#     showcommand timeout
     257#   end
     258# end
     259
     260# # run the ipp_cleanup.pl script on pending images
     261# task         stack.cleanup.run
     262#   periods      -poll $RUNPOLL
     263#   periods      -exec $RUNEXEC
     264#   periods      -timeout 60
     265#   active       false
     266
     267#   task.exec
     268#     book npages stackCleanup -var N
     269#     if ($N == 0) break
     270#     if ($NETWORK == 0) break
    263271   
    264     # look for new images in stackCleanup (pantaskState == INIT)
    265     book getpage stackCleanup 0 -var pageName -key pantaskState INIT
    266     if ("$pageName" == "NULL") break
    267 
    268     book setword stackCleanup $pageName pantaskState RUN
    269     book getword stackCleanup $pageName camera -var CAMERA
    270     book getword stackCleanup $pageName state -var CLEANUP_MODE
    271     book getword stackCleanup $pageName stack_id -var STACK_ID
    272     book getword stackCleanup $pageName dbname -var DBNAME
    273 
    274     # specify choice of local or remote host based on camera and stack (class_id)
    275     set.host.for.camera $CAMERA FPA
    276 
    277     stdout $LOGDIR/stack.cleanup.log
    278     stderr $LOGDIR/stack.cleanup.log
    279 
    280     # XXX is everything listed here needed?
    281     $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE
    282     add_standard_args run
    283 
    284     # save the pageName for future reference below
    285     options $pageName
    286 
    287     # create the command line
    288     if ($VERBOSE > 1)
    289       echo command $run
    290     end
    291     command $run
    292   end
    293 
    294   # default exit status
    295   task.exit    default
    296     process_exit stackCleanup $options:0 $JOB_STATUS
    297   end
    298 
    299   task.exit    crash
    300     showcommand crash
    301     book setword stackCleanup $options:0 pantaskState CRASH
    302   end
    303 
    304   # operation timed out?
    305   task.exit    timeout
    306     showcommand timeout
    307     book setword stackCleanup $options:0 pantaskState TIMEOUT
    308   end
    309 end
     272#     # look for new images in stackCleanup (pantaskState == INIT)
     273#     book getpage stackCleanup 0 -var pageName -key pantaskState INIT
     274#     if ("$pageName" == "NULL") break
     275
     276#     book setword stackCleanup $pageName pantaskState RUN
     277#     book getword stackCleanup $pageName camera -var CAMERA
     278#     book getword stackCleanup $pageName state -var CLEANUP_MODE
     279#     book getword stackCleanup $pageName stack_id -var STACK_ID
     280#     book getword stackCleanup $pageName dbname -var DBNAME
     281
     282#     # specify choice of local or remote host based on camera and stack (class_id)
     283#     set.host.for.camera $CAMERA FPA
     284
     285#     stdout $LOGDIR/stack.cleanup.log
     286#     stderr $LOGDIR/stack.cleanup.log
     287
     288#     # XXX is everything listed here needed?
     289#     $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE
     290#     add_standard_args run
     291
     292#     # save the pageName for future reference below
     293#     options $pageName
     294
     295#     # create the command line
     296#     if ($VERBOSE > 1)
     297#       echo command $run
     298#     end
     299#     command $run
     300#   end
     301
     302#   # default exit status
     303#   task.exit    default
     304#     process_exit stackCleanup $options:0 $JOB_STATUS
     305#   end
     306
     307#   task.exit    crash
     308#     showcommand crash
     309#     book setword stackCleanup $options:0 pantaskState CRASH
     310#   end
     311
     312#   # operation timed out?
     313#   task.exit    timeout
     314#     showcommand timeout
     315#     book setword stackCleanup $options:0 pantaskState TIMEOUT
     316#   end
     317# end
Note: See TracChangeset for help on using the changeset viewer.