IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19089


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

adding cleanup stages; tidy logfile names

Location:
trunk/ippTasks
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/detrend.norm.pro

    r18607 r19089  
    99book init detPendingNormImfile
    1010book init detPendingNormExp
     11
     12book init detCleanupNormStatImfile
     13book init detCleanupNormImfile
     14book init detCleanupNormExp
    1115
    1216macro detnorm.reset
     
    1418  book init detPendingNormImfile
    1519  book init detPendingNormExp
     20
     21  book init detCleanupNormStatImfile
     22  book init detCleanupNormImfile
     23  book init detCleanupNormExp
    1624end
    1725
     
    2028  book listbook detPendingNormImfile
    2129  book listbook detPendingNormExp
     30
     31  book listbook detCleanupNormStatImfile
     32  book listbook detCleanupNormImfile
     33  book listbook detCleanupNormExp
    2234end
    2335
     
    4153    active true
    4254  end
     55
     56  task detrend.cleanup.norm.load
     57    active true
     58  end
     59  task detrend.cleanup.norm.run
     60    active true
     61  end
     62  task detrend.cleanup.normexp.load
     63    active true
     64  end
     65  task detrend.cleanup.normexp.run
     66    active true
     67  end
     68  task detrend.cleanup.normstat.load
     69    active true
     70  end
     71  task detrend.cleanup.normstat.run
     72    active true
     73  end
    4374end
    4475
     
    6091  end
    6192  task detrend.normstat.run
     93    active false
     94  end
     95  task detrend.cleanup.norm.load
     96    active false
     97  end
     98  task detrend.cleanup.norm.run
     99    active false
     100  end
     101  task detrend.cleanup.normexp.load
     102    active false
     103  end
     104  task detrend.cleanup.normexp.run
     105    active false
     106  end
     107  task detrend.cleanup.normstat.load
     108    active false
     109  end
     110  task detrend.cleanup.normstat.run
    62111    active false
    63112  end
     
    68117$detPendingNormImfile_DB = 0
    69118$detPendingNormExp_DB = 0
     119
     120$detCleanupNormStatImfile_DB = 0
     121$detCleanupNormImfile_DB = 0
     122$detCleanupNormExp_DB = 0
    70123
    71124# select images ready for copy
     
    81134
    82135  stdout NULL
    83   stderr $LOGDIR/detrend.normstat.load.log
     136  stderr $LOGDIR/detrend.normstat.log
    84137
    85138  task.exec
     
    191244
    192245  stdout NULL
    193   stderr $LOGDIR/detrend.norm.load.log
     246  stderr $LOGDIR/detrend.norm.log
    194247
    195248  task.exec
     
    264317    sprintf outroot "%s/%s.%s.%s/%s.%s.norm.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    265318
    266     stdout $LOGDIR/detrend.norm.run.log
    267     stderr $LOGDIR/detrend.norm.run.log
     319    stdout $LOGDIR/detrend.norm.log
     320    stderr $LOGDIR/detrend.norm.log
    268321
    269322    $run = detrend_norm_apply.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --value $NORM --input_uri $URI --camera $CAMERA --det_type $DET_TYPE --outroot $outroot --redirect-output --verbose
     
    304357
    305358  stdout NULL
    306   stderr $LOGDIR/detrend.normexp.load.log
     359  stderr $LOGDIR/detrend.normexp.log
    307360
    308361  task.exec
     
    374427    sprintf outroot "%s/%s.%s.%s/%s.%s.normexp.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    375428
    376     stdout $LOGDIR/detrend.norm.run.log
    377     stderr $LOGDIR/detrend.norm.run.log
     429    stdout $LOGDIR/detrend.normexp.log
     430    stderr $LOGDIR/detrend.normexp.log
    378431
    379432    $run = detrend_norm_exp.pl --det_id $DET_ID --iteration $ITERATION --camera $CAMERA --det_type $DET_TYPE  --outroot $outroot
     
    401454  end
    402455end
     456
     457########## cleanup normstat ###########
     458task           detrend.cleanup.normstat.load
     459  host         local
     460
     461  periods      -poll $LOADPOLL
     462  periods      -exec $LOADEXEC
     463  periods      -timeout 30
     464  npending     1
     465  active       true
     466
     467  stdout NULL
     468  stderr $LOGDIR/detrend.cleanup.normstat.log
     469
     470  task.exec
     471    if ($DB:n == 0)
     472      option DEFAULT
     473      command dettool -pendingcleanup_normalizedstat -limit 20
     474    else
     475      # save the DB name for the exit tasks
     476      option $DB:$detCleanupNormStatImfile_DB
     477      command dettool -pendingcleanup_normalizedstat -limit 20 -dbname $DB:$detCleanupNormStatImfile_DB
     478      $detCleanupNormStatImfile_DB ++
     479      if ($detCleanupNormStatImfile_DB >= $DB:n) set detCleanupNormStatImfile_DB = 0
     480    end
     481  end
     482
     483  # success
     484  task.exit    0
     485    # convert 'stdout' to book format
     486    ipptool2book stdout detCleanupNormStatImfile -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
     487    if ($VERBOSE > 2)
     488      book listbook detCleanupNormStatImfile
     489    end
     490
     491    # delete existing entries in the appropriate pantaskStates
     492    process_cleanup detCleanupNormStatImfile
     493  end
     494
     495  # locked list
     496  task.exit    default
     497    showcommand failure
     498  end
     499
     500  # operation times out?
     501  task.exit    timeout
     502    showcommand timeout
     503  end
     504end
     505
     506# run the ipp_cleanup.pl script on pending images
     507task           detrend.cleanup.normstat.run
     508  periods      -poll $RUNPOLL
     509  periods      -exec $RUNEXEC
     510  periods      -timeout 60
     511  active       true
     512
     513  task.exec
     514    book npages detCleanupNormStatImfile -var N
     515    if ($N == 0) break
     516    if ($NETWORK == 0) break
     517   
     518    # look for new images in detCleanupNormStatImfile (pantaskState == INIT)
     519    book getpage detCleanupNormStatImfile 0 -var pageName -key pantaskState INIT
     520    if ("$pageName" == "NULL") break
     521
     522    book setword detCleanupNormStatImfile $pageName pantaskState RUN
     523    book getword detCleanupNormStatImfile $pageName det_id   -var DET_ID   
     524    book getword detCleanupNormStatImfile $pageName iteration -var ITERATION
     525    book getword detCleanupNormStatImfile $pageName camera -var CAMERA
     526    book getword detCleanupNormStatImfile $pageName state -var CLEANUP_MODE
     527    book getword detCleanupNormStatImfile $pageName dbname -var DBNAME
     528
     529    # specify choice of local or remote host based on camera and chip (class_id)
     530    set.host.for.camera $CAMERA FPA
     531
     532    stdout $LOGDIR/detrend.cleanup.normstat.log
     533    stderr $LOGDIR/detrend.cleanup.normstat.log
     534
     535    # XXX is everything listed here needed?
     536    $run = ipp_cleanup.pl --stage detrend.normstat.imfile --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
     537    add_standard_args run
     538
     539    # save the pageName for future reference below
     540    options $pageName
     541
     542    # create the command line
     543    if ($VERBOSE > 1)
     544      echo command $run
     545    end
     546    command $run
     547  end
     548
     549  # default exit status
     550  task.exit    default
     551    process_exit detCleanupNormStatImfile $options:0 $JOB_STATUS
     552  end
     553
     554  # operation timed out?
     555  task.exit    timeout
     556    showcommand timeout
     557    book setword detCleanupNormStatImfile $options:0 pantaskState TIMEOUT
     558  end
     559end
     560 
     561########## cleanup norm (normalized.imfile) ###########
     562task           detrend.cleanup.norm.load
     563  host         local
     564
     565  periods      -poll $LOADPOLL
     566  periods      -exec $LOADEXEC
     567  periods      -timeout 30
     568  npending     1
     569  active       true
     570
     571  stdout NULL
     572  stderr $LOGDIR/detrend.cleanup.norm.log
     573
     574  task.exec
     575    if ($DB:n == 0)
     576      option DEFAULT
     577      command dettool -pendingcleanup_normalizedimfile -limit 20
     578    else
     579      # save the DB name for the exit tasks
     580      option $DB:$detCleanupNormImfile_DB
     581      command dettool -pendingcleanup_normalizedimfile -limit 20 -dbname $DB:$detCleanupNormImfile_DB
     582      $detCleanupNormImfile_DB ++
     583      if ($detCleanupNormImfile_DB >= $DB:n) set detCleanupNormImfile_DB = 0
     584    end
     585  end
     586
     587  # success
     588  task.exit    0
     589    # convert 'stdout' to book format
     590    ipptool2book stdout detCleanupNormImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     591    if ($VERBOSE > 2)
     592      book listbook detCleanupNormImfile
     593    end
     594
     595    # delete existing entries in the appropriate pantaskStates
     596    process_cleanup detCleanupNormImfile
     597  end
     598
     599  # locked list
     600  task.exit    default
     601    showcommand failure
     602  end
     603
     604  # operation times out?
     605  task.exit    timeout
     606    showcommand timeout
     607  end
     608end
     609
     610# run the ipp_cleanup.pl script on pending images
     611task           detrend.cleanup.norm.run
     612  periods      -poll $RUNPOLL
     613  periods      -exec $RUNEXEC
     614  periods      -timeout 60
     615  active       true
     616
     617  task.exec
     618    book npages detCleanupNormImfile -var N
     619    if ($N == 0) break
     620    if ($NETWORK == 0) break
     621   
     622    # look for new images in detCleanupNormImfile (pantaskState == INIT)
     623    book getpage detCleanupNormImfile 0 -var pageName -key pantaskState INIT
     624    if ("$pageName" == "NULL") break
     625
     626    book setword detCleanupNormImfile $pageName pantaskState RUN
     627    book getword detCleanupNormImfile $pageName det_id   -var DET_ID   
     628    book getword detCleanupNormImfile $pageName iteration -var ITERATION
     629    book getword detCleanupNormImfile $pageName class_id -var CLASS_ID
     630    book getword detCleanupNormImfile $pageName camera -var CAMERA
     631    book getword detCleanupNormImfile $pageName state -var CLEANUP_MODE
     632    book getword detCleanupNormImfile $pageName dbname -var DBNAME
     633
     634    # specify choice of local or remote host based on camera and chip (class_id)
     635    set.host.for.camera $CAMERA FPA
     636
     637    stdout $LOGDIR/detrend.cleanup.norm.log
     638    stderr $LOGDIR/detrend.cleanup.norm.log
     639
     640    # XXX is everything listed here needed?
     641    $run = ipp_cleanup.pl --stage detrend.norm.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
     642    add_standard_args run
     643
     644    # save the pageName for future reference below
     645    options $pageName
     646
     647    # create the command line
     648    if ($VERBOSE > 1)
     649      echo command $run
     650    end
     651    command $run
     652  end
     653
     654  # default exit status
     655  task.exit    default
     656    process_exit detCleanupNormImfile $options:0 $JOB_STATUS
     657  end
     658
     659  # operation timed out?
     660  task.exit    timeout
     661    showcommand timeout
     662    book setword detCleanupNormImfile $options:0 pantaskState TIMEOUT
     663  end
     664end
     665 
     666########## cleanup normexp ###########
     667task           detrend.cleanup.normexp.load
     668  host         local
     669
     670  periods      -poll $LOADPOLL
     671  periods      -exec $LOADEXEC
     672  periods      -timeout 30
     673  npending     1
     674  active       true
     675
     676  stdout NULL
     677  stderr $LOGDIR/detrend.normexp.cleanup.log
     678
     679  task.exec
     680    if ($DB:n == 0)
     681      option DEFAULT
     682      command dettool -pendingcleanup_normalizedexp -limit 20
     683    else
     684      # save the DB name for the exit tasks
     685      option $DB:$detCleanupNormExp_DB
     686      command dettool -pendingcleanup_normalizedexp -limit 20 -dbname $DB:$detCleanupNormExp_DB
     687      $detCleanupNormExp_DB ++
     688      if ($detCleanupNormExp_DB >= $DB:n) set detCleanupNormExp_DB = 0
     689    end
     690  end
     691
     692  # success
     693  task.exit    0
     694    # convert 'stdout' to book format
     695    ipptool2book stdout detCleanupNormExp -key det_id:iteration -uniq -setword dbname $options:0 -setword pantaskState INIT
     696    if ($VERBOSE > 2)
     697      book listbook detCleanupNormExp
     698    end
     699
     700    # delete existing entries in the appropriate pantaskStates
     701    process_cleanup detCleanupNormExp
     702  end
     703
     704  # locked list
     705  task.exit    default
     706    showcommand failure
     707  end
     708
     709  # operation times out?
     710  task.exit    timeout
     711    showcommand timeout
     712  end
     713end
     714
     715# run the ipp_cleanup.pl script on pending images
     716task           detrend.cleanup.normexp.run
     717  periods      -poll $RUNPOLL
     718  periods      -exec $RUNEXEC
     719  periods      -timeout 60
     720  active       true
     721
     722  task.exec
     723    book npages detCleanupNormExp -var N
     724    if ($N == 0) break
     725    if ($NETWORK == 0) break
     726   
     727    # look for new images in detCleanupNormExp (pantaskState == INIT)
     728    book getpage detCleanupNormExp 0 -var pageName -key pantaskState INIT
     729    if ("$pageName" == "NULL") break
     730
     731    book setword detCleanupNormExp $pageName pantaskState RUN
     732    book getword detCleanupNormExp $pageName det_id   -var DET_ID   
     733    book getword detCleanupNormExp $pageName iteration -var ITERATION
     734    book getword detCleanupNormExp $pageName camera -var CAMERA
     735    book getword detCleanupNormExp $pageName state -var CLEANUP_MODE
     736    book getword detCleanupNormExp $pageName dbname -var DBNAME
     737
     738    # specify choice of local or remote host based on camera and chip (class_id)
     739    set.host.for.camera $CAMERA FPA
     740
     741    stdout $LOGDIR/detrend.cleanup.normexp.log
     742    stderr $LOGDIR/detrend.cleanup.normexp.log
     743
     744    # XXX is everything listed here needed?
     745    $run = ipp_cleanup.pl --stage detrend.norm.exp --stage_id $DET_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
     746    add_standard_args run
     747
     748    # save the pageName for future reference below
     749    options $pageName
     750
     751    # create the command line
     752    if ($VERBOSE > 1)
     753      echo command $run
     754    end
     755    command $run
     756  end
     757
     758  # default exit status
     759  task.exit    default
     760    process_exit detCleanupNormExp $options:0 $JOB_STATUS
     761  end
     762
     763  # operation timed out?
     764  task.exit    timeout
     765    showcommand timeout
     766    book setword detCleanupNormExp $options:0 pantaskState TIMEOUT
     767  end
     768end
     769 
  • trunk/ippTasks/detrend.resid.pro

    r18606 r19089  
    88book init detPendingResidImfile
    99book init detPendingResidExp
     10book init detCleanupResidImfile
     11book init detCleanupResidExp
    1012
    1113macro detresid.reset
    1214  book init detPendingResidImfile
    1315  book init detPendingResidExp
     16  book init detCleanupResidImfile
     17  book init detCleanupResidExp
    1418end
    1519
     
    1721  book listbook detPendingResidImfile
    1822  book listbook detPendingResidExp
     23  book listbook detCleanupResidImfile
     24  book listbook detCleanupResidExp
    1925end
    2026
     
    3238    active true
    3339  end
     40  task detrend.cleanup.resid.load
     41    active true
     42  end
     43  task detrend.cleanup.resid.run
     44    active true
     45  end
     46  task detrend.cleanup.residexp.load
     47    active true
     48  end
     49  task detrend.cleanup.residexp.run
     50    active true
     51  end
    3452end
    3553
     
    4563  end
    4664  task detrend.residexp.run
     65    active false
     66  end
     67  task detrend.cleanup.resid.load
     68    active false
     69  end
     70  task detrend.cleanup.resid.run
     71    active false
     72  end
     73  task detrend.cleanup.residexp.load
     74    active false
     75  end
     76  task detrend.cleanup.residexp.run
    4777    active false
    4878  end
     
    5282$detPendingResidImfile_DB = 0
    5383$detPendingResidExp_DB = 0
     84$detCleanupResidImfile_DB = 0
     85$detCleanupResidExp_DB = 0
    5486
    5587# select images ready for copy
     
    6597
    6698  stdout NULL
    67   stderr $LOGDIR/detresid.load.log
     99  stderr $LOGDIR/detrend.resid.imfile.log
    68100
    69101  task.exec
     
    142174    sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION
    143175
    144     stdout $LOGDIR/detresid.run.log
    145     stderr $LOGDIR/detresid.run.log
     176    stdout $LOGDIR/detrend.resid.imfile.log
     177    stderr $LOGDIR/detrend.resid.imfile.log
    146178
    147179    $run = detrend_resid_imfile.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --class_id $CLASS_ID --det_type $DET_TYPE --detrend $DET_URI --input_uri $URI --camera $CAMERA --mode $MODE --outroot $outroot --redirect-output --verbose
     
    186218
    187219  stdout NULL
    188   stderr $LOGDIR/detresid.exp.load.log
     220  stderr $LOGDIR/detrend.resid.exp.log
    189221
    190222  task.exec
     
    260292    sprintf outroot "%s/%s.%s.%s/%s/%s.detresid.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $EXP_TAG $EXP_TAG $DET_ID $ITERATION
    261293
    262     stdout $LOGDIR/detresid.exp.run.log
    263     stderr $LOGDIR/detresid.exp.run.log
     294    stdout $LOGDIR/detrend.resid.exp.log
     295    stderr $LOGDIR/detrend.resid.exp.log
    264296
    265297    $run = detrend_resid_exp.pl --det_id $DET_ID --iteration $ITERATION --exp_id $EXP_ID --exp_tag $EXP_TAG --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose
     
    288320  end
    289321end
     322
     323######## cleanup resid imfile ########
     324task           detrend.cleanup.resid.load
     325  host         local
     326
     327  periods      -poll $LOADPOLL
     328  periods      -exec $LOADEXEC
     329  periods      -timeout 30
     330  npending     1
     331  active       true
     332
     333  stdout NULL
     334  stderr $LOGDIR/detrend.cleanup.resid.imfile.log
     335
     336  task.exec
     337    if ($DB:n == 0)
     338      option DEFAULT
     339      command dettool -pendingcleanup_residimfile -limit 20
     340    else
     341      # save the DB name for the exit tasks
     342      option $DB:$detCleanupResidImfile_DB
     343      command dettool -pendingcleanup_residimfile -limit 20 -dbname $DB:$detCleanupResidImfile_DB
     344      $detCleanupResidImfile_DB ++
     345      if ($detCleanupResidImfile_DB >= $DB:n) set detCleanupResidImfile_DB = 0
     346    end
     347  end
     348
     349  # success
     350  task.exit    0
     351    # convert 'stdout' to book format
     352    ipptool2book stdout detCleanupResidImfile -key det_id:iteration:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     353    if ($VERBOSE > 2)
     354      book listbook detCleanupResidImfile
     355    end
     356
     357    # delete existing entries in the appropriate pantaskStates
     358    process_cleanup detCleanupResidImfile
     359  end
     360
     361  # locked list
     362  task.exit    default
     363    showcommand failure
     364  end
     365
     366  # operation times out?
     367  task.exit    timeout
     368    showcommand timeout
     369  end
     370end
     371
     372# run the ipp_cleanup.pl script on pending images
     373task           detrend.cleanup.resid.run
     374  periods      -poll $RUNPOLL
     375  periods      -exec $RUNEXEC
     376  periods      -timeout 60
     377  active       true
     378
     379  task.exec
     380    book npages detCleanupResidImfile -var N
     381    if ($N == 0) break
     382    if ($NETWORK == 0) break
     383   
     384    # look for new images in detCleanupResidImfile (pantaskState == INIT)
     385    book getpage detCleanupResidImfile 0 -var pageName -key pantaskState INIT
     386    if ("$pageName" == "NULL") break
     387
     388    book setword detCleanupResidImfile $pageName pantaskState RUN
     389    book getword detCleanupResidImfile $pageName det_id   -var DET_ID   
     390    book getword detCleanupResidImfile $pageName exp_id   -var EXP_ID   
     391    book getword detCleanupResidImfile $pageName class_id -var CLASS_ID
     392    book getword detCleanupResidImfile $pageName iteration -var ITERATION     
     393    book getword detCleanupResidImfile $pageName camera -var CAMERA
     394    book getword detCleanupResidImfile $pageName state -var CLEANUP_MODE
     395    book getword detCleanupResidImfile $pageName dbname -var DBNAME
     396
     397    # specify choice of local or remote host based on camera and chip (class_id)
     398    set.host.for.camera $CAMERA FPA
     399
     400    stdout $LOGDIR/detrend.cleanup.resid.imfile.log
     401    stderr $LOGDIR/detrend.cleanup.resid.imfile.log
     402
     403    # XXX is everything listed here needed?
     404    $run = ipp_cleanup.pl --stage detrend.resid.imfile --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --iteration $ITERATION --camera $CAMERA --mode $CLEANUP_MODE
     405    add_standard_args run
     406
     407    # save the pageName for future reference below
     408    options $pageName
     409
     410    # create the command line
     411    if ($VERBOSE > 1)
     412      echo command $run
     413    end
     414    command $run
     415  end
     416
     417  # default exit status
     418  task.exit    default
     419    process_exit detCleanupResidImfile $options:0 $JOB_STATUS
     420  end
     421
     422  # operation timed out?
     423  task.exit    timeout
     424    showcommand timeout
     425    book setword detCleanupResidImfile $options:0 pantaskState TIMEOUT
     426  end
     427end
     428 
     429
     430######## cleanup resid exp ########
     431task           detrend.cleanup.residexp.load
     432  host         local
     433
     434  periods      -poll $LOADPOLL
     435  periods      -exec $LOADEXEC
     436  periods      -timeout 30
     437  npending     1
     438  active       true
     439
     440  stdout NULL
     441  stderr $LOGDIR/detrend.cleanup.resid.exp.log
     442
     443  task.exec
     444    if ($DB:n == 0)
     445      option DEFAULT
     446      command dettool -pendingcleanup_residexp -limit 20
     447    else
     448      # save the DB name for the exit tasks
     449      option $DB:$detCleanupResidExp_DB
     450      command dettool -pendingcleanup_residexp -limit 20 -dbname $DB:$detCleanupResidExp_DB
     451      $detCleanupResidExp_DB ++
     452      if ($detCleanupResidExp_DB >= $DB:n) set detCleanupResidExp_DB = 0
     453    end
     454  end
     455
     456  # success
     457  task.exit    0
     458    # convert 'stdout' to book format
     459    ipptool2book stdout detCleanupResidExp -key det_id:iteration:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     460    if ($VERBOSE > 2)
     461      book listbook detCleanupResidExp
     462    end
     463
     464    # delete existing entries in the appropriate pantaskStates
     465    process_cleanup detCleanupResidExp
     466  end
     467
     468  # locked list
     469  task.exit    default
     470    showcommand failure
     471  end
     472
     473  # operation times out?
     474  task.exit    timeout
     475    showcommand timeout
     476  end
     477end
     478
     479# run the ipp_cleanup.pl script on pending images
     480task           detrend.cleanup.residexp.run
     481  periods      -poll $RUNPOLL
     482  periods      -exec $RUNEXEC
     483  periods      -timeout 60
     484  active       true
     485
     486  task.exec
     487    book npages detCleanupResidExp -var N
     488    if ($N == 0) break
     489    if ($NETWORK == 0) break
     490   
     491    # look for new images in detCleanupResidExp (pantaskState == INIT)
     492    book getpage detCleanupResidExp 0 -var pageName -key pantaskState INIT
     493    if ("$pageName" == "NULL") break
     494
     495    book setword detCleanupResidExp $pageName pantaskState RUN
     496    book getword detCleanupResidExp $pageName det_id    -var DET_ID   
     497    book getword detCleanupResidExp $pageName exp_id    -var EXP_ID   
     498    book getword detCleanupResidExp $pageName iteration -var ITERATION
     499    book getword detCleanupResidExp $pageName camera    -var CAMERA
     500    book getword detCleanupResidExp $pageName state     -var CLEANUP_MODE
     501    book getword detCleanupResidExp $pageName dbname    -var DBNAME
     502
     503    # specify choice of local or remote host based on camera and chip (class_id)
     504    set.host.for.camera $CAMERA FPA
     505
     506    stdout $LOGDIR/detrend.cleanup.resid.exp.log
     507    stderr $LOGDIR/detrend.cleanup.resid.exp.log
     508
     509    # XXX is everything listed here needed?
     510    $run = ipp_cleanup.pl --stage detrend.resid.exp --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
     511    add_standard_args run
     512
     513    # save the pageName for future reference below
     514    options $pageName
     515
     516    # create the command line
     517    if ($VERBOSE > 1)
     518      echo command $run
     519    end
     520    command $run
     521  end
     522
     523  # default exit status
     524  task.exit    default
     525    process_exit detCleanupResidExp $options:0 $JOB_STATUS
     526  end
     527
     528  # operation timed out?
     529  task.exit    timeout
     530    showcommand timeout
     531    book setword detCleanupResidExp $options:0 pantaskState TIMEOUT
     532  end
     533end
  • trunk/ippTasks/detrend.stack.pro

    r18129 r19089  
    77
    88book init detPendingStackedImfile
     9book init detCleanupStackedImfile
    910
    1011macro detstack.reset
    1112  book init detPendingStackedImfile
     13  book init detCleanupStackedImfile
    1214end
    1315
     
    1517  echo detPendingStackedImfile
    1618  book listbook detPendingStackedImfile
     19  echo detCleanupStackedImfile
     20  book listbook detCleanupStackedImfile
    1721end
    1822
     
    2428    active true
    2529  end
     30  task detrend.cleanup.stack.load
     31    active true
     32  end
     33  task detrend.cleanup.stack.run
     34    active true
     35  end
    2636end
    2737
     
    3343    active false
    3444  end
     45  task detrend.cleanup.stack.load
     46    active false
     47  end
     48  task detrend.cleanup.stack.run
     49    active false
     50  end
    3551end
    3652
    3753# this variable will cycle through the known database names
    3854$detPendingStackedImfile_DB = 0
     55$detCleanupStackedImfile_DB = 0
    3956
    4057# select images ready for detrend_stack.pl
     
    5067
    5168  stdout NULL
    52   stderr $LOGDIR/detrend.stack.load.log
     69  stderr $LOGDIR/detrend.stack.log
    5370
    5471  task.exec
     
    122139    sprintf outroot "%s/%s.%s.%s/%s.%s.%s.%s" $WORKDIR $CAMERA $DET_TYPE $DET_ID $CAMERA $DET_TYPE $DET_ID $ITERATION
    123140
    124     stdout $LOGDIR/detrend.stack.run.log
    125     stderr $LOGDIR/detrend.stack.run.log
    126 
    127     $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output --verbose
     141    stdout $LOGDIR/detrend.stack.log
     142    stderr $LOGDIR/detrend.stack.log
     143
     144    $run = detrend_stack.pl --det_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --det_type $DET_TYPE --camera $CAMERA --outroot $outroot --redirect-output
    128145    if ("$REDUCTION" != "NULL")
    129146      $run = $run --reduction $REDUCTION
     
    152169  end
    153170end
     171
     172########## cleanup stack ###########
     173task           detrend.cleanup.stack.load
     174  host         local
     175
     176  periods      -poll $LOADPOLL
     177  periods      -exec $LOADEXEC
     178  periods      -timeout 30
     179  npending     1
     180  active       true
     181
     182  stdout NULL
     183  stderr $LOGDIR/detrend.cleanup.stack.log
     184
     185  task.exec
     186    if ($DB:n == 0)
     187      option DEFAULT
     188      command dettool -pendingcleanup_stacked -limit 20
     189    else
     190      # save the DB name for the exit tasks
     191      option $DB:$detCleanupStackedImfile_DB
     192      command dettool -pendingcleanup_stacked -limit 20 -dbname $DB:$detCleanupStackedImfile_DB
     193      $detCleanupStackedImfile_DB ++
     194      if ($detCleanupStackedImfile_DB >= $DB:n) set detCleanupStackedImfile_DB = 0
     195    end
     196  end
     197
     198  # success
     199  task.exit    0
     200    # convert 'stdout' to book format
     201    ipptool2book stdout detCleanupStackedImfile -key det_id:iteration:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     202    if ($VERBOSE > 2)
     203      book listbook detCleanupStackedImfile
     204    end
     205
     206    # delete existing entries in the appropriate pantaskStates
     207    process_cleanup detCleanupStackedImfile
     208  end
     209
     210  # locked list
     211  task.exit    default
     212    showcommand failure
     213  end
     214
     215  # operation times out?
     216  task.exit    timeout
     217    showcommand timeout
     218  end
     219end
     220
     221# run the ipp_cleanup.pl script on pending images
     222task           detrend.cleanup.stack.run
     223  periods      -poll $RUNPOLL
     224  periods      -exec $RUNEXEC
     225  periods      -timeout 60
     226  active       true
     227
     228  task.exec
     229    book npages detCleanupStackedImfile -var N
     230    if ($N == 0) break
     231    if ($NETWORK == 0) break
     232   
     233    # look for new images in detCleanupStackedImfile (pantaskState == INIT)
     234    book getpage detCleanupStackedImfile 0 -var pageName -key pantaskState INIT
     235    if ("$pageName" == "NULL") break
     236
     237    book setword detCleanupStackedImfile $pageName pantaskState RUN
     238    book getword detCleanupStackedImfile $pageName det_id   -var DET_ID   
     239    book getword detCleanupStackedImfile $pageName iteration -var ITERATION
     240    book getword detCleanupStackedImfile $pageName class_id -var CLASS_ID
     241    book getword detCleanupStackedImfile $pageName camera -var CAMERA
     242    book getword detCleanupStackedImfile $pageName state -var CLEANUP_MODE
     243    book getword detCleanupStackedImfile $pageName dbname -var DBNAME
     244
     245    # specify choice of local or remote host based on camera and chip (class_id)
     246    set.host.for.camera $CAMERA FPA
     247
     248    stdout $LOGDIR/detrend.cleanup.stack.log
     249    stderr $LOGDIR/detrend.cleanup.stack.log
     250
     251    # XXX is everything listed here needed?
     252    $run = ipp_cleanup.pl --stage detrend.stack.imfile --stage_id $DET_ID --iteration $ITERATION --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
     253    add_standard_args run
     254
     255    # save the pageName for future reference below
     256    options $pageName
     257
     258    # create the command line
     259    if ($VERBOSE > 1)
     260      echo command $run
     261    end
     262    command $run
     263  end
     264
     265  # default exit status
     266  task.exit    default
     267    process_exit detCleanupStackedImfile $options:0 $JOB_STATUS
     268  end
     269
     270  # operation timed out?
     271  task.exit    timeout
     272    showcommand timeout
     273    book setword detCleanupStackedImfile $options:0 pantaskState TIMEOUT
     274  end
     275end
     276 
  • trunk/ippTasks/diff.pro

    r18509 r19089  
    88check.globals
    99
    10 $LOGSUBDIR = $LOGDIR/diff
    11 exec mkdir -p $LOGSUBDIR
    12 
    1310### Initialise the books containing the tasks to do
    1411book init diffSkyfile
     12book init diffCleanup
    1513
    1614### Database lists
    1715$diffSkycell_DB = 0
     16$diffCleanup_DB = 0
    1817
    1918### Check status of diffing tasks
    2019macro diff.status
    2120  book listbook diffSkyfile
     21  book listbook diffCleanup
    2222end
    2323
     
    2525macro diff.reset
    2626  book init diffSkyfile
     27  book init diffCleanup
    2728end
    2829
     
    3536    active true
    3637  end
     38  task diff.cleanup.load
     39    active true
     40  end
     41  task diff.cleanup.run
     42    active true
     43  end
    3744end
    3845
     
    4350  end
    4451  task diff.skycell.run
     52    active false
     53  end
     54  task diff.cleanup.load
     55    active false
     56  end
     57  task diff.cleanup.run
    4558    active false
    4659  end
     
    5972
    6073  stdout NULL
    61   stderr $LOGSUBDIR/diff.skycell.log
     74  stderr $LOGDIR/diff.skycell.log
    6275
    6376  task.exec
     
    122135
    123136    ### XXX Instead of setting these by camera, need to set by skycell_id
     137    ### XXX change these to use the --redirect scheme
    124138#    set.host.for.camera $CAMERA $DIFF_ID
    125139#    set.workdir.by.camera $CAMERA $DIFF_ID $WORKDIR_TEMPLATE $default_host WORKDIR
     
    167181end
    168182
     183# select images ready for diff analysis
     184# new entries are added to diffPendingImfile
     185# skip already-present entries
     186task           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
     232end
     233
     234# run the ipp_cleanup.pl script on pending images
     235task           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
     286end
  • trunk/ippTasks/stack.pro

    r18488 r19089  
    88check.globals
    99
    10 $LOGSUBDIR = $LOGDIR/stack
    11 exec mkdir -p $LOGSUBDIR
    12 
    1310### Initialise the books containing the tasks to do
    1411book init stackSumSkyfile
     12book init stackCleanup
    1513
    1614### Database lists
    1715$stackSkycell_DB = 0
     16$stackCleanup_DB = 0
    1817
    1918### Check status of stacking tasks
    2019macro stack.status
    2120  book listbook stackSumSkyfile
     21  book listbook stackCleanup
    2222end
    2323
     
    2525macro stack.reset
    2626  book init stackSumSkyfile
     27  book init stackCleanup
    2728end
    2829
     
    3536    active true
    3637  end
     38  task stack.cleanup.load
     39    active true
     40  end
     41  task stack.cleanup.run
     42    active true
     43  end
    3744end
    3845
     
    4350  end
    4451  task stack.skycell.run
     52    active false
     53  end
     54  task stack.cleanup.load
     55    active false
     56  end
     57  task stack.cleanup.run
    4558    active false
    4659  end
     
    5972
    6073  stdout NULL
    61   stderr $LOGSUBDIR/stack.skycell.log
     74  stderr $LOGDIR/stack.skycell.log
    6275
    6376  task.exec
     
    168181end
    169182
     183
     184# select images ready for stack analysis
     185# new entries are added to stackCleanup
     186# skip already-present entries
     187task           stack.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/stack.cleanup.log
     198
     199  task.exec
     200    if ($DB:n == 0)
     201      option DEFAULT
     202      command stacktool -pendingcleanuprun -limit 20
     203    else
     204      # save the DB name for the exit tasks
     205      option $DB:$stackCleanup_DB
     206      command stacktool -pendingcleanuprun -limit 20 -dbname $DB:$stackCleanup_DB
     207      $stackCleanup_DB ++
     208      if ($stackCleanup_DB >= $DB:n) set stackCleanup_DB = 0
     209    end
     210  end
     211
     212  # success
     213  task.exit    0
     214    # convert 'stdout' to book format
     215    ipptool2book stdout stackCleanup -key stack_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     216    if ($VERBOSE > 2)
     217      book listbook stackCleanup
     218    end
     219
     220    # delete existing entries in the appropriate pantaskStates
     221    process_cleanup stackCleanup
     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           stack.cleanup.run
     237  periods      -poll $RUNPOLL
     238  periods      -exec $RUNEXEC
     239  periods      -timeout 60
     240  active       true
     241
     242  task.exec
     243    book npages stackCleanup -var N
     244    if ($N == 0) break
     245    if ($NETWORK == 0) break
     246   
     247    # look for new images in stackCleanup (pantaskState == INIT)
     248    book getpage stackCleanup 0 -var pageName -key pantaskState INIT
     249    if ("$pageName" == "NULL") break
     250
     251    book setword stackCleanup $pageName pantaskState RUN
     252    book getword stackCleanup $pageName camera -var CAMERA
     253    book getword stackCleanup $pageName state -var CLEANUP_MODE
     254    book getword stackCleanup $pageName stack_id -var STACK_ID
     255    book getword stackCleanup $pageName dbname -var DBNAME
     256
     257    # specify choice of local or remote host based on camera and stack (class_id)
     258    set.host.for.camera $CAMERA FPA
     259
     260    stdout $LOGDIR/stack.cleanup.log
     261    stderr $LOGDIR/stack.cleanup.log
     262
     263    # XXX is everything listed here needed?
     264    $run = ipp_cleanup.pl --stage stack --stage_id $STACK_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 stackCleanup $options:0 $JOB_STATUS
     280  end
     281
     282  # operation timed out?
     283  task.exit    timeout
     284    showcommand timeout
     285    book setword stackCleanup $options:0 pantaskState TIMEOUT
     286  end
     287end
Note: See TracChangeset for help on using the changeset viewer.