/[pdpsoft]/nl.nikhef.ndpf.mcfloat/trunk/mcfloat
ViewVC logotype

Diff of /nl.nikhef.ndpf.mcfloat/trunk/mcfloat

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2866 by templon, Wed Feb 3 10:35:20 2016 UTC revision 2867 by templon, Sat Feb 20 15:24:25 2016 UTC
# Line 181  def add_to_mc_pool(node): Line 181  def add_to_mc_pool(node):
181    
182  import optparse  import optparse
183    
184  usage = "usage: %prog [-d debug_level] [-n]"  usage = "usage: %prog [options]"
185    
186  p = optparse.OptionParser(description="Monitor state of multicore pool and adjust size as needed",  p = optparse.OptionParser(description="Monitor state of multicore pool and adjust size as needed",
187                            usage=usage)                            usage=usage)
# Line 192  p.add_option("-A",action="store_true",de Line 192  p.add_option("-A",action="store_true",de
192  p.add_option("-D",action="store_true",dest="delall",default=False,  p.add_option("-D",action="store_true",dest="delall",default=False,
193               help="delete all nodes from multicore pool")               help="delete all nodes from multicore pool")
194    
195  p.add_option("-m",action="store",dest="new_max_free",default=None,  p.add_option("-R",action="store_true",dest="remove_strays_from_pool",default=False,
196               help="maximum number of unused slots to tolerate in the multicore pool")               help="remove mc pool nodes that are not one of the configured candidate nodes")
197    
198  p.add_option("-l",action="store",dest="logfile",default=None,  p.add_option("-l",action="store",dest="logfile",default=None,
199               help="log actions and information to LOGFILE (default stdout)")               help="log actions and information to LOGFILE (default stdout)")
# Line 207  p.add_option("-n",action="store_true",de Line 207  p.add_option("-n",action="store_true",de
207  p.add_option("-i",action="store_true",dest="info",default=False,  p.add_option("-i",action="store_true",dest="info",default=False,
208               help="print info on all nodes in multicore pool")               help="print info on all nodes in multicore pool")
209    
210    p.add_option("-d",action="store",dest="new_max_drain",default=None,
211                 help="maximum number of nodes allowed in draining state")
212    
213    p.add_option("-m",action="store",dest="new_max_free",default=None,
214                 help="maximum number of unused slots to tolerate in the multicore pool")
215    
216  p.add_option("-f",action="store",dest="newfrac",default=None,  p.add_option("-f",action="store",dest="newfrac",default=None,
217               help="fraction (out of 1.0) of in-service nodes to commit to multicore pool")               help="fraction (out of 1.0) of in-service nodes to commit to multicore pool")
218    
219  p.add_option("-r",action="store_true",dest="reset_config",default=False,  p.add_option("-r",action="store_true",dest="reset_config",default=False,
220               help="reset mcfloat config to the default")               help="reset mcfloat config to the default")
221    
 p.add_option("-R",action="store_true",dest="remove_strays_from_pool",default=False,  
              help="remove mc pool nodes that are not one of the configured candidate nodes")  
   
222  p.add_option("-q",action="store_true",dest="querycfg",default=False,  p.add_option("-q",action="store_true",dest="querycfg",default=False,
223               help="print current config and exit")               help="print current config and exit")
224    
# Line 257  if opts.newfrac: Line 260  if opts.newfrac:
260      cfg.capacityfrac = float(opts.newfrac)      cfg.capacityfrac = float(opts.newfrac)
261      if cfg.capacityfrac < 0 or cfg.capacityfrac > 1:      if cfg.capacityfrac < 0 or cfg.capacityfrac > 1:
262          raise ValueError('Invalid capacity fraction: %s' % opts.newfrac)          raise ValueError('Invalid capacity fraction: %s' % opts.newfrac)
263      logging.info("Raising capacity fraction to %s" % opts.newfrac)      logging.info("Changing capacity fraction to %s" % opts.newfrac)
264      config_changed = True      config_changed = True
265    
266  if opts.new_max_free:  if opts.new_max_free:
267      cfg.maxfree = int(opts.new_max_free)      cfg.maxfree = int(opts.new_max_free)
268      if cfg.maxfree < 0:      if cfg.maxfree < 0:
269          raise ValueError('Invalid max free slots: %s' % opts.new_max_free)          raise ValueError('Invalid max free slots: %s' % opts.new_max_free)
270      logging.info("Raising max free slots to %s" % opts.new_max_free)      logging.info("Changing max free slots to %s" % opts.new_max_free)
271        config_changed = True
272    
273    if opts.new_max_drain:
274        cfg.maxdrain = int(opts.new_max_drain)
275        if cfg.maxdrain < 0:
276            raise ValueError('Invalid max num draining nodes: %s' % opts.new_max_drain)
277        logging.info("Changing max number draining nodes to %s" % opts.new_max_drain)
278      config_changed = True      config_changed = True
279    
280  if opts.reset_config:  if opts.reset_config:

Legend:
Removed from v.2866  
changed lines
  Added in v.2867

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28