当前位置: 首页>>代码示例>>Python>>正文


Python base.Component类代码示例

本文整理汇总了Python中Cobalt.Components.base.Component的典型用法代码示例。如果您正苦于以下问题:Python Component类的具体用法?Python Component怎么用?Python Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Component类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __setstate__

    def __setstate__(self, state):
        Component.__setstate__(self, state)

        self.reservations = state['reservations']
        if 'active' in state:
            self.active = state['active']
        else:
            self.active = True
        
        self.id_gen = IncrID()
        self.id_gen.set(state['next_res_id'])
        global bgsched_id_gen
        bgsched_id_gen = self.id_gen
        
        self.cycle_id_gen = IncrID()
        self.cycle_id_gen.set(state['next_cycle_id'])
        global bgsched_cycle_id_gen
        bgsched_cycle_id_gen = self.cycle_id_gen

        self.queues = QueueDict()
        self.jobs = JobDict()
        self.started_jobs = {}
        self.sync_state = Cobalt.Util.FailureMode("Foreign Data Sync")
        
        self.get_current_time = time.time

        if state.has_key('msg_queue'):
            dbwriter.msg_queue = state['msg_queue']
        if state.has_key('overflow') and (dbwriter.max_queued != None):
            dbwriter.overflow = state['overflow']
开发者ID:ido,项目名称:cobalt-svn-old,代码行数:30,代码来源:bgsched.py

示例2: __init__

 def __init__ (self, *args, **kwargs):
     """Initialize a new ServiceLocator.
     
     All arguments are passed to the component constructor.
     """
     Component.__init__(self, *args, **kwargs)
     self.services = ServiceDict()
开发者ID:wtangiit,项目名称:Qsim,代码行数:7,代码来源:slp.py

示例3: __init__

 def __init__(self, *args, **kwargs):
     Component.__init__(self, *args, **kwargs)
     self.resources = ResourceDict()
     self.process_groups = ProcessGroupDict()
     self.process_groups.item_cls = BBProcessGroup
     self.queue_assignments = {}
     self.queue_assignments["default"] = sets.Set(self.resources)
开发者ID:zzhou,项目名称:Qsim_PowerAware,代码行数:7,代码来源:bb.py

示例4: __init__

 def __init__(self, *args, **kwargs):
     Component.__init__(self, *args, **kwargs)
     self.event_manager = ComponentProxy("event-manager")
     self.bqsim = ComponentProxy("queue-manager")
     self.powmon_logger = None
     self.total_cost = 0.0
     self.time_power_list =[{"unixtime":0, "power":0, "count":0, "utilization":0}]
开发者ID:zzhou,项目名称:Qsim_PowerAware,代码行数:7,代码来源:pwmonitor.py

示例5: __setstate__

   def __setstate__(self, state):
      Component.__setstate__(self, state)

      self.msg_queue = state['msg_queue']
      self.connected = False
      self.decoder = LogMessageDecoder()
      self.clearing_overflow = False
      self.overflow_filename = None
      self.overflow_file = None
      self.max_queued = int(get_cdbwriter_config('max_queued_msgs', '-1'))
                        
      if self.max_queued <= 0:
         logger.info("message queue set to unlimited.")
         self.max_queued = None
      else:
         self.overflow_filename = get_cdbwriter_config('overflow_file', None)

      if self.max_queued and (self.overflow_filename == None):
         logger.warning("No file given to catch maximum messages. Setting queue size to unlimited.")
         self.max_queued = None

      if state.has_key('overflow') and self.max_queued:
         self.overflow = state['overflow']
      else:
         self.overflow = False
开发者ID:ido,项目名称:cobalt-svn-old,代码行数:25,代码来源:cdbwriter.py

示例6: __init__

    def __init__ (self, *args, **kwargs):
        Component.__init__(self, *args, **kwargs)
        self.process_groups = ProcessGroupDict()
        self.all_nodes = set()
        self.running_nodes = set()
        self.down_nodes = set()
        self.queue_assignments = {}
        self.node_order = {}
    
        try:
            self.configure(cluster_hostfile)
        except:
            self.logger.error("unable to load hostfile")
        
        self.queue_assignments["default"] = set(self.all_nodes)
        self.alloc_only_nodes = {} # nodename:starttime
        self.cleaning_processes = []
        #keep track of which jobs still have hosts being cleaned
        self.cleaning_host_count = {} # jobid:count
        self.locations_by_jobid = {} #jobid:[locations]
        self.jobid_to_user = {} #jobid:username
        
        self.alloc_timeout = int(get_cluster_system_config("allocation_timeout", 300))

        self.logger.info("allocation timeout set to %d seconds." % self.alloc_timeout)
开发者ID:ido,项目名称:cobalt-svn-old,代码行数:25,代码来源:cluster_base_system.py

示例7: __init__

 def __init__ (self, *args, **kwargs):
     """Initialize a new BaseForker.
     
     All arguments are passed to the component constructor.
     """
     Component.__init__(self, *args, **kwargs)
     self.children = {}
     self.id_gen = IncrID()
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:8,代码来源:heckle_forker.py

示例8: __init__

 def __init__ (self, *args, **kwargs):
     """Initialize a new ServiceLocator.
     
     All arguments are passed to the component constructor.
     """
     Component.__init__(self, *args, **kwargs)
     self.ignore = []
     self.lastwait = 0
     self.pgroups = ProcessGroupDict()
     self.zombie_mpi = {}
开发者ID:zzhou,项目名称:Qsim_PowerAware,代码行数:10,代码来源:scriptm.py

示例9: __init__

    def __init__(self, *args, **kwargs):

        Component.__init__(self, *args, **kwargs)
        self.event_list = [{"unixtime": 0}]
        self.time_stamp = 0

        self.finished = False

        self.bgsched = Sim_bg_Sched(**kwargs)
        self.csched = Sim_Cluster_Sched()
        self.go_next = True
开发者ID:zzhou1985,项目名称:Qsim,代码行数:11,代码来源:evsim.py

示例10: __init__

 def __init__(self, *args, **kwargs):
     Component.__init__(self, *args, **kwargs)
     self.COMP_QUEUE_MANAGER = "queue-manager"
     self.COMP_SYSTEM = "system"
     self.reservations = ReservationDict()
     self.queues = QueueDict(self.COMP_QUEUE_MANAGER)
     self.jobs = JobDict(self.COMP_QUEUE_MANAGER)
     self.started_jobs = {}
     self.sync_state = Cobalt.Util.FailureMode("Foreign Data Sync")
     self.active = True
     self.get_current_time = time.time
开发者ID:zzhou,项目名称:Qsim_Topology,代码行数:11,代码来源:bgsched.py

示例11: __init__

 def __init__(self, *args, **kwargs):
     logger.debug(
         "heckle: System: init ... %s ... &&&&&&&&&&&&&&&&&&&&&&&&&&&&&  I am here as well &&&&&&&&&&&&&&&&&&&&&&&&&"
         % threading.current_thread().getName()
     )
     Component.__init__(self, *args, **kwargs)
     self.process_groups = ProcessGroupDict()
     self.process_groups.item_cls = HeckleProcessGroup
     self.resources = ResourceDict()
     self.queue_assignments["default"] = self.resources.keys()
     print "\n\n\n\n"
     print "Queue assignments are: %s" % self.queue_assignments
开发者ID:zzhou1985,项目名称:Qsim,代码行数:12,代码来源:heckle_system2.py

示例12: __init__

 def __init__ (self, *args, **kwargs):
     Component.__init__(self, *args, **kwargs)
     self._partitions = PartitionDict()
     self._managed_partitions = set()
     self.process_groups = BGProcessGroupDict()
     self.node_card_cache = dict()
     self._partitions_lock = thread.allocate_lock()
     self.pending_diags = dict()
     self.failed_diags = list()
     self.bridge_in_error = False
     self.cached_partitions = None
     self.offline_partitions = []
开发者ID:wtangiit,项目名称:Qsim,代码行数:12,代码来源:bg_base_system.py

示例13: __init__

 def __init__(self, *args, **kwargs):
     
     Component.__init__(self, *args, **kwargs)
     self.event_list = [{'unixtime':0}]
     self.time_stamp = 0
     
     self.finished = False
             
     self.bgsched = Sim_bg_Sched(**kwargs)
     
     #inhibit coscheduling and cluster simulation feature before bgsched.py makes change
     #self.csched = Sim_Cluster_Sched()
     
     self.go_next = True
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:14,代码来源:evsim.py

示例14: __init__

 def __init__ (self, *args, **kwargs):
     Component.__init__(self, *args, **kwargs)
     self.process_groups = ProcessGroupDict()
     self.pending_diags = dict()
     self.failed_diags = list()
     self.all_nodes = sets.Set()
     self.running_nodes = sets.Set()
     self.down_nodes = sets.Set()
     self.queue_assignments = {}
     self.node_order = {}
     try:
         self.configure(CP.get("cluster_system", "hostfile"))
     except:
         self.logger.error("unable to load hostfile")
     self.queue_assignments["default"] = sets.Set(self.all_nodes)
开发者ID:zzhou,项目名称:Qsim_PowerAware,代码行数:15,代码来源:cluster_base_system.py

示例15: __init__

 def __init__(self, *args, **kwargs):
     
     Component.__init__(self, *args, **kwargs)
     self.event_list = [{'unixtime':0}]
     self.time_stamp = 0
     
     self.finished = False
             
     self.bgsched = Sim_bg_Sched(**kwargs)
     self.csched = Sim_Cluster_Sched()
     self.powermonitor = PowerMonitor()
     self.go_next = True
     
     # last scheduling time
     self.last_schedule_time = 0
开发者ID:zzhou,项目名称:Qsim_PowerAware,代码行数:15,代码来源:evsim.py


注:本文中的Cobalt.Components.base.Component类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。