IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29361


Ignore:
Timestamp:
Oct 8, 2010, 11:59:42 AM (16 years ago)
Author:
bills
Message:

From trunk. split move destreak.cleanup tasks to their own file
Slow down exec time for the destreak.revert.load task

Location:
tags/ipp-20100823/ippTasks
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tags/ipp-20100823/ippTasks/Makefile.am

    r28632 r29361  
    1818        magic.pro \
    1919        destreak.pro \
     20        destreak.cleanup.pro \
    2021        diff.pro \
    2122        stack.pro \
  • tags/ipp-20100823/ippTasks/destreak.cleanup.pro

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/czw_branch/20100427/ippTasks/destreak.cleanup.pro27784-28042
      /branches/czw_branch/20100519/ippTasks/destreak.cleanup.pro28044-28338
      /branches/haf_branches/ipp.20100512/ippTasks/destreak.cleanup.pro27935-28180
      /branches/pap/ippTasks/destreak.cleanup.pro27706-28005,​28177-28485,​28498-28535
  • tags/ipp-20100823/ippTasks/destreak.pro

    r29209 r29361  
    1010book init magicToDS
    1111book init magicDSToRevert
    12 book init magicDSToCleanup
    1312
    1413### indexes into Database lists
     
    3231### Check status of tasks
    3332macro destreak.status
    34     # since echo and listbook output go to different files these do not come in order
    35     echo magicToDS
    3633    book listbook magicToDS
    37     echo magicDSToRevert
    3834    book listbook magicDSToRevert
    39     echo magicDSToCleanup
    40     book listbook magicDSToCleanup
    4135end
    4236
     
    4539    book init magicToDS
    4640    book init magicDSToRevert
    47     book init magicDSToCleanup
    4841end
    4942
     
    7366end
    7467
    75 macro destreak.cleanup.on
    76     task destreak.cleanup.load
    77         active true
    78     end
    79     task destreak.cleanup.run
    80         active true
    81     end
    82 end
    83 
    8468### Turn tasks off
    8569macro destreak.off
     
    10690    end
    10791end
    108 macro destreak.cleanup.off
    109     task destreak.cleanup.load
    110         active false
    111     end
    112     task destreak.cleanup.run
    113         active false
    114     end
    115 end
    116 
    11792
    11893task           destreak.load
     
    319294task           destreak.revert.load
    320295  host         local
    321 
    322   periods      -poll $LOADPOLL
    323   periods      -exec $LOADEXEC
    324   periods      -timeout 20
     296  periods      -poll 60.0
     297  periods      -exec 900.
     298  periods      -timeout 120
    325299  npending     1
    326300  active       false
     
    520494end
    521495
    522 task           destreak.cleanup.load
    523   host         local
    524 
    525   periods      -poll $LOADPOLL
    526   periods      -exec $LOADEXEC
    527   periods      -timeout 20
    528   npending     1
    529   active       false
    530 
    531   stdout NULL
    532   stderr $LOGSUBDIR/destreak.cleanup.load.log
    533 
    534   task.exec
    535     $run = magicdstool -tocleanup
    536     if ($DB:n == 0)
    537       option DEFAULT
    538     else
    539 
    540       # save the DB name for the exit tasks
    541       option $DB:$magicDSToCleanup_DB
    542       $run = $run -dbname $DB:$magicDSToCleanup_DB
    543 
    544       # only bump database number after we have gone through all of the stages
    545       $magicDSToCleanup_DB ++
    546       if ($magicDSToCleanup_DB >= $DB:n) set magicDSToCleanup_DB = 0
    547     end
    548     add_poll_args run
    549     add_poll_labels run
    550     command $run
    551   end
    552 
    553   # success
    554   task.exit    0
    555     # convert 'stdout' to book format
    556     ipptool2book stdout magicDSToCleanup -key magic_ds_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    557     if ($VERBOSE > 2)
    558       book listbook magicDSToCleanup
    559     end
    560 
    561     # delete existing entries in the appropriate pantaskStates
    562     process_cleanup magicDSToCleanup
    563   end
    564 
    565   # locked list
    566   task.exit    default
    567     showcommand failure
    568   end
    569 
    570   task.exit    crash
    571     showcommand crash
    572   end
    573 
    574   # operation times out?
    575   task.exit    timeout
    576     showcommand timeout
    577   end
    578 end
    579 
    580 task           destreak.cleanup.run
    581   periods      -poll $RUNPOLL
    582   periods      -exec $RUNEXEC
    583   periods      -timeout 60
    584   active       false
    585 
    586   task.exec
    587     stdout $LOGSUBDIR/destreak.cleanup.run.log
    588     stderr $LOGSUBDIR/destreak.cleanup.run.log
    589 
    590     # if we are unable to run the 'exec', use a long retry time
    591     periods -exec $RUNEXEC
    592 
    593     book npages magicDSToCleanup -var N
    594     if ($N == 0) break
    595     if ($NETWORK == 0) break
    596    
    597     # look for new images (pantaskState == INIT)
    598     book getpage magicDSToCleanup 0 -var pageName -key pantaskState INIT
    599     if ("$pageName" == "NULL") break
    600 
    601     book setword magicDSToCleanup $pageName pantaskState RUN
    602     book getword magicDSToCleanup $pageName magic_ds_id -var MAGIC_DS_ID
    603     book getword magicDSToCleanup $pageName camera -var CAMERA
    604     book getword magicDSToCleanup $pageName stage -var STAGE
    605     book getword magicDSToCleanup $pageName outroot -var OUTROOT
    606     book getword magicDSToCleanup $pageName dbname -var DBNAME
    607 
    608     sprintf logfile "%s/mds.%s.cleanup.log" $OUTROOT $MAGIC_DS_ID
    609 
    610     host anyhost
    611 
    612     $run = magic_destreak_cleanup.pl --magic_ds_id $MAGIC_DS_ID --stage $STAGE --camera $CAMERA --logfile $logfile
    613 
    614     add_standard_args run
    615 
    616     # save the pageName for future reference below
    617     options $pageName
    618 
    619     # create the command line
    620     if ($VERBOSE > 1)
    621       echo command $run
    622     end
    623     # if we are ready to run, drop the retry timeout low so we fill up the queue
    624     periods -exec 0.05
    625     command $run
    626   end
    627 
    628   # default exit status
    629   task.exit    0
    630     process_exit magicDSToCleanup $options:0 $JOB_STATUS
    631    end
    632 
    633   # locked list
    634   task.exit    default
    635     showcommand failure
    636     process_exit magicDSToCleanup $options:0 $JOB_STATUS
    637   end
    638 
    639   task.exit    crash
    640     showcommand crash
    641     book setword magicDSToCleanup $options:0 pantaskState CRASH
    642   end
    643 
    644   # operation timed out?
    645   task.exit    timeout
    646     showcommand timeout
    647     book setword magicDSToCleanup $options:0 pantaskState TIMEOUT
    648   end
    649 end
    650 
Note: See TracChangeset for help on using the changeset viewer.