IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18945


Ignore:
Timestamp:
Aug 6, 2008, 1:15:06 PM (18 years ago)
Author:
eugene
Message:

adding cleanup tasks to science stages

Location:
branches/eam_branch_20080806/ippTasks
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080806/ippTasks/camera.pro

    r18607 r18945  
    77
    88book init camPendingExp
     9book init camPendingCleanup
    910
    1011macro camera.status
    1112  book listbook camPendingExp
     13  book listbook camPendingCleanup
    1214end
    1315
    1416macro camera.reset
    1517  book init camPendingExp
     18  book init camPendingCleanup
    1619end
    1720
     
    2326    active true
    2427  end
     28  task camera.cleanup.load
     29    active false
     30  end
     31  task camera.cleanup.run
     32    active false
     33  end
    2534end
    2635
     
    3039  end
    3140  task camera.exp.run
     41    active false
     42  end
     43  task camera.cleanup.load
     44    active false
     45  end
     46  task camera.cleanup.run
    3247    active false
    3348  end
     
    164179end
    165180
    166 ## XXX add a global path to output files 
     181# this variable will cycle through the known database names
     182$camera_cleanup_DB = 0
     183
     184# select images ready for cam analysis
     185# new entries are added to camPendingImfile
     186# skip already-present entries
     187task           camera.cleanup.load
     188  host         local
     189
     190  periods      -poll $LOADPOLL
     191  periods      -exec $LOADEXEC
     192  periods      -timeout 30
     193  npending     1
     194  active       true
     195
     196  stdout NULL
     197  stderr $LOGDIR/camera.cleanup.log
     198
     199  task.exec
     200    if ($DB:n == 0)
     201      option DEFAULT
     202      command camtool -pendingcleanuprun -limit 20
     203    else
     204      # save the DB name for the exit tasks
     205      option $DB:$camera_cleanup_DB
     206      command camtool -pendingcleanuprun -limit 20 -dbname $DB:$camera_cleanup_DB
     207      $camera_cleanup_DB ++
     208      if ($camera_cleanup_DB >= $DB:n) set camera_cleanup_DB = 0
     209    end
     210  end
     211
     212  # success
     213  task.exit    0
     214    # convert 'stdout' to book format
     215    ipptool2book stdout camPendingCleanup -key cam_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     216    if ($VERBOSE > 2)
     217      book listbook camPendingCleanup
     218    end
     219
     220    # delete existing entries in the appropriate pantaskStates
     221    process_cleanup camPendingCleanup
     222  end
     223
     224  # locked list
     225  task.exit    default
     226    showcommand failure
     227  end
     228
     229  # operation times out?
     230  task.exit    timeout
     231    showcommand timeout
     232  end
     233end
     234
     235# run the ipp_cleanup.pl script on pending images
     236task           camera.cleanup.run
     237  periods      -poll $RUNPOLL
     238  periods      -exec $RUNEXEC
     239  periods      -timeout 60
     240  active       true
     241
     242  task.exec
     243    book npages camPendingCleanup -var N
     244    if ($N == 0) break
     245    if ($NETWORK == 0) break
     246   
     247    # look for new images in camPendingCleanup (pantaskState == INIT)
     248    book getpage camPendingCleanup 0 -var pageName -key pantaskState INIT
     249    if ("$pageName" == "NULL") break
     250
     251    book setword camPendingCleanup $pageName pantaskState RUN
     252    book getword camPendingCleanup $pageName camera -var CAMERA
     253    book getword camPendingCleanup $pageName state  -var CLEANUP_MODE
     254    book getword camPendingCleanup $pageName cam_id -var CAM_ID
     255    book getword camPendingCleanup $pageName dbname -var DBNAME
     256
     257    # specify choice of local or remote host based on camera and cam (class_id)
     258    set.host.for.camera $CAMERA FPA
     259
     260    stdout $LOGDIR/camera.cleanup.log
     261    stderr $LOGDIR/camera.cleanup.log
     262
     263    # XXX is everything listed here needed?
     264    $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE
     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 camPendingCleanup $options:0 $JOB_STATUS
     280  end
     281
     282  # operation timed out?
     283  task.exit    timeout
     284    showcommand timeout
     285    book setword camPendingCleanup $options:0 pantaskState TIMEOUT
     286  end
     287end
  • branches/eam_branch_20080806/ippTasks/diff.pro

    r18509 r18945  
    1616### Database lists
    1717$diffSkycell_DB = 0
     18$diffCleanup_DB = 0
    1819
    1920### Check status of diffing tasks
    2021macro diff.status
    2122  book listbook diffSkyfile
     23  book listbook diffCleanup
    2224end
    2325
     
    2527macro diff.reset
    2628  book init diffSkyfile
     29  book init diffCleanup
    2730end
    2831
     
    3538    active true
    3639  end
     40  task diff.cleanup.load
     41    active true
     42  end
     43  task diff.cleanup.run
     44    active true
     45  end
    3746end
    3847
     
    4352  end
    4453  task diff.skycell.run
     54    active false
     55  end
     56  task diff.cleanup.load
     57    active false
     58  end
     59  task diff.cleanup.run
    4560    active false
    4661  end
     
    167182end
    168183
     184# select images ready for diff analysis
     185# new entries are added to diffPendingImfile
     186# skip already-present entries
     187task           diff.cleanup.load
     188  host         local
     189
     190  periods      -poll $LOADPOLL
     191  periods      -exec $LOADEXEC
     192  periods      -timeout 30
     193  npending     1
     194  active       true
     195
     196  stdout NULL
     197  stderr $LOGDIR/diff.cleanup.log
     198
     199  task.exec
     200    if ($DB:n == 0)
     201      option DEFAULT
     202      command difftool -pendingcleanuprun -limit 20
     203    else
     204      # save the DB name for the exit tasks
     205      option $DB:$diff_cleanup_DB
     206      command difftool -pendingcleanuprun -limit 20 -dbname $DB:$diff_cleanup_DB
     207      $diff_cleanup_DB ++
     208      if ($diff_cleanup_DB >= $DB:n) set diff_cleanup_DB = 0
     209    end
     210  end
     211
     212  # success
     213  task.exit    0
     214    # convert 'stdout' to book format
     215    ipptool2book stdout diffPendingCleanup -key diff_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     216    if ($VERBOSE > 2)
     217      book listbook diffPendingCleanup
     218    end
     219
     220    # delete existing entries in the appropriate pantaskStates
     221    process_cleanup diffPendingCleanup
     222  end
     223
     224  # locked list
     225  task.exit    default
     226    showcommand failure
     227  end
     228
     229  # operation times out?
     230  task.exit    timeout
     231    showcommand timeout
     232  end
     233end
     234
     235# run the ipp_cleanup.pl script on pending images
     236task           diff.cleanup.run
     237  periods      -poll $RUNPOLL
     238  periods      -exec $RUNEXEC
     239  periods      -timeout 60
     240  active       true
     241
     242  task.exec
     243    book npages diffPendingCleanup -var N
     244    if ($N == 0) break
     245    if ($NETWORK == 0) break
     246   
     247    # look for new images in diffPendingCleanup (pantaskState == INIT)
     248    book getpage diffPendingCleanup 0 -var pageName -key pantaskState INIT
     249    if ("$pageName" == "NULL") break
     250
     251    book setword diffPendingCleanup $pageName pantaskState RUN
     252    book getword diffPendingCleanup $pageName camera -var CAMERA
     253    book getword diffPendingCleanup $pageName state -var CLEANUP_MODE
     254    book getword diffPendingCleanup $pageName diff_id -var DIFF_ID
     255    book getword diffPendingCleanup $pageName dbname -var DBNAME
     256
     257    # specify choice of local or remote host based on camera and diff (class_id)
     258    set.host.for.camera $CAMERA FPA
     259
     260    stdout $LOGDIR/diff.cleanup.log
     261    stderr $LOGDIR/diff.cleanup.log
     262
     263    # XXX is everything listed here needed?
     264    $run = ipp_cleanup.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --mode $CLEANUP_MODE
     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 diffPendingCleanup $options:0 $JOB_STATUS
     280  end
     281
     282  # operation timed out?
     283  task.exit    timeout
     284    showcommand timeout
     285    book setword diffPendingCleanup $options:0 pantaskState TIMEOUT
     286  end
     287end
  • branches/eam_branch_20080806/ippTasks/fake.pro

    r18794 r18945  
    77
    88book init fakePendingImfile
     9book init fakePendingCleanup
    910
    1011macro fake.status
    1112  book listbook fakePendingImfile
     13  book listbook fakePendingCleanup
    1214end
    1315
    1416macro fake.reset
    1517  book init fakePendingImfile
     18  book init fakePendingCleanup
    1619end
    1720
     
    2326    active true
    2427  end
     28  task fake.cleanup.load
     29    active false
     30  end
     31  task fake.cleanup.run
     32    active false
     33  end
    2534end
    2635
     
    3039  end
    3140  task fake.imfile.run
     41    active false
     42  end
     43  task fake.cleanup.load
     44    active false
     45  end
     46  task fake.cleanup.run
    3247    active false
    3348  end
     
    154169end
    155170
    156 
     171# this variable will cycle through the known database names
     172$fake_cleanup_DB = 0
     173
     174# select images ready for fake analysis
     175# new entries are added to fakePendingImfile
     176# skip already-present entries
     177task           fake.cleanup.load
     178  host         local
     179
     180  periods      -poll $LOADPOLL
     181  periods      -exec $LOADEXEC
     182  periods      -timeout 30
     183  npending     1
     184  active       true
     185
     186  stdout NULL
     187  stderr $LOGDIR/fake.cleanup.log
     188
     189  task.exec
     190    if ($DB:n == 0)
     191      option DEFAULT
     192      command faketool -pendingcleanuprun -limit 20
     193    else
     194      # save the DB name for the exit tasks
     195      option $DB:$fake_cleanup_DB
     196      command faketool -pendingcleanuprun -limit 20 -dbname $DB:$fake_cleanup_DB
     197      $fake_cleanup_DB ++
     198      if ($fake_cleanup_DB >= $DB:n) set fake_cleanup_DB = 0
     199    end
     200  end
     201
     202  # success
     203  task.exit    0
     204    # convert 'stdout' to book format
     205    ipptool2book stdout fakePendingCleanup -key fake_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     206    if ($VERBOSE > 2)
     207      book listbook fakePendingCleanup
     208    end
     209
     210    # delete existing entries in the appropriate pantaskStates
     211    process_cleanup fakePendingCleanup
     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
     223end
     224
     225# run the ipp_cleanup.pl script on pending images
     226task           fake.cleanup.run
     227  periods      -poll $RUNPOLL
     228  periods      -exec $RUNEXEC
     229  periods      -timeout 60
     230  active       true
     231
     232  task.exec
     233    book npages fakePendingCleanup -var N
     234    if ($N == 0) break
     235    if ($NETWORK == 0) break
     236   
     237    # look for new images in fakePendingCleanup (pantaskState == INIT)
     238    book getpage fakePendingCleanup 0 -var pageName -key pantaskState INIT
     239    if ("$pageName" == "NULL") break
     240
     241    book setword fakePendingCleanup $pageName pantaskState RUN
     242    book getword fakePendingCleanup $pageName camera -var CAMERA
     243    book getword fakePendingCleanup $pageName state -var CLEANUP_MODE
     244    book getword fakePendingCleanup $pageName fake_id -var FAKE_ID
     245    book getword fakePendingCleanup $pageName dbname -var DBNAME
     246
     247    # specify choice of local or remote host based on camera and fake (class_id)
     248    set.host.for.camera $CAMERA FPA
     249
     250    stdout $LOGDIR/fake.cleanup.log
     251    stderr $LOGDIR/fake.cleanup.log
     252
     253    # XXX is everything listed here needed?
     254    $run = ipp_cleanup.pl --stage fake --stage_id $FAKE_ID --camera $CAMERA --mode $CLEANUP_MODE
     255    add_standard_args run
     256
     257    # save the pageName for future reference below
     258    options $pageName
     259
     260    # create the command line
     261    if ($VERBOSE > 1)
     262      echo command $run
     263    end
     264    command $run
     265  end
     266
     267  # default exit status
     268  task.exit    default
     269    process_exit fakePendingCleanup $options:0 $JOB_STATUS
     270  end
     271
     272  # operation timed out?
     273  task.exit    timeout
     274    showcommand timeout
     275    book setword fakePendingCleanup $options:0 pantaskState TIMEOUT
     276  end
     277end
  • branches/eam_branch_20080806/ippTasks/stack.pro

    r18488 r18945  
    1313### Initialise the books containing the tasks to do
    1414book init stackSumSkyfile
     15book init stackCleanup
    1516
    1617### Database lists
    1718$stackSkycell_DB = 0
     19$stackCleanup_DB = 0
    1820
    1921### Check status of stacking tasks
    2022macro stack.status
    2123  book listbook stackSumSkyfile
     24  book listbook stackCleanup
    2225end
    2326
     
    2528macro stack.reset
    2629  book init stackSumSkyfile
     30  book init stackCleanup
    2731end
    2832
     
    3539    active true
    3640  end
     41  task stack.cleanup.load
     42    active true
     43  end
     44  task stack.cleanup.run
     45    active true
     46  end
    3747end
    3848
     
    4353  end
    4454  task stack.skycell.run
     55    active false
     56  end
     57  task stack.cleanup.load
     58    active false
     59  end
     60  task stack.cleanup.run
    4561    active false
    4662  end
     
    168184end
    169185
     186
     187# select images ready for stack analysis
     188# new entries are added to stackCleanup
     189# skip already-present entries
     190task           stack.cleanup.load
     191  host         local
     192
     193  periods      -poll $LOADPOLL
     194  periods      -exec $LOADEXEC
     195  periods      -timeout 30
     196  npending     1
     197  active       true
     198
     199  stdout NULL
     200  stderr $LOGDIR/stack.cleanup.log
     201
     202  task.exec
     203    if ($DB:n == 0)
     204      option DEFAULT
     205      command stacktool -pendingcleanuprun -limit 20
     206    else
     207      # save the DB name for the exit tasks
     208      option $DB:$stack_cleanup_DB
     209      command stacktool -pendingcleanuprun -limit 20 -dbname $DB:$stack_cleanup_DB
     210      $stack_cleanup_DB ++
     211      if ($stack_cleanup_DB >= $DB:n) set stack_cleanup_DB = 0
     212    end
     213  end
     214
     215  # success
     216  task.exit    0
     217    # convert 'stdout' to book format
     218    ipptool2book stdout stackCleanup -key stack_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     219    if ($VERBOSE > 2)
     220      book listbook stackCleanup
     221    end
     222
     223    # delete existing entries in the appropriate pantaskStates
     224    process_cleanup stackCleanup
     225  end
     226
     227  # locked list
     228  task.exit    default
     229    showcommand failure
     230  end
     231
     232  # operation times out?
     233  task.exit    timeout
     234    showcommand timeout
     235  end
     236end
     237
     238# run the ipp_cleanup.pl script on pending images
     239task           stack.cleanup.run
     240  periods      -poll $RUNPOLL
     241  periods      -exec $RUNEXEC
     242  periods      -timeout 60
     243  active       true
     244
     245  task.exec
     246    book npages stackCleanup -var N
     247    if ($N == 0) break
     248    if ($NETWORK == 0) break
     249   
     250    # look for new images in stackCleanup (pantaskState == INIT)
     251    book getpage stackCleanup 0 -var pageName -key pantaskState INIT
     252    if ("$pageName" == "NULL") break
     253
     254    book setword stackCleanup $pageName pantaskState RUN
     255    book getword stackCleanup $pageName camera -var CAMERA
     256    book getword stackCleanup $pageName state -var CLEANUP_MODE
     257    book getword stackCleanup $pageName stack_id -var STACK_ID
     258    book getword stackCleanup $pageName dbname -var DBNAME
     259
     260    # specify choice of local or remote host based on camera and stack (class_id)
     261    set.host.for.camera $CAMERA FPA
     262
     263    stdout $LOGDIR/stack.cleanup.log
     264    stderr $LOGDIR/stack.cleanup.log
     265
     266    # XXX is everything listed here needed?
     267    $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE
     268    add_standard_args run
     269
     270    # save the pageName for future reference below
     271    options $pageName
     272
     273    # create the command line
     274    if ($VERBOSE > 1)
     275      echo command $run
     276    end
     277    command $run
     278  end
     279
     280  # default exit status
     281  task.exit    default
     282    process_exit stackCleanup $options:0 $JOB_STATUS
     283  end
     284
     285  # operation timed out?
     286  task.exit    timeout
     287    showcommand timeout
     288    book setword stackCleanup $options:0 pantaskState TIMEOUT
     289  end
     290end
  • branches/eam_branch_20080806/ippTasks/warp.pro

    r18916 r18945  
    1212book init warpInputExp
    1313book init warpPendingSkyCell
     14book init warpPendingCleanup
    1415
    1516### Database lists
    1617$warpExp_DB = 0
    1718$warpSkycell_DB = 0
     19$warpCleanup_DB = 0
    1820
    1921### Check status of warping tasks
     
    2123  book listbook warpInputExp
    2224  book listbook warpPendingSkyCell
     25  book listbook warpPendingCleanup
    2326end
    2427
     
    2730  book init warpInputExp
    2831  book init warpPendingSkyCell
     32  book init warpPendingCleanup
    2933end
    3034
     
    4347    active true
    4448  end
     49  task warp.cleanup.load
     50    active true
     51  end
     52  task warp.cleanup.run
     53    active true
     54  end
    4555end
    4656
     
    5767  end
    5868  task warp.skycell.run
     69    active false
     70  end
     71  task warp.cleanup.load
     72    active false
     73  end
     74  task warp.cleanup.run
    5975    active false
    6076  end
     
    283299end
    284300
     301# select images ready for warp analysis
     302# new entries are added to warpPendingImfile
     303# skip already-present entries
     304task           warp.cleanup.load
     305  host         local
     306
     307  periods      -poll $LOADPOLL
     308  periods      -exec $LOADEXEC
     309  periods      -timeout 30
     310  npending     1
     311  active       true
     312
     313  stdout NULL
     314  stderr $LOGDIR/warp.cleanup.log
     315
     316  task.exec
     317    if ($DB:n == 0)
     318      option DEFAULT
     319      command warptool -pendingcleanuprun -limit 20
     320    else
     321      # save the DB name for the exit tasks
     322      option $DB:$warp_cleanup_DB
     323      command warptool -pendingcleanuprun -limit 20 -dbname $DB:$warp_cleanup_DB
     324      $warp_cleanup_DB ++
     325      if ($warp_cleanup_DB >= $DB:n) set warp_cleanup_DB = 0
     326    end
     327  end
     328
     329  # success
     330  task.exit    0
     331    # convert 'stdout' to book format
     332    ipptool2book stdout warpPendingCleanup -key warp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     333    if ($VERBOSE > 2)
     334      book listbook warpPendingCleanup
     335    end
     336
     337    # delete existing entries in the appropriate pantaskStates
     338    process_cleanup warpPendingCleanup
     339  end
     340
     341  # locked list
     342  task.exit    default
     343    showcommand failure
     344  end
     345
     346  # operation times out?
     347  task.exit    timeout
     348    showcommand timeout
     349  end
     350end
     351
     352# run the ipp_cleanup.pl script on pending images
     353task           warp.cleanup.run
     354  periods      -poll $RUNPOLL
     355  periods      -exec $RUNEXEC
     356  periods      -timeout 60
     357  active       true
     358
     359  task.exec
     360    book npages warpPendingCleanup -var N
     361    if ($N == 0) break
     362    if ($NETWORK == 0) break
     363   
     364    # look for new images in warpPendingCleanup (pantaskState == INIT)
     365    book getpage warpPendingCleanup 0 -var pageName -key pantaskState INIT
     366    if ("$pageName" == "NULL") break
     367
     368    book setword warpPendingCleanup $pageName pantaskState RUN
     369    book getword warpPendingCleanup $pageName camera -var CAMERA
     370    book getword warpPendingCleanup $pageName state -var CLEANUP_MODE
     371    book getword warpPendingCleanup $pageName warp_id -var WARP_ID
     372    book getword warpPendingCleanup $pageName dbname -var DBNAME
     373
     374    # specify choice of local or remote host based on camera and warp (class_id)
     375    set.host.for.camera $CAMERA FPA
     376
     377    stdout $LOGDIR/warp.cleanup.log
     378    stderr $LOGDIR/warp.cleanup.log
     379
     380    # XXX is everything listed here needed?
     381    $run = ipp_cleanup.pl --stage warp --stage_id $WARP_ID --camera $CAMERA --mode $CLEANUP_MODE
     382    add_standard_args run
     383
     384    # save the pageName for future reference below
     385    options $pageName
     386
     387    # create the command line
     388    if ($VERBOSE > 1)
     389      echo command $run
     390    end
     391    command $run
     392  end
     393
     394  # default exit status
     395  task.exit    default
     396    process_exit warpPendingCleanup $options:0 $JOB_STATUS
     397  end
     398
     399  # operation timed out?
     400  task.exit    timeout
     401    showcommand timeout
     402    book setword warpPendingCleanup $options:0 pantaskState TIMEOUT
     403  end
     404end
Note: See TracChangeset for help on using the changeset viewer.