當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。