IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16570


Ignore:
Timestamp:
Feb 21, 2008, 2:13:38 PM (18 years ago)
Author:
eugene
Message:

move site-specific macros to site.manoa.pro, site.mhpcc.pro; improve automate.pro

Location:
trunk/ippTasks
Files:
4 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/Makefile.am

    r16492 r16570  
    1818
    1919other_files = \
    20         chiphosts.config \
     20        chiphosts.manoa.config \
     21        chiphosts.mhpcc.config \
     22        site.manoa.pro \
     23        site.mhpcc.pro \
     24        simtest.auto \
    2125        simtest.det \
    2226        isp.det
  • trunk/ippTasks/automate.pro

    r16492 r16570  
    2626  end
    2727  queueload tmp -x "cat $MODULES:0/$1"
    28   ipptool2book tmp automate -key name -uniq -setword pantaskState INIT
     28  ipptool2book tmp automate -key name -uniq -setword pantaskState INIT.BLOCK
    2929  queuedelete tmp
    3030end
    3131
    32 $automate_Ncheck = 0
    33 
    34 task automate.check
     32$automate_Nblock = -1
     33task automate.block
    3534  host         local
    3635
    3736  periods      -poll 1
    38   periods      -exec 10
     37  periods      -exec 5
    3938  periods      -timeout 30
    4039  active       true
     
    4241
    4342  task.exec
    44     local N Npage pageName
     43    local Npage pageName
    4544
    4645    # how many pages are waiting to be started?
    47     book npages automate -var N -key pantaskState INIT
    48     if ($N == 0) break
    49 
    50     # total number of pages in book
    51     book npages automate -var Npage
    52 
    53     $automate_Ncheck ++
    54     if ($automate_Ncheck >= $Npage) set automate_Ncheck = 0
    55 
    56     # search the automate book for an entry which is unstarted (state INIT)
    57     book getpage automate $automate_Ncheck -var pageName -key pantaskState INIT
    58     if ("$pageName" == "NULL") break
     46    book npages automate -var Npage -key pantaskState INIT.BLOCK
     47    if ($Npage == 0)
     48      echo "no entries in INIT.BLOCK state"
     49      break
     50    end
     51
     52    # cycle over the number of INIT.BLOCK pages: no point to loop over the others
     53    $automate_Nblock ++
     54    if ($automate_Nblock >= $Npage) set automate_Nblock = 0
     55    echo "automate.block $automate_Nblock"
     56
     57    # search the automate book for an entry which is unstarted (state INIT.BLOCK)
     58    book getpage automate $automate_Nblock -var pageName -key pantaskState INIT.BLOCK
     59    if ("$pageName" == "NULL")
     60      echo "entry $automate_Nblock not in INIT.BLOCK state"
     61      break
     62    end
    5963 
    60     book getword automate $pageName check -var checkCommand
    61     if (("$checkCommand" == "NULL") || ("$checkCommand" == "NONE"))
    62       # if there is no check needed, we can immediate progress to READY
    63       book setword automate $pageName pantaskState READY
    64       break
    65     end
    66 
    67     book setword automate $pageName pantaskState CHECK
     64    book getword automate $pageName block -var blockCommand
     65    if (("$blockCommand" == "NULL") || ("$blockCommand" == "NONE"))
     66      # if there is no block needed, we can immediate progress to the next stage (INIT.CHECK)
     67      book setword automate $pageName pantaskState INIT.CHECK
     68      echo "$pageName is ready : INIT.CHECK"
     69      break
     70    end
     71
     72    book setword automate $pageName pantaskState RUN.BLOCK
    6873
    6974    if ($VERBOSE >= 1)
    70       echo "starting automate check for $pageName"
    71       echo "command $checkCommand"
     75      echo "starting automate block for $pageName"
     76      echo "command $blockCommand"
    7277    end
    7378
    7479    options $pageName
    75     command $checkCommand
     80    command $blockCommand
    7681  end
    7782
     
    8085
    8186    $pageName = $options:0
     87
     88    echo "complete $pageName test, checking results"
    8289
    8390    # convert 'stdout' to book format
     
    8895    end
    8996
     97    # if the block test returns any valid pages (valid results), the block is set, don't move to check
    9098    book npages detExp -var Npage
    91     if ($Npage == 0) break
    92 
    93     # we should have launched only a single detRun
    94     book setword automate $pageName pantaskState READY
     99    if ($Npage == 0)
     100      echo "$pageName is not blocked, ready for CHECK"
     101      book setword automate $pageName pantaskState INIT.CHECK
     102    else
     103      echo "$pageName is blocked, not ready for CHECK"
     104      book setword automate $pageName pantaskState INIT.BLOCK
     105    end
    95106
    96107    # drop the detExt book after we've grabbed the state
    97108    book delete detExp
    98109  end
    99 end
    100 
    101 $automate_Nlaunch = 0
    102 
    103 task automate.launch
     110
     111  # all failures here (what state?)
     112  task.exit    default
     113    showcommand failure
     114  end
     115
     116  # operation times out?
     117  task.exit    timeout
     118    showcommand timeout
     119  end
     120end
     121
     122$automate_Ncheck = -1
     123task automate.check
    104124  host         local
    105125
    106126  periods      -poll 1
    107   periods      -exec 10
     127  periods      -exec 5
    108128  periods      -timeout 30
    109129  active       true
     
    111131
    112132  task.exec
    113     local N Npage pageName
     133    local Npage pageName
    114134
    115135    # how many pages are waiting to be started?
    116     book npages automate -var N -key pantaskState READY
    117     if ($N == 0) break
    118 
    119     # total number of pages in book
    120     book npages automate -var Npage
    121 
     136    book npages automate -var Npage -key pantaskState INIT.CHECK
     137    if ($Npage == 0)
     138      echo "no entries in INIT.CHECK state"
     139      break
     140    end
     141
     142    # cycle over the number of INIT.CHECK pages: no point to loop over the others
     143    $automate_Ncheck ++
     144    if ($automate_Ncheck >= $Npage) set automate_Ncheck = 0
     145    echo "automate.check $automate_Ncheck"
     146
     147    # search the automate book for an entry which is unstarted (state INIT.CHECK)
     148    book getpage automate $automate_Ncheck -var pageName -key pantaskState INIT.CHECK
     149    if ("$pageName" == "NULL")
     150      echo "entry $automate_Ncheck not in INIT.CHECK state"
     151      break
     152    end
     153 
     154    book getword automate $pageName check -var checkCommand
     155    if (("$checkCommand" == "NULL") || ("$checkCommand" == "NONE"))
     156      # if there is no check needed, we can immediate progress to the next stage (INIT.LAUNCH)
     157      book setword automate $pageName pantaskState INIT.LAUNCH
     158      echo "$pageName is ready : INIT.LAUNCH"
     159      break
     160    end
     161
     162    book setword automate $pageName pantaskState RUN.CHECK
     163
     164    if ($VERBOSE >= 1)
     165      echo "starting automate check for $pageName"
     166      echo "command $checkCommand"
     167    end
     168
     169    options $pageName
     170    command $checkCommand
     171  end
     172
     173  task.exit $EXIT_SUCCESS
     174    local pageName Npage
     175
     176    $pageName = $options:0
     177
     178    echo "complete $pageName test, checking results"
     179
     180    # convert 'stdout' to book format
     181    # XXX to use other tests, we'll need to modify this
     182    ipptool2book stdout detExp -key det_id -uniq
     183    if ($VERBOSE > 2)
     184      book listbook detExp
     185    end
     186
     187    book npages detExp -var Npage
     188    if ($Npage == 0)
     189      echo "$pageName not ready for LAUNCH"
     190      book setword automate $pageName pantaskState INIT.CHECK
     191    else
     192      echo "$pageName is ready for LAUNCH"
     193      book setword automate $pageName pantaskState INIT.LAUNCH
     194    end
     195
     196    # drop the detExt book after we've grabbed the state
     197    book delete detExp
     198  end
     199
     200  # all failures here (what state?)
     201  task.exit    default
     202    showcommand failure
     203  end
     204
     205  # operation times out?
     206  task.exit    timeout
     207    showcommand timeout
     208  end
     209end
     210
     211$automate_Nlaunch = 0
     212task automate.launch
     213  host         local
     214
     215  periods      -poll 1
     216  periods      -exec 5
     217  periods      -timeout 30
     218  active       true
     219  npending     1
     220
     221  task.exec
     222    local Npage pageName
     223
     224    # how many pages are waiting to be started?
     225    book npages automate -var Npage -key pantaskState INIT.LAUNCH
     226    if ($Npage == 0)
     227      echo "no entries in INIT.LAUNCH state"
     228      break
     229    end
     230
     231    # cycle over the number of INIT.LAUNCH pages: no point to loop over the others
    122232    $automate_Nlaunch ++
    123233    if ($automate_Nlaunch >= $Npage) set automate_Nlaunch = 0
    124 
    125     # search the automate book for an entry which is ready (state READY)
    126     book getpage automate $automate_Nlaunch -var pageName -key pantaskState READY
    127     if ("$pageName" == "NULL") break
     234    echo "automate.launch $automate_Nlaunch"
     235
     236    # search the automate book for an entry which is unstarted (state INIT.LAUNCH)
     237    book getpage automate $automate_Nlaunch -var pageName -key pantaskState INIT.LAUNCH
     238    if ("$pageName" == "NULL")
     239      echo "entry $automate_Nlaunch not in INIT.LAUNCH state"
     240      break
     241    end
    128242 
    129243    book getword automate $pageName launch -var launchCommand
    130244    if (("$launchCommand" == "NULL") || ("$launchCommand" == "NONE"))
    131       # if there is no launch needed, we can immediate progress to READY
    132       book setword automate $pageName pantaskState DONE
    133       break
    134     end
    135 
    136     book setword automate $pageName pantaskState LAUNCH
     245      # if there is no launch needed, we can immediate progress to the next stage (INIT.LAUNCH)
     246      book setword automate $pageName pantaskState INIT.LAUNCH
     247      echo "$pageName is ready : INIT.LAUNCH"
     248      break
     249    end
     250
     251    book setword automate $pageName pantaskState RUN.LAUNCH
    137252
    138253    if ($VERBOSE >= 1)
     
    146261
    147262  task.exit $EXIT_SUCCESS
    148     local pageName
     263    local pageName Npage
    149264
    150265    $pageName = $options:0
    151266
    152     # we should have launched only a single detRun
    153     book setword automate $pageName pantaskState DONE
    154   end
    155 end
     267    echo "completed $pageName launch"
     268    book setword automate $pageName pantaskState DONE.LAUNCH
     269  end
     270
     271  # all failures here (what state?)
     272  task.exit    default
     273    showcommand failure
     274  end
     275
     276  # operation times out?
     277  task.exit    timeout
     278    showcommand timeout
     279  end
     280end
     281
  • trunk/ippTasks/pantasks.pro

    r16369 r16570  
    6666end
    6767
    68 macro init.cluster.po
    69   $PARALLEL = 1
    70   controller exit true
    71 
    72   # po05 -- using for pantasks
    73   # po23 -- broken perl
    74 
    75   controller host add po02
    76   controller host add po03
    77   controller host add po04
    78 # controller host add po05
    79   controller host add po06
    80   controller host add po07
    81 # controller host add po08
    82 # controller host add po09
    83 # controller host add po10
    84 # controller host add po11
    85 # controller host add po12
    86 # controller host add po13
    87 # controller host add po14
    88 # controller host add po15
    89 # controller host add po16
    90 # controller host add po17
    91 # controller host add po18
    92 # controller host add po19
    93 # controller host add po20
    94 # controller host add po21
    95 # controller host add po22
    96 # controller host add po23
    97 # controller host add po24
    98 end
    99 
    100 macro init.cluster.sn
    101   $PARALLEL = 1
    102   controller exit true
    103   controller host add sn2
    104   controller host add sn3
    105   controller host add sn4
    106   controller host add sn5
    107 end
    108 
    10968macro init.isp
    11069  list DB -add isp
     
    11372macro init.essence
    11473  list DB -add essence_v2
    115 end
    116 
    117 macro init.cluster.mhpcc
    118   $PARALLEL = 1
    119   controller exit true
    120   controller host add ipp005
    121   controller host add ipp006
    122   controller host add ipp007
    123   controller host add ipp008
    124   controller host add ipp009
    125   controller host add ipp010
    126   controller host add ipp011
    127   controller host add ipp016
    128   controller host add ipp020
    129   controller host add ipp021
    130 end
    131 
    132 macro init.copy.mhpcc
    133  if ($0 != 2)
    134    echo "USAGE: init.copy.mhpcc (nebulous)"
    135    echo "nebulous may be 'on' or 'off'"
    136    break
    137  end
    138 
    139  if (("$1" != "on") && ("$1" != "off"))
    140    echo "USAGE: init.copy.mhpcc (nebulous)"
    141    echo "nebulous may be 'on' or 'off'"
    142    break
    143  end
    144  
    145  # the templates are used if we have a class_id/host relationship;
    146  # if none is found, the default values are used
    147  # XXX not sure how to handle the .N value if we need to use more than one
    148  # XXX this stuff should all be placed in a 'site' config file
    149 
    150  $COMPRESS = 1
    151 
    152  if ("$1" == "on")
    153   $NEBULOUS = 1
    154   $default_host     = ipp004
    155   $workdir_template = neb://@HOST@.0
    156  else
    157   $NEBULOUS = 0
    158   $default_host     = ipp004
    159   $workdir_template = /data/@HOST@.0
    160  end
    16174end
    16275
     
    467380end
    468381
    469 macro load.chiphost.table
    470   queueload tmp -x "cat $MODULES:0/chiphosts.config"
    471   ipptool2book tmp chiphosts -key camera
    472 end
    473 
    474382macro check.globals
    475383  if ($?NETWORK == 0)
  • trunk/ippTasks/simtest.auto

    r16492 r16570  
    44automate METADATA
    55  name       STR BIAS
     6  block      STR "dettool -runs -det_type BIAS -dbname eamtest"
    67  check      STR NONE
    78  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type BIAS -select_exp_type BIAS -dbname eamtest"
     
    1011automate METADATA
    1112  name       STR DARK
     13  block      STR "dettool -runs -det_type DARK -dbname eamtest"
    1214  check      STR "detselect -search -inst SIMTEST -det_type BIAS -dbname eamtest"
    1315  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type DARK -select_exp_type DARK -dbname eamtest"
    1416END
    15 
     17 
    1618automate METADATA
    1719  name       STR SHUTTER
     20  block      STR "dettool -runs -det_type SHUTTER -dbname eamtest"
    1821  check      STR "detselect -search -inst SIMTEST -det_type DARK -dbname eamtest"
    1922  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type SHUTTER -filter r -select_exp_type FLAT -select_filter r -dbname eamtest"
     
    2225automate METADATA
    2326  name       STR FLAT-r
     27  block      STR "dettool -runs -det_type FLAT -filter r -dbname eamtest"
    2428  check      STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest"
    2529  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter r -select_exp_type FLAT -select_filter r -dbname eamtest"
     
    2832automate METADATA
    2933  name       STR FLAT-i
     34  block      STR "dettool -runs -det_type FLAT -filter i -dbname eamtest"
    3035  check      STR "detselect -search -inst SIMTEST -det_type SHUTTER -dbname eamtest"
    3136  launch     STR "dettool -definebyquery -workdir path://EAMWORK -inst SIMTEST -det_type FLAT -filter i -select_exp_type FLAT -select_filter i -dbname eamtest"
     
    3439automate METADATA
    3540  name       STR OBJECT-r
     41  block      STR "chiptool -block -label object.r -dbname eamtest"
    3642  check      STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter r"
    3743  launch     STR "chiptool -unblock -label object.r -dbname eamtest"
     
    4046automate METADATA
    4147  name       STR OBJECT-i
     48  block      STR "chiptool -block -label object.i -dbname eamtest"
    4249  check      STR "detselect -search -inst SIMTEST -det_type FLAT -dbname eamtest -filter i"
    4350  launch     STR "chiptool -unblock -label object.i -dbname eamtest"
Note: See TracChangeset for help on using the changeset viewer.