IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 20, 2009, 6:08:06 PM (17 years ago)
Author:
eugene
Message:

move detrend cleanup tasks to new detrend.cleanup.pro

File:
1 edited

Legend:

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

    r23230 r23480  
    88book init detPendingProcessedImfile
    99book init detPendingProcessedExp
    10 book init detCleanupProcessedImfile
    11 book init detCleanupProcessedExp
    1210
    1311macro detproc.reset
    1412  book init detPendingProcessedImfile
    1513  book init detPendingProcessedExp
    16   book init detCleanupProcessedImfile
    17   book init detCleanupProcessedExp
    1814end
    1915
     
    2319  echo detPendingProcessedExp
    2420  book listbook detPendingProcessedExp
    25   echo detCleanupProcessedImfile
    26   book listbook detCleanupProcessedImfile
    27   echo detCleanupProcessedExp
    28   book listbook detCleanupProcessedExp
    2921end
    3022
     
    4234    active true
    4335  end
    44   task detrend.cleanup.process.load
    45     active true
    46   end
    47   task detrend.cleanup.process.run
    48     active true
    49   end
    50   task detrend.cleanup.processexp.load
    51     active true
    52   end
    53   task detrend.cleanup.processexp.run
    54     active true
    55   end
    5636end
    5737
     
    6949    active false
    7050  end
    71   task detrend.cleanup.process.load
    72     active false
    73   end
    74   task detrend.cleanup.process.run
    75     active false
    76   end
    77   task detrend.cleanup.processexp.load
    78     active false
    79   end
    80   task detrend.cleanup.processexp.run
    81     active false
    82   end
    8351end
    8452
     
    8755$detPendingProcessedImfile_DB = 0
    8856$detPendingProcessedExp_DB = 0
    89 $detCleanupProcessedImfile_DB = 0
    90 $detCleanupProcessedExp_DB = 0
    9157
    9258# select images ready for copy
     
    347313  end
    348314end
    349 
    350 ######## cleanup process imfile ########
    351 task           detrend.cleanup.process.load
    352   host         local
    353 
    354   periods      -poll $LOADPOLL
    355   periods      -exec $LOADEXEC
    356   periods      -timeout 30
    357   npending     1
    358   active       true
    359 
    360   stdout NULL
    361   stderr $LOGDIR/detrend.cleanup.process.imfile.log
    362 
    363   task.exec
    364     $run = dettool -pendingcleanup_processedimfile
    365     if ($DB:n == 0)
    366       option DEFAULT
    367     else
    368       # save the DB name for the exit tasks
    369       option $DB:$detCleanupProcessedImfile_DB
    370       $run = $run -dbname $DB:$detCleanupProcessedImfile_DB
    371       $detCleanupProcessedImfile_DB ++
    372       if ($detCleanupProcessedImfile_DB >= $DB:n) set detCleanupProcessedImfile_DB = 0
    373     end
    374     add_poll_args run
    375     command $run
    376   end
    377 
    378   # success
    379   task.exit    0
    380     # convert 'stdout' to book format
    381     ipptool2book stdout detCleanupProcessedImfile -key det_id:exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    382     if ($VERBOSE > 2)
    383       book listbook detCleanupProcessedImfile
    384     end
    385 
    386     # delete existing entries in the appropriate pantaskStates
    387     process_cleanup detCleanupProcessedImfile
    388   end
    389 
    390   # locked list
    391   task.exit    default
    392     showcommand failure
    393   end
    394 
    395   task.exit    crash
    396     showcommand crash
    397   end
    398 
    399   # operation times out?
    400   task.exit    timeout
    401     showcommand timeout
    402   end
    403 end
    404 
    405 # run the ipp_cleanup.pl script on pending images
    406 task           detrend.cleanup.process.run
    407   periods      -poll $RUNPOLL
    408   periods      -exec $RUNEXEC
    409   periods      -timeout 60
    410   active       true
    411 
    412   task.exec
    413     book npages detCleanupProcessedImfile -var N
    414     if ($N == 0) break
    415     if ($NETWORK == 0) break
    416    
    417     # look for new images in detCleanupProcessedImfile (pantaskState == INIT)
    418     book getpage detCleanupProcessedImfile 0 -var pageName -key pantaskState INIT
    419     if ("$pageName" == "NULL") break
    420 
    421     book setword detCleanupProcessedImfile $pageName pantaskState RUN
    422     book getword detCleanupProcessedImfile $pageName det_id   -var DET_ID   
    423     book getword detCleanupProcessedImfile $pageName exp_id   -var EXP_ID   
    424     book getword detCleanupProcessedImfile $pageName class_id -var CLASS_ID
    425     book getword detCleanupProcessedImfile $pageName camera   -var CAMERA
    426     book getword detCleanupProcessedImfile $pageName state    -var CLEANUP_MODE
    427     book getword detCleanupProcessedImfile $pageName dbname   -var DBNAME
    428 
    429     # specify choice of local or remote host based on camera and chip (class_id)
    430     set.host.for.camera $CAMERA FPA
    431 
    432     stdout $LOGDIR/detrend.cleanup.process.imfile.log
    433     stderr $LOGDIR/detrend.cleanup.process.imfile.log
    434 
    435     # XXX is everything listed here needed?
    436     $run = ipp_cleanup.pl --stage detrend.process.imfile --stage_id $DET_ID --exp_id $EXP_ID --class_id $CLASS_ID --camera $CAMERA --mode $CLEANUP_MODE
    437     add_standard_args run
    438 
    439     # save the pageName for future reference below
    440     options $pageName
    441 
    442     # create the command line
    443     if ($VERBOSE > 1)
    444       echo command $run
    445     end
    446     command $run
    447   end
    448 
    449   # default exit status
    450   task.exit    default
    451     process_exit detCleanupProcessedImfile $options:0 $JOB_STATUS
    452   end
    453 
    454   # locked list
    455   task.exit    crash
    456     showcommand crash
    457     echo "hostname: $JOB_HOSTNAME"
    458     book setword detCleanupProcessedImfile $options:0 pantaskState CRASH
    459   end
    460 
    461   # operation timed out?
    462   task.exit    timeout
    463     showcommand timeout
    464     book setword detCleanupProcessedImfile $options:0 pantaskState TIMEOUT
    465   end
    466 end
    467  
    468 
    469 ######## cleanup process exp ########
    470 task           detrend.cleanup.processexp.load
    471   host         local
    472 
    473   periods      -poll $LOADPOLL
    474   periods      -exec $LOADEXEC
    475   periods      -timeout 30
    476   npending     1
    477   active       true
    478 
    479   stdout NULL
    480   stderr $LOGDIR/detrend.cleanup.process.exp.log
    481 
    482   task.exec
    483     $run = dettool -pendingcleanup_processedexp
    484     if ($DB:n == 0)
    485       option DEFAULT
    486     else
    487       # save the DB name for the exit tasks
    488       option $DB:$detCleanupProcessedExp_DB
    489       $run = $run -dbname $DB:$detCleanupProcessedExp_DB
    490       $detCleanupProcessedExp_DB ++
    491       if ($detCleanupProcessedExp_DB >= $DB:n) set detCleanupProcessedExp_DB = 0
    492     end
    493     add_poll_args run
    494     command $run
    495   end
    496 
    497   # success
    498   task.exit    0
    499     # convert 'stdout' to book format
    500     ipptool2book stdout detCleanupProcessedExp -key det_id:exp_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    501     if ($VERBOSE > 2)
    502       book listbook detCleanupProcessedExp
    503     end
    504 
    505     # delete existing entries in the appropriate pantaskStates
    506     process_cleanup detCleanupProcessedExp
    507   end
    508 
    509   # locked list
    510   task.exit    default
    511     showcommand failure
    512   end
    513 
    514   task.exit    crash
    515     showcommand crash
    516   end
    517 
    518   # operation times out?
    519   task.exit    timeout
    520     showcommand timeout
    521   end
    522 end
    523 
    524 # run the ipp_cleanup.pl script on pending images
    525 task           detrend.cleanup.processexp.run
    526   periods      -poll $RUNPOLL
    527   periods      -exec $RUNEXEC
    528   periods      -timeout 60
    529   active       true
    530 
    531   task.exec
    532     book npages detCleanupProcessedExp -var N
    533     if ($N == 0) break
    534     if ($NETWORK == 0) break
    535    
    536     # look for new images in detCleanupProcessedExp (pantaskState == INIT)
    537     book getpage detCleanupProcessedExp 0 -var pageName -key pantaskState INIT
    538     if ("$pageName" == "NULL") break
    539 
    540     book setword detCleanupProcessedExp $pageName pantaskState RUN
    541     book getword detCleanupProcessedExp $pageName det_id   -var DET_ID   
    542     book getword detCleanupProcessedExp $pageName exp_id   -var EXP_ID   
    543     book getword detCleanupProcessedExp $pageName camera -var CAMERA
    544     book getword detCleanupProcessedExp $pageName state -var CLEANUP_MODE
    545     book getword detCleanupProcessedExp $pageName dbname -var DBNAME
    546 
    547     # specify choice of local or remote host based on camera and chip (class_id)
    548     set.host.for.camera $CAMERA FPA
    549 
    550     stdout $LOGDIR/detrend.cleanup.process.exp.log
    551     stderr $LOGDIR/detrend.cleanup.process.exp.log
    552 
    553     # XXX is everything listed here needed?
    554     $run = ipp_cleanup.pl --stage detrend.process.exp --stage_id $DET_ID --exp_id $EXP_ID --camera $CAMERA --mode $CLEANUP_MODE
    555     add_standard_args run
    556 
    557     # save the pageName for future reference below
    558     options $pageName
    559 
    560     # create the command line
    561     if ($VERBOSE > 1)
    562       echo command $run
    563     end
    564     command $run
    565   end
    566 
    567   # default exit status
    568   task.exit    default
    569     process_exit detCleanupProcessedExp $options:0 $JOB_STATUS
    570   end
    571 
    572   # locked list
    573   task.exit    crash
    574     showcommand crash
    575     echo "hostname: $JOB_HOSTNAME"
    576     book setword detCleanupProcessedExp $options:0 pantaskState CRASH
    577   end
    578 
    579   # operation timed out?
    580   task.exit    timeout
    581     showcommand timeout
    582     book setword detCleanupProcessedExp $options:0 pantaskState TIMEOUT
    583   end
    584 end
Note: See TracChangeset for help on using the changeset viewer.