IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34781


Ignore:
Timestamp:
Dec 7, 2012, 7:33:15 PM (14 years ago)
Author:
watersc1
Message:

Partially working copy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/ippTasks/bg.regeneration.pro

    r34745 r34781  
    9191      $run = $run -dbname $DB:$bgRegWarp_DB
    9292      $bgRegWarp_DB ++
    93       if ($bgRegWarp_DB >= $DB:nn) set bgRegWarp_DB = 0
     93      if ($bgRegWarp_DB >= $DB:n) set bgRegWarp_DB = 0
    9494    end
    9595    add_poll_args run
     
    103103  task.exit    0
    104104    # convert 'stdout' to book format
    105     ipptool2book stdout bgRegWarp -key warp_id:skycell_id -uniq -setword -dbname $options:0 -setword pantaskState INIT
     105    ipptool2book stdout bgRegWarp -key warp_id:skycell_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    106106    if ($VERBOSE > 2)
    107107      book listbook bgRegWarp
     
    148148    book getword bgRegWarp $pageName skycell_id -var SKYCELL_ID
    149149    book getword bgRegWarp $pageName camera -var CAMERA
     150    book getword bgRegWarp $pageName dbname -var DBNAME
    150151
    151152    set.host.for.skycell $SKYCELL_ID
     
    154155    stderr $LOGDIR/bgreg.warp.log
    155156
    156     $run = regenerate_background.pl --stage_id $STAGE_ID --skycell_id $SKYCELL_ID --camera $CAMERA
     157    $run = regenerate_background.pl --stage warp --stage_id $STAGE_ID --skycell_id $SKYCELL_ID --camera $CAMERA
    157158
    158159    add_standard_args run
     
    185186end
    186187
    187 
    188 # Load task for warp
    189 task            bgreg.warp.load
     188# Load task for stack
     189task            bgreg.stack.load
    190190  host          local
    191191
     
    196196
    197197  stdout        NULL
    198   stderr        $LOGDIR/bgreg.warp.load
     198  stderr        $LOGDIR/bgreg.stack.load
    199199
    200200  task.exec
    201201    if ($LABEL:n == 0) break
    202     $run = warptool -warped -background_model 0
    203     if ($DB:n == 0)
    204       option DEFAULT
    205     else
    206       #save the DB naem for the exit tasks
    207       option $DB:$bgRegWarp_DB
    208       $run = $run -dbname $DB:$bgRegWarp_DB
    209       $bgRegWarp_DB ++
    210       if ($bgRegWarp_DB >= $DB:nn) set bgRegWarp_DB = 0
    211     end
    212     add_poll_args run
    213     add_poll_labels run
    214     # change the limit?
    215     $run = $run -limit $POLL_LIMIT_BGREG
    216     command $run
    217   end
    218 
    219   # success
    220   task.exit    0
    221     # convert 'stdout' to book format
    222     ipptool2book stdout bgRegWarp -key warp_id:skycell_id -uniq -setword -dbname $options:0 -setword pantaskState INIT
    223     if ($VERBOSE > 2)
    224       book listbook bgRegWarp
    225     end
    226 
    227     # delete existing entries in the appropriate pantaskStates
    228     process_cleanup bgRegWarp
    229   end
    230 
    231   # locked list
    232   task.exit    default
    233     showcommand failure
    234   end
    235 
    236   task.exit    crash
    237     showcommand crash
    238   end
    239 
    240   # operation times out?
    241   task.exit    timeout
    242     showcommand timeout
    243   end
    244 end
    245 
    246 task           bgreg.warp.run
    247   periods      -poll $RUNPOLL
    248   periods      -exec $RUNEXEC
    249   periods      -timeout 60
    250 
    251   task.exec
    252     # if we can't exec, set the retry time long
    253     periods -exec $RUNEXEC
    254 
    255     book npages bgRegWarp -var N
    256     if ($N == 0) break
    257     if ($NETWORK == 0) break
    258 
    259     # look for new pages
    260     book getpage bgRegWarp 0 -var pageName -key pantaskState INIT
    261     if ("$pageName" == "NULL") break
    262 
    263     book setword bgRegWarp $pageName pantaskState RUN
    264     book getword bgRegWarp $pageName warp_id -var STAGE_ID
    265     book getword bgRegWarp $pageName skycell_id -var SKYCELL_ID
    266     book getword bgRegWarp $pageName camera -var CAMERA
    267 
    268     set.host.for.skycell $SKYCELL_ID
    269 
    270     stdout $LOGDIR/bgreg.warp.log
    271     stderr $LOGDIR/bgreg.warp.log
    272 
    273     $run = regenerate_background.pl --stage warp --stage_id $STAGE_ID --skycell_id $SKYCELL_ID --camera $CAMERA
    274 
    275     add_standard_args run
    276     options $pageName
    277 
    278     if ($VERBOSE > 1)
    279       echo command $run
    280     end
    281     periods -exec 0.05
    282     command $run
    283   end
    284 
    285   # default exit status
    286   task.exit        default
    287     process_exit bgRegWarp $options:0 $JOB_STATUS
    288   end
    289 
    290   # locked list
    291   task.exit        crash
    292     showcommand crash
    293     echo "hostname: $JOB_HOSTNAME"
    294     book setword bgRegWarp $options:0 pantasksState CRASH
    295   end
    296 
    297   # operation timed out
    298   task.exit        timeout
    299     showcommand timeout
    300     book setword bgRegWarp $options:0 pantaskState TIMEOUT
    301   end
    302 end
    303 
    304 # Load task for stack
    305 task            bgreg.stack.load
    306   host          local
    307 
    308   periods       -poll $LOADPOLL
    309   periods       -poll $LOADEXEC
    310   periods       -timeout 30
    311   npending      1
    312 
    313   stdout        NULL
    314   stderr        $LOGDIR/bgreg.stack.load
    315 
    316   task.exec
    317     if ($LABEL:n == 0) break
    318     $run = stacktool -sumskyfile -background_model 0
     202    $run = stacktool -tobkg
    319203    if ($DB:n == 0)
    320204      option DEFAULT
     
    324208      $run = $run -dbname $DB:$bgRegStack_DB
    325209      $bgRegStack_DB ++
    326       if ($bgRegStack_DB >= $DB:nn) set bgRegStack_DB = 0
     210      if ($bgRegStack_DB >= $DB:n) set bgRegStack_DB = 0
    327211    end
    328212    add_poll_args run
     
    336220  task.exit    0
    337221    # convert 'stdout' to book format
    338     ipptool2book stdout bgRegStack -key stack_id:skycell_id -uniq -setword -dbname $options:0 -setword pantaskState INIT
     222    ipptool2book stdout bgRegStack -key stack_id:skycell_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    339223    if ($VERBOSE > 2)
    340224      book listbook bgRegStack
     
    381265    book getword bgRegStack $pageName skycell_id -var SKYCELL_ID
    382266    book getword bgRegStack $pageName camera -var CAMERA
    383 
     267    book getword bgRegStack $pageName dbname -var DBNAME
    384268    set.host.for.skycell $SKYCELL_ID
    385269
Note: See TracChangeset for help on using the changeset viewer.