def __init__(self): NodeScheduler.__init__(self) self.is_profiling = False self.static_max_tasks_to_run = min(int(self.capacity['cores'] / config.SLOT_SIZE['cpu']), \ int(self.capacity['memory'] / config.SLOT_SIZE['memory'])) self.logger.info("Initializing thread pool with %s workers" % self.static_max_tasks_to_run) self.logger.info("Scheduler policy is %s" % config.POLICY) # we make a random hash for our queue self.random_hash = hashlib.sha1(b'/tmp/Weasel/bin/local_resourcemanager').hexdigest()
def __init__(self): NodeScheduler.__init__(self) self.is_profiling = False self.static_max_tasks_to_run = min(int(self.capacity['cores'] / config.SLOT_SIZE['cpu']), \ int(self.capacity['memory'] / config.SLOT_SIZE['memory'])) self.logger.info("Initializing thread pool with %s workers" % self.static_max_tasks_to_run) self.logger.info("Scheduler policy is %s" % config.POLICY) # we make a random hash for our queue self.random_hash = hashlib.sha1( b'/tmp/Weasel/bin/local_resourcemanager').hexdigest()
def __init__(self): NodeScheduler.__init__(self) self.is_profiling = True #self.tqueue.start() self.last_action = 0 self.resource_delta_history = [] ''' variables used by the improved policy ''' self.past_value_w = 0.3 self.past_history_max_len = 10 self.profiling = False self.c = config.TASK_UTIL_RATIO self.current_task = "" self.restart = False self.adapt_queues = [] self.adapt_queues_lock = threading.Lock() self.state = ProfilingStates.state['running'] self.profiled_queues = [] self.pending_queues = []