IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2011, 4:29:48 PM (15 years ago)
Author:
watersc1
Message:

Trying to merge back into trunk.

Location:
branches/czw_branch/20101203
Files:
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/ippTasks

  • branches/czw_branch/20101203/ippTasks/Makefile.am

    r30018 r30586  
    1717        warp.pro \
    1818        magic.pro \
     19        magic.cleanup.pro \
    1920        destreak.pro \
    2021        destreak.cleanup.pro \
  • branches/czw_branch/20101203/ippTasks/addstar.pro

    r28211 r30586  
    173173    $run = $run --minidvodb_group $MINIDVODB_GROUP
    174174        if (("$MINIDVODB_NAME" != "NULL") && ("$MINIDVODB_NAME" != "(null)"))
    175            $run = $run --minidvodb_name $MINIDVODB_NAME #have addstar_run.pl grab the 'active' name if it is NULL
     175           $run = $run --minidvodb_name $MINIDVODB_NAME
     176    #have addstar_run.pl grab the 'active' name if it is NULL
    176177        end
    177178    end
  • branches/czw_branch/20101203/ippTasks/diff.pro

    r28375 r30586  
    4545  end
    4646  task diff.revert
    47     active false
     47    active true
    4848  end
    4949  task diff.summary.load
     
    448448  periods      -timeout 120.0
    449449  npending     1
    450   active false
    451450
    452451  stdout NULL
     
    457456    # Only revert failures with fault=2 (SYS_ERROR), which tend to be
    458457    # temporary filesystem problems.  Every other fault type is
    459     # interesting and should be kept for debugging (and so it doesn't
     458    # interesting and should be kept for debugging (and so it does not
    460459    # continue to occur).
    461     $run = difftool -revertdiffskyfile -fault 2
     460    # XXX: actually we are getting enough jobs with fault 4 that work after reverting
     461    # that we are going to remove that cut for now
     462    #
     463    #$run = difftool -revertdiffskyfile -fault 2
     464    $run = difftool -revertdiffskyfile
    462465    if ($DB:n == 0)
    463466      option DEFAULT
  • branches/czw_branch/20101203/ippTasks/diskbalance.pro

    r29631 r30586  
    194194    book getword balancePending $pageName source_name      -var SOURCE
    195195    book getword balancePending $pageName destination_name -var DESTINATION
    196    
     196    book getword balancePending $pageName destination_host -var DEST_HOST
    197197    # Fix this with multihost restriction when possible.
    198     set.host.for.balance $DESTINATION
     198    set.host.for.balance $DEST_HOST
    199199
    200200    stdout NULL
  • branches/czw_branch/20101203/ippTasks/dist.pro

    r29386 r30586  
    6161  end
    6262  task dist.revert
    63     active false
     63    active true
    6464  end
    6565end
     
    9595end
    9696
     97# This is now only used if we are not using a nebulous outroot
    9798macro get.host.for.component
    9899    if ($0 != 3)
     
    122123end
    123124
     125# This is now only used if we are not using a nebulous outroot
    124126macro set.dist.workdir.by.component
    125127    if ($0 != 5)
     
    139141    book getword ipphosts distribution count -var count
    140142    if ("$count" == "NULL")
    141         echo "ERROR: distributin hosts list is empty"
     143        echo "ERROR: distribution hosts list is empty"
    142144        break
    143145    end
     
    289291    end
    290292
    291 
    292     set.dist.workdir.by.component $DIST_STAGE_ID $COMPONENT $OUTDIR_TEMPLATE OUTDIR
    293     if ("$OUTDIR" == "NULL")
    294         echo ERROR failed to set workdir for $COMPONENT
    295         break
    296     end
    297 
    298293    substr $COMPONENT 0 3 COMP_HEAD
    299294    if ("$COMP_HEAD" == "sky")
    300295        set.host.for.skycell $COMPONENT
     296        set.workdir.by.skycell $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
    301297    else
    302         # assume component is a class_id, if not we will default to anyhost
     298        # assume component is a class_id, if  it is not we will default to
     299        # host "anyhost"
     300        # and volume "any"
    303301        set.host.for.camera $CAMERA $COMPONENT
     302        set.workdir.by.camera $CAMERA $COMPONENT $OUTDIR_TEMPLATE $default_host OUTDIR
     303    end
     304
     305    if ("$OUTDIR" == "NULL")
     306        echo ERROR failed to set workdir for $COMPONENT
     307        break
    304308    end
    305309
    306310    sprintf logfile "%s/dist.%s.%s.log" $OUTDIR $DIST_ID $COMPONENT
    307 #    stdout $logfile
    308 #    stderr $logfile
    309311
    310312    $run = dist_component.pl --dist_id $DIST_ID --camera $CAMERA --stage $DIST_STAGE --stage_id $DIST_STAGE_ID --component $COMPONENT --path_base $PATH_BASE --chip_path_base $CHIP_PATH_BASE --state $STATE --data_state $DATA_STATE $EXTRA_ARGS --outdir $OUTDIR --logfile $logfile
     
    401403    book getpage distToAdvance 0 -var pageName -key pantaskState INIT
    402404    if ("$pageName" == "NULL") break
     405
     406    # XXX the sql for disttool -toadvance does not include the camera:
     407    # hack around this for now
     408    $CAMERA = GPC1
    403409
    404410    book setword distToAdvance $pageName pantaskState RUN
     
    414420    end
    415421
    416     host anyhost
    417 
    418     # using $DIST_ID as the "component" works fine here since we only look
    419     # at the last two digits. But make sure that there 2 digits
    420     $fake_component = $STAGE_ID + 10
    421     set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     422    substr $OUTDIR_TEMPLATE 0 3 SCHEME
     423    if ("$SCHEME" == "neb")
     424        # XXX This does not work if workdir is not in nebulous
     425        # and $default_host == "any" because /data/any does not exist
     426        # use "dummy" as component. Result will be 'any'
     427        # set.workdir.by.camera $CAMERA dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     428        set.workdir.by.camera GPC1 dummy $OUTDIR_TEMPLATE $default_host OUTDIR
     429    else
     430        # using $DIST_ID as the "component" works fine here since we only look
     431        # at the last two digits. But make sure that there 2 digits
     432        $fake_component = $STAGE_ID + 10
     433        set.dist.workdir.by.component $fake_component "exposure" $OUTDIR_TEMPLATE OUTDIR
     434    end
     435 
    422436    if ("$OUTDIR" == "NULL")
    423437        echo ERROR failed to set workdir for $DIST_ID
    424438        break
    425439    end
     440    host anyhost
    426441
    427442    sprintf logfile "%s/dist.advance.%s.log" $OUTDIR $DIST_ID
    428 #    stdout $logfile
    429 #    stderr $logfile
    430 
    431     $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
     443
     444    $run = dist_advancerun.pl --dist_id $DIST_ID --stage $STAGE --stage_id $STAGE_ID --camera $CAMERA --outdir $OUTDIR $EXTRA_ARGS --logfile $logfile
    432445    add_standard_args run
    433446
  • branches/czw_branch/20101203/ippTasks/ipphosts.mhpcc.config

    r28500 r30586  
    2222  sky09 STR  ipp014
    2323  sky10 STR  ipp015
    24   sky11 STR  ipp016
     24  sky11 STR  ipp006
    2525  sky12 STR  ipp017
    2626  sky13 STR  ipp018
     
    125125  XY26  STR  ipp027
    126126  XY27  STR  ipp028
    127   XY30  STR  ipp016
     127  XY30  STR  ipp006
    128128  XY31  STR  ipp044
    129129
     
    204204  ota26  STR  ipp027
    205205  ota27  STR  ipp028
    206   ota30  STR  ipp016
     206  ota30  STR  ipp006
    207207  ota31  STR  ipp044
    208208                   
     
    298298  XY11  STR  ipp039
    299299                   
    300   XY12  STR  ipp009
     300  XY12  STR  ipp005
    301301  XY13  STR  ipp024
    302302  XY14  STR  ipp010
     
    305305  XY16  STR  ipp011
    306306  XY17  STR  ipp026
    307   XY20  STR  ipp012
     307  XY20  STR  ipp006
    308308  XY21  STR  ipp041
    309309                   
    310310  XY22  STR  ipp013
    311311  XY23  STR  ipp042
    312   XY24  STR  ipp014
     312  XY24  STR  ipp007
    313313  XY25  STR  ipp043
    314314                   
    315315  XY26  STR  ipp027
    316316  XY27  STR  ipp028
    317   XY30  STR  ipp016
     317  XY30  STR  ipp006
    318318  XY31  STR  ipp044
    319319                   
     
    358358  XY72  STR  ipp052
    359359                   
    360   XY73  STR  ipp053
     360  XY73  STR  ipp007
    361361  XY74  STR  ipp015
    362362  XY75  STR  ipp025
     
    371371  sky02 STR  ipp007
    372372  sky03 STR  ipp008
    373   sky04 STR  ipp009
     373  sky04 STR  ipp005
    374374  sky05 STR  ipp010
    375375  sky06 STR  ipp011
    376   sky07 STR  ipp012
     376  sky07 STR  ipp006
    377377  sky08 STR  ipp013
    378   sky09 STR  ipp014
     378  sky09 STR  ipp007
    379379  sky10 STR  ipp015
    380   sky11 STR  ipp016
     380  sky11 STR  ipp006
    381381  sky12 STR  ipp017
    382382  sky13 STR  ipp018
     
    414414  sky45 STR  ipp051
    415415  sky46 STR  ipp052
    416   sky47 STR  ipp053
     416  sky47 STR  ipp007
    417417  sky48 STR  ipp023
    418418  sky49 STR  ipp024
     
    445445  sky76 STR  ipp051
    446446  sky77 STR  ipp052
    447   sky78 STR  ipp053
    448 END
     447  sky78 STR  ipp006
     448END
  • branches/czw_branch/20101203/ippTasks/nightly_science.pro

    r30018 r30586  
    77    ns.detrends.off
    88    ns.dqstats.on
    9 #    ns.sweetspot.on
    10 #    ns.registration.on
    11 #    ns.burntool.on
    12 #    ns.chips.on
    139    ns.stacks.on
    1410    ns.diffs.on
     
    1915    ns.detrends.off
    2016    ns.dqstats.off
    21 #    ns.sweetspot.off
    22 #    ns.registration.off
    23 #    ns.burntool.off
    24 #    ns.chips.off
    2517    ns.stacks.off
    2618    ns.diffs.off
     
    5345end
    5446
    55 # macro ns.sweetspot.on
    56 #   task ns.sweetspot.load
    57 #     active true
    58 #   end
    59 # end
    60 
    61 # macro ns.registration.on
    62 #   task ns.registration.load
    63 #     active true
    64 #   end
    65 # end
    66 
    67 # macro ns.burntool.on
    68 #   task ns.burntool.load
    69 #     active true
    70 #   end
    71 #   task ns.burntool.run
    72 #     active true
    73 #   end
    74 # end
    75 
    76 # macro ns.chips.on
    77 #   task ns.chips.load
    78 #     active true
    79 #   end
    80 #   task ns.chips.run
    81 #     active true
    82 #   end
    83 # end
    84 
    8547macro ns.stacks.on
    8648  task ns.stacks.load
     
    9153  end
    9254  task ns.stacks.confirm
    93     active true
     55    active false
    9456  end
    9557end
     
    12284end
    12385
    124 # macro ns.sweetspot.off
    125 #   task ns.sweetspot.load
    126 #     active false
    127 #   end
    128 # end
    129 
    130 # macro ns.registration.off
    131 #   task ns.registration.load
    132 #     active false
    133 #   end
    134 # end
    135 
    136 # macro ns.burntool.off
    137 #   task ns.burntool.load
    138 #     active false
    139 #   end
    140 #   task ns.burntool.run
    141 #     active false
    142 #   end
    143 # end
    144 
    145 # macro ns.chips.off
    146 #   task ns.chips.load
    147 #     active false
    148 #   end
    149 #   task ns.chips.run
    150 #     active false
    151 #   end
    152 # end
    153 
    15486macro ns.stacks.off
    15587  task ns.stacks.load
     
    15991    active false
    16092  end
     93  task ns.stacks.confirm
     94    active false
     95  end
     96
    16197end
    16298
     
    170106end
    171107
    172 # $ns_regPAGE = 0
    173 # $ns_burnPAGE = 0
    174 # $ns_RburnPAGE = 0
    175 # $ns_RburnCELL = 0
    176 # $ns_chipPAGE = 0
    177 # $ns_RchipPAGE = 0
     108macro ns.stacks.confirm.on
     109  task ns.stacks.confirm
     110    active true
     111  end
     112end
     113
     114macro ns.stacks.confirm.off
     115  task ns.stacks.confirm
     116    active false
     117  end
     118end
     119
     120
    178121$ns_stackPAGE = 0
    179122$ns_RstackPAGE = 0
     
    183126
    184127book init nsData
     128book init nsDiffs
     129book init nsStacks
    185130#
    186131# Macros to control the book.
    187132#
    188133macro ns.add.date
     134  if ($0 != 2)
     135    echo "USAGE: ns.add.date (YYYY-MM-DD)"
     136    break
     137  end
     138
    189139   book newpage nsData $1
    190140   book setword nsData $1 nsState NEW
    191    book setword nsData $1 nsStackState TOWARP
    192    book setword nsData $1 nsDiffState TOWARP
     141   book setword nsData $1 dbname $DB:0
     142
     143   book newpage nsDiffs $1
     144   book setword nsDiffs $1 nsDiffState TOWARP
     145   book setword nsDiffs $1 nsObservingState UNKNOWN
     146
     147   book newpage nsStacks $1
     148   book setword nsStacks $1 nsStackState TOWARP
     149
    193150end
    194151
     
    198155       book getpage nsData $i -var date
    199156       book getword nsData $date nsState -var state
    200        book getword nsData $date nsStackState -var Sstate
    201        book getword nsData $date nsDiffState -var Dstate
    202        book getword nsData $date nsObservingState -var Ostate
     157       book getword nsStacks $date nsStackState -var Sstate
     158       book getword nsDiffs $date nsDiffState -var Dstate
     159       book getword nsDiffs $date nsObservingState -var Ostate
    203160       echo $date $state $Sstate $Dstate $Ostate
    204161    end
     
    212169    book setword nsData $1 nsState $2
    213170end
    214 
    215171
    216172
     
    232188    book newpage nsData $today
    233189    book setword nsData $today nsState NEW
    234     book setword nsData $today nsStackState TOWARP
    235     book setword nsData $today nsDiffState TOWARP
     190    book newpage nsStacks $today
     191    book setword nsStacks $today nsStackState TOWARP
     192    book newpage nsDiffs $today
     193    book setword nsDiffs $today nsDiffState TOWARP
    236194    book setword nsData $today dbname $DB:0
    237195
    238196#    command echo $today
    239    command nightly_science.pl --clean_old --date $today --dbname $DB:0
     197   $run = nightly_science.pl --clean_old --date $today --dbname $DB:0
     198#    add_standard_args run
     199    command $run
    240200  end
    241201
     
    272232    $today = `date -u +%Y-%m-%d`
    273233
    274     command nightly_science.pl --queue_detrends --date $today --dbname $DB:0
    275     add_standard_args
     234    $run = nightly_science.pl --queue_detrends --date $today --dbname $DB:0
     235#     add_standard_args $run
     236     command $run
    276237  end
    277238 
     
    309270    $today = `date -u +%Y-%m-%d`
    310271
    311     command nightly_science.pl --queue_dqstats --date $today --dbname $DB:0
    312     add_standard_args
     272    $run = nightly_science.pl --queue_dqstats --date $today --dbname $DB:0
     273#     add_standard_args $run
     274     command $run
     275
    313276  end
    314277
     
    333296#
    334297task              ns.stacks.load
     298  active          false
    335299  host            local
    336300  periods         -poll $LOADPOLL
     
    344308
    345309     book getpage nsData $ns_stackPAGE -var date
    346      book getword nsData $date nsStackState -var ns_STATE
    347      book getword nsData $date dbname -var $DBNAME
     310     book getword nsStacks $date nsStackState -var ns_STATE
     311     book getword nsDiffs $date nsDiffState -var ns_diff_STATE
     312     book getword nsData $date dbname -var DBNAME
    348313     book npages nsData -var Npages
    349314
     
    358323     if ("$ns_STATE" != "TOWARP") break
    359324
    360      $run = nightly_science.pl --check_stacks --date $date
    361      add_standard_args
     325     $run = nightly_science.pl --check_stacks --date $date --dbname $DBNAME
     326#     add_standard_args $run
    362327     command $run
    363328
     
    367332  task.exit   0
    368333#    convert 'stdout' to book format
    369     book delpage nsData $options:0
    370     ipptool2book stdout nsData -uniq -key date
    371 
    372     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     334    book delpage nsStacks $options:0
     335    ipptool2book stdout nsStacks -uniq -key date
     336
     337    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    373338    if ("$ns_Nmacros" != "NULL")
    374339        for i 0 $ns_Nmacros
    375340            sprintf macroName "ns%dMacro" $i
    376             book getword nsData $options:0 $macroName -var macroCmd
     341            book getword nsStacks $options:0 $macroName -var macroCmd
    377342            $macroCmd
    378343        end
     
    413378
    414379     book getpage nsData $ns_RstackPAGE -var date
    415      book getword nsData $date nsStackState -var ns_STATE
    416      book getword nsData $date dbname -var $DBNAME
     380     book getword nsStacks $date nsStackState -var ns_STATE
     381     book getword nsDiffs $date nsDiffState -var ns_diff_STATE
     382     book getword nsData $date dbname -var DBNAME
    417383     book npages nsData -var Npages
    418384
     
    425391     option $date
    426392
    427      if (("$ns_STATE" != "QUEUESTACKS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    428      $run = nightly_science.pl --queue_stacks --date $date
    429      add_standard_args
     393     if (("$ns_STATE" != "STACKING")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
     394     $run = nightly_science.pl --queue_stacks --date $date --dbname $DBNAME
     395#     add_standard_args $run
    430396     command $run
    431397   end
     
    433399  task.exit   0
    434400#    convert 'stdout' to book format
    435     book delpage nsData $options:0
     401    book delpage nsStacks $options:0
    436402# We've queued up stacking. We're done with this date, so don't reload the page.
    437     ipptool2book stdout nsData -uniq -key date
    438 
    439     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     403    ipptool2book stdout nsStacks -uniq -key date
     404
     405    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    440406    if ("$ns_Nmacros" != "NULL")
    441407        for i 0 $ns_Nmacros
    442408            sprintf macroName "ns%dMacro" $i
    443             book getword nsData $options:0 $macroName -var macroCmd
     409            book getword nsStacks $options:0 $macroName -var macroCmd
    444410            $macroCmd
    445411        end
     
    468434#
    469435task              ns.stacks.confirm
     436  active          false
    470437  host            local
    471438  periods         -poll $LOADPOLL
     
    479446
    480447     book getpage nsData $ns_CstackPAGE -var date
    481      book getword nsData $date nsStackState -var ns_STATE
    482      book getword nsData $date dbname -var $DBNAME
     448     book getword nsStacks $date nsStackState -var ns_STATE
     449     book getword nsData $date dbname -var DBNAME
    483450     book npages nsData -var Npages
    484451
     
    492459
    493460     if ("$ns_STATE" != "STACKING") break
    494      $run = nightly_science.pl --confirm_stacks --date $date
    495      add_standard_args
     461     $run = nightly_science.pl --confirm_stacks --date $date --dbname $DBNAME
     462#     add_standard_args $run
    496463     command $run
    497464   end
     
    499466  task.exit   0
    500467#    convert 'stdout' to book format
    501     book delpage nsData $options:0
    502     ipptool2book stdout nsData -uniq -key date
    503 
    504     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     468    book delpage nsStacks $options:0
     469    ipptool2book stdout nsStacks -uniq -key date
     470
     471    book getword nsStacks $options:0 nsNmacros -var ns_Nmacros
    505472    if ("$ns_Nmacros" != "NULL")
    506473        for i 0 $ns_Nmacros
    507474            sprintf macroName "ns%dMacro" $i
    508             book getword nsData $options:0 $macroName -var macroCmd
     475            book getword nsStacks $options:0 $macroName -var macroCmd
    509476            $macroCmd
    510477        end
     
    534501#
    535502task              ns.diffs.load
     503  active          false
    536504  host            local
    537505  periods         -poll $LOADPOLL
     
    545513
    546514     book getpage nsData $ns_diffPAGE -var date
    547      book getword nsData $date nsDiffState -var ns_STATE
    548      book getword nsData $date dbname -var $DBNAME
     515     book getword nsDiffs $date nsDiffState -var ns_STATE
     516     book getword nsStacks $date nsStackState -var ns_stack_STATE
     517     book getword nsData $date dbname -var DBNAME
    549518     book npages nsData -var Npages
    550519
     
    558527
    559528     if ("$ns_STATE" != "TOWARP") break
    560      $run = nightly_science.pl --check_diffs --date $date
    561      add_standard_args
     529     $run = nightly_science.pl --check_diffs --date $date --dbname $DBNAME
     530#     add_standard_args $run
    562531     command $run
    563532   end
     
    566535  task.exit   0
    567536#    convert 'stdout' to book format
    568     book delpage nsData $options:0
    569     ipptool2book stdout nsData -uniq -key date
    570 
    571     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     537    book delpage nsDiffs $options:0
     538    ipptool2book stdout nsDiffs -uniq -key date
     539
     540    book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
    572541    if ("$ns_Nmacros" != "NULL")
    573542        for i 0 $ns_Nmacros
    574543            sprintf macroName "ns%dMacro" $i
    575             book getword nsData $options:0 $macroName -var macroCmd
     544            book getword nsDiffs $options:0 $macroName -var macroCmd
    576545            $macroCmd
    577546        end
     
    604573  periods         -poll $LOADPOLL
    605574  periods         -exec $LOADEXEC
    606   periods         -timeout 120
     575  periods         -timeout 900
    607576  npending        1
    608577
     
    612581
    613582     book getpage nsData $ns_RdiffPAGE -var date
    614      book getword nsData $date nsDiffState -var ns_STATE
    615      book getword nsData $date dbname -var $DBNAME
     583     book getword nsDiffs $date nsDiffState -var ns_STATE
     584     book getword nsStacks $date nsStackState -var ns_stack_STATE
     585     book getword nsData $date dbname -var DBNAME
    616586     book npages nsData -var Npages
    617587
     
    624594     option $date
    625595
    626      if (("$ns_STATE" != "QUEUEDIFFS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
    627      $run = nightly_science.pl --queue_diffs --date $date
    628      add_standard_args
     596     if (("$ns_STATE" != "DIFFING")&&("$ns_STATE" != "QUEUEDIFFS")&&("$ns_STATE" != "TOWARP")&&("$ns_STATE" != "FORCETOWARP")) break
     597     $run = nightly_science.pl --queue_diffs --date $date --dbname $DBNAME
     598#     add_standard_args $run
    629599     command $run
    630600   end
     
    632602  task.exit   0
    633603#    convert 'stdout' to book format
    634     book delpage nsData $options:0
     604    book delpage nsDiffs $options:0
    635605# We've queued up diffing. We're done with this date, so don't reload the page.
    636     ipptool2book stdout nsData -uniq -key date
    637 
    638     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     606    ipptool2book stdout nsDiffs -uniq -key date
     607
     608    book getword nsDiffs $options:0 nsNmacros -var ns_Nmacros
    639609    if ("$ns_Nmacros" != "NULL")
    640610        for i 0 $ns_Nmacros
    641611            sprintf macroName "ns%dMacro" $i
    642             book getword nsData $options:0 $macroName -var macroCmd
     612            book getword nsDiffs $options:0 $macroName -var macroCmd
    643613            $macroCmd
    644614        end
  • branches/czw_branch/20101203/ippTasks/pstamp.pro

    r29719 r30586  
    148148end
    149149
     150macro pstamp.status.on
     151    task pstamp.save.status
     152        active true
     153    end
     154end
     155macro pstamp.status.off
     156    task pstamp.save.status
     157        active false
     158    end
     159end
     160macro pstamp.status.set.exec
     161    task pstamp.save.status
     162        periods -exec $1
     163    end
     164end
     165
    150166task pstamp.request.find
    151167    host        local
     
    258274        book getword pstampRequest $pageName ds_outProduct -var PRODUCT
    259275        book getword pstampRequest $pageName outdir -var OUTDIR
     276        book getword pstampRequest $pageName need_magic -var NEED_MAGIC
    260277        book getword pstampRequest $pageName label -var LABEL
    261278
     
    263280
    264281        $run = pstamp_parser_run.pl --req_id $REQ_ID --uri $URI --product $PRODUCT --outdir $OUTDIR --label $LABEL --redirect-output
     282
     283        if ($NEED_MAGIC != 0)
     284            $run = $run --need_magic
     285        end
    265286
    266287        add_standard_args run
     
    900921    end
    901922end
     923
     924task pstamp.save.status
     925    host        local
     926
     927    periods     -poll $LOADPOLL
     928    periods     -exec 90
     929    periods     -timeout 20
     930    npending    1
     931
     932    task.exec
     933        stdout NULL
     934        stderr $LOGSUBDIR/pstamp.save.status.log
     935
     936        $run = pstamp_save_server_status.pl --update-link
     937        command $run
     938    end
     939
     940    task.exit $EXIT_SUCCESS
     941        # echo nothing to do
     942    end
     943
     944    task.exit   default
     945        showcommand failure
     946    end
     947
     948    task.exit   crash
     949        showcommand crash
     950    end
     951
     952    task.exit   timeout
     953        showcommand timeout
     954    end
     955end
  • branches/czw_branch/20101203/ippTasks/publish.pro

    r30118 r30586  
    7979    end
    8080    add_poll_args run
     81    add_poll_labels run
    8182    command $run
    8283  end
     
    131132    book getword publishRun $pageName dbname -var DBNAME
    132133    book getword publishRun $pageName output_format -var OUTPUT_FORMAT
     134    book getword publishRun $pageName need_magic -var NEED_MAGIC
    133135
    134136    stdout $LOGDIR/publish.run.log
     
    139141
    140142    $run = publish_file.pl --pub_id $PUB_ID --camera $CAMERA --workdir $WORKDIR --product $PRODUCT --stage $STAGE --stage_id $STAGE_ID --output_format $OUTPUT_FORMAT --redirect-output
     143
     144    if ("$NEED_MAGIC" == "T")
     145        $run = $run --need-magic
     146    end
     147
    141148    add_standard_args run
    142149
  • branches/czw_branch/20101203/ippTasks/rcserver.pro

    r28792 r30586  
    136136
    137137    sprintf logfile "%s/makefs.%s.%s.log" $DIST_DIR $DIST_ID $DEST_ID
    138     stdout $logfile
    139     stderr $logfile
    140138
    141139    book setword rcPendingFS $pageName pantaskState RUN
    142140
    143     $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR
     141    $run = dist_make_fileset.pl --dist_id $DIST_ID --target_id $TARGET_ID --stage $STAGE --stage_id $STAGE_ID --data_group $DATA_GROUP --filter $FILTER --dest_id $DEST_ID --product_name $PRODUCT_NAME  --ds_dbhost $DS_DBHOST --ds_dbname $DS_DBNAME --dist_dir $DIST_DIR --logfile $logfile
    144142
    145143    add_standard_args run
  • branches/czw_branch/20101203/ippTasks/register.pro

    r30118 r30586  
    99book init regPendingExp
    1010book init regPendingBurntoolImfile
     11book init regDates
    1112
    1213macro register.reset
     
    1415  book init regPendingExp
    1516  book init regPendingBurntoolImfile
     17  book init regDates
    1618end
    1719
     
    2123  book listbook regPendingExp
    2224  book listbook regPendingBurntoolImfile
     25  book listbook regDates
    2326end
    2427
     
    3033    active true
    3134  end
     35  task register.imfile.revert
     36    active false
     37  end
    3238  task register.exp.load
    3339    active true
     
    5157    active false
    5258  end
     59  task register.imfile.revert
     60    active false
     61  end
    5362  task register.exp.load
    5463    active false
     
    6574end
    6675
    67 $valid_burntool_value = 14
     76macro register.revert.on
     77  task register.imfile.revert
     78    active true
     79  end
     80end
     81
     82macro register.revert.off
     83  task register.imfile.revert
     84    active false
     85  end
     86end
     87
     88macro burntool.on
     89  task register.burntool.load
     90    active true
     91  end
     92  task register.burntool.run
     93    active true
     94  end
     95end
     96
     97macro burntool.off
     98  task register.burntool.load
     99    active false
     100  end
     101  task register.burntool.run
     102    active false
     103  end
     104end
     105
     106macro register.add.date
     107  if ($0 != 4)
     108    echo "USAGE: register.add.date (YYYY-MM-DD) (DBNAME) (VALID_BURNTOOL)"
     109    break
     110  end
     111
     112   book newpage regDates $1
     113   book setword regDates $1 nsState NEW
     114   book setword regDates $1 dbname $2
     115   book setword regDates $1 valid_burntool $3
     116end
     117
     118
     119# $valid_burntool_value = 14
     120$sunrise = 17:30:00
     121$sunset  = 03:30:00
    68122
    69123macro replace.survey.values
     
    147201$regPendingImfile_DB = 0
    148202$regPendingBurntoolImfile_DB = 0
     203$regRevertImfile_DB = 0
    149204$regPendingExp_DB = 0
    150205
     
    265320    # XXX register_imfile.pl differs from the standard script : it does not have an 'outroot' argument, and it does not take '--redirect'
    266321    $run = register_imfile.pl --exp_id $EXP_ID --tmp_class_id $TMP_CLASS_ID --tmp_exp_name $TMP_EXP_NAME --uri $URI --logfile $logfile --bytes $BYTES --md5sum $MD5SUM
     322    $run = $run --sunset $sunset --sunrise $sunrise
    267323    add_standard_args run
    268324
     
    295351  end
    296352end
     353
     354task register.imfile.revert
     355  host         local
     356  periods      -poll 60.0
     357  periods      -exec 1800.0
     358  periods      -timeout 120.0
     359  npending     1
     360
     361  stdout       NULL
     362  stderr       $LOGDIR/register.imfile.revert.log
     363
     364  task.exec
     365    $run = regtool -revertprocessedimfile
     366    if ($DB:n == 0)
     367      option DEFAULT
     368    else
     369      option $DB:$regRevertImfile_DB
     370      $run = $run -dbname $DB:$regRevertImfile_DB
     371      $regRevertImfile_DB ++
     372      if ($regRevertImfile_DB >= $DB:n) set regRevertImfile_DB = 0
     373    end
     374    add_poll_args run
     375    command $run
     376  end
     377
     378  # success
     379  task.exit    0
     380  end
     381
     382  # locked list
     383  task.exit    default
     384    showcommand failure
     385  end
     386
     387  task.exit    crash
     388    showcommand crash
     389  end
     390
     391  # operation times out
     392  task.exit    timeout
     393    showcommand timeout
     394  end
     395end
     396
    297397
    298398# select exposures ready for register_exp.pl
     
    463563  # select entried from the current DB; cycle to the next DB, if it exists
    464564  task.exec
     565     book npages regDates -var Npages
     566     if ($Npages == 0)
     567       $today = `date -u +%Y-%m-%d`
     568       $dbname = $DB:0
     569       $valid_burntool = 14
     570     else
     571       book getpage regDates $reg_datePAGE -var today
     572       book getword regDates $today dbname -var dbname
     573       book getword regDates $today valid_burntool -var valid_burntool
     574       $reg_datePAGE ++
     575       if ($reg_datePAGE >= $Npages) set reg_datePAGE = 0
     576     end
     577
    465578    $run = regtool -pendingburntoolimfile
    466     $today = `date -u +%Y-%m-%d`
     579
    467580# debugging purposes
    468 #    $today = "2010-12-06"
    469     $run = $run -date $today -valid_burntool $valid_burntool_value
    470     if ($DB:n == 0)
    471       option DEFAULT
    472     else
    473       # save the DB name for the exit tasks
    474       option $DB:$regPendingBurntoolImfile_DB
    475       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
    476       $regPendingBurntoolImfile_DB ++
    477       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
    478     end
     581#   $today = "2010-12-25"
     582    $dateobs_begin = $today\T$sunset
     583    $dateobs_end   = $today\T$sunrise
     584    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool
     585    $run = $run -dbname $dbname
     586    option $dbname
     587#     if ($DB:n == 0)
     588#       option DEFAULT
     589#     else
     590#       # save the DB name for the exit tasks
     591#       option $DB:$regPendingBurntoolImfile_DB
     592#       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     593#       if ("$dbname" != "$DB:$regPendingBurntoolImfile_DB")
     594#         break
     595#       end
     596#       $regPendingBurntoolImfile_DB ++
     597#       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     598#     end
    479599
    480600#    echo $run
     
    574694end
    575695
    576    
     696task   register.initday.load
     697  host            local
     698  periods         -poll $LOADPOLL
     699  periods         -exec $LOADEXEC
     700  periods         -timeout 30
     701  trange          0:00:00 1:00:00 -nmax 1
     702  npending        1
     703
     704  task.exec
     705    $today = `date -u +%Y-%m-%d`
     706    book newpage regDates $today
     707    book setword regDates $today nsState NEW
     708    book setword regDates $today dbname $DB:0
     709    book setword regDates $today valid_burntool 14
     710
     711    command true
     712  end
     713
     714  task.exit       0
     715    # nothing to do here?
     716  end
     717  # locked list
     718  task.exit    default
     719    showcommand failure
     720  end
     721  task.exit    crash
     722    showcommand crash
     723  end
     724  #operation times out?
     725  task.exit    timeout
     726    showcommand timeout
     727  end
     728end
     729
    577730   
    578731 
  • branches/czw_branch/20101203/ippTasks/survey.pro

    r29768 r30586  
    259259# user functions to manipulate destreak labels
    260260macro survey.add.destreak
    261   if ($0 != 3)
    262     echo "USAGE: survey.add.destreak (label) (workdir base)"
     261  if ($0 != 4)
     262    echo "USAGE: survey.add.destreak (label) (workdir base) (recovery root)"
    263263    break
    264264  end
    265265  book newpage SURVEY_DESTREAK $1
    266266  book setword SURVEY_DESTREAK $1 WORKDIR $2
     267  book setword SURVEY_DESTREAK $1 RECOVERYROOT $3
    267268  book setword SURVEY_DESTREAK $1 STATE PENDING
    268269end
     
    286287# user functions to manipulate dist labels
    287288macro survey.add.dist
    288   if ($0 != 2)
    289     echo "USAGE: survey.add.dist (label)"
     289  if ($0 != 3)
     290    echo "USAGE: survey.add.dist (label) (workdir)"
    290291    break
    291292  end
    292293  book newpage SURVEY_DIST $1
     294  book setword SURVEY_DIST $1 WORKDIR $2
    293295  book setword SURVEY_DIST $1 STATE PENDING
    294296end
     
    366368# user functions to manipulate publish labels
    367369macro survey.add.publish
    368   if ($0 != 3)
    369     echo "USAGE: survey.add.publish (label) (client_id)"
     370  if ($0 != 5)
     371    echo "USAGE: survey.add.publish (tag) (label) (client_id) (comment)"
    370372    break
    371373  end
    372374  book newpage SURVEY_PUBLISH $1
    373   book setword SURVEY_PUBLISH $1 CLIENT_ID $2
     375  book setword SURVEY_PUBLISH $1 LABEL $2
     376  book setword SURVEY_PUBLISH $1 CLIENT_ID $3
     377  book setword SURVEY_PUBLISH $1 COMMENT $4
    374378  book setword SURVEY_PUBLISH $1 STATE PENDING
    375379end
     
    821825    book setword SURVEY_DESTREAK $label STATE DONE
    822826    book getword SURVEY_DESTREAK $label WORKDIR -var workdir
     827    book getword SURVEY_DESTREAK $label RECOVERYROOT -var recoveryroot
    823828 
    824829    $run = magic_destreak_defineruns.pl --label $label --workdir $workdir/$label
     830    if ("$recoveryroot" != "NULL")
     831        $run = $run --recoveryroot $recoveryroot/$label
     832    end
    825833
    826834    if ($DB:n == 0)
     
    889897    end
    890898
     899    book getword SURVEY_DIST $label WORKDIR -var workdir_base
     900    $year = `date +%Y`
     901    $month = `date +%m`
     902    $day = `date +%d`
     903    $workdir = $workdir_base/$label/$year/$month/$day
     904
    891905    book setword SURVEY_DIST $label STATE DONE
    892906 
    893907    # note workdir is set by the script based on site.config
    894     $run = dist_defineruns.pl --label $label
     908    $run = dist_defineruns.pl --label $label --workdir $workdir
    895909
    896910    if ($DB:n == 0)
     
    901915    end
    902916   
    903 #    echo $run
     917    if ($VERBOSE > 1 )
     918        echo $run
     919    end
    904920    command $run
    905921  end
     
    10841100    endif
    10851101
    1086     book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
    1087     if ("$label" == "NULL")
    1088       # All labels have been done --- reset
    1089       # echo "Resetting labels"
     1102    # survey.publish allows multiple entries per label.
     1103    # The key is called tag and must be unique
     1104    book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
     1105    if ("$tag" == "NULL")
     1106      # All tags have been done --- reset
     1107      # echo "Resetting tags"
    10901108      for i 0 $N
    1091         book getpage SURVEY_PUBLISH $i -var label
    1092         book setword SURVEY_PUBLISH $label STATE NEW
     1109        book getpage SURVEY_PUBLISH $i -var tag
     1110        book setword SURVEY_PUBLISH $tag STATE NEW
    10931111      end
    1094       book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
     1112      book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
    10951113
    10961114      # Select different database
     
    10991117    end
    11001118
    1101     book setword SURVEY_PUBLISH $label STATE DONE
    1102     book getword SURVEY_PUBLISH $label CLIENT_ID -var client_id
     1119    book setword SURVEY_PUBLISH $tag STATE DONE
     1120    book getword SURVEY_PUBLISH $tag LABEL -var label
     1121    book getword SURVEY_PUBLISH $tag CLIENT_ID -var client_id
     1122    book getword SURVEY_PUBLISH $tag COMMENT -var comment
    11031123 
    11041124    $run = pubtool -definerun -label $label -client_id $client_id
     1125
     1126    if ("$comment" != "NULL")
     1127        $run = $run -comment $comment
     1128    end
    11051129
    11061130    if ($DB:n == 0)
     
    11111135    end
    11121136   
    1113     #echo $run
     1137    echo $run
     1138
    11141139    command $run
     1140   
    11151141  end
    11161142
Note: See TracChangeset for help on using the changeset viewer.