def get_immediately_available_nodes(self, list_of_clusters, walltime, ignore_besteffort=False): planning = get_planning(list_of_clusters, ignore_besteffort=False) slots = compute_slots(planning, walltime) wanted = {cluster: 0 for cluster in list_of_clusters} start_date, end_date, resources = find_first_slot(slots, wanted) actual_resources = { resource: n_nodes for resource, n_nodes in resources.iteritems() if resource in list_of_clusters and n_nodes > 0 } return start_date, end_date, actual_resources
def _get_nodes(self, starttime, endtime): """ """ planning = get_planning(elements=[self.cluster], starttime=starttime, endtime=endtime, out_of_chart=self.options.outofchart) slots = compute_slots(planning, self.options.walltime) startdate = slots[0][0] i_slot = 0 n_nodes = slots[i_slot][2][self.cluster] while n_nodes < self.n_nodes: logger.debug(slots[i_slot]) startdate = slots[i_slot][0] n_nodes = slots[i_slot][2][self.cluster] i_slot += 1 if i_slot == len(slots) - 1: return False, False return startdate, self.n_nodes
def make_reservation(self): """ """ logger.info('Performing reservation') starttime = int(time.time() + timedelta_to_seconds(datetime.timedelta(minutes=1))) planning = get_planning(elements=['grid5000'], starttime=starttime) slots = compute_slots(planning, self.options.walltime) wanted = {"grid5000": 0} start_date, end_date, resources = find_first_slot(slots, wanted) wanted['grid5000'] = min(resources['grid5000'], self.options.n_nodes) actual_resources = distribute_hosts(resources, wanted) job_specs = get_jobs_specs(actual_resources, name='Paasage_Simu') logger.info("try to reserve " + str(actual_resources)) self.oargrid_job_id, _ = oargridsub(job_specs, start_date, walltime=end_date - start_date, job_type="deploy") logger.info("Reservation done")
def make_reservation(self): """ """ logger.info('Performing reservation') starttime = int(time.time() + timedelta_to_seconds(datetime.timedelta(minutes=1))) planning = get_planning(elements=[self.options.selected_cluster], starttime=starttime) slots = compute_slots(planning, self.options.walltime) wanted = {self.options.selected_cluster: 0} start_date, end_date, resources = find_first_slot(slots, wanted) wanted[self.options.selected_cluster] = resources[ self.options.selected_cluster] actual_resources = distribute_hosts(resources, wanted) job_specs = get_jobs_specs(actual_resources, name='Aevol_diff_area') logger.info("try to reserve " + str(actual_resources)) self.oargrid_job_id, _ = oargridsub( job_specs, walltime=end_date - start_date, job_type=['besteffort"' 'allow_classic_ssh']) logger.info("Reservation done")
def get_immediately_available_nodes(self, list_of_clusters, walltime, ignore_besteffort=False): planning = get_planning(list_of_clusters, ignore_besteffort=False) slots = compute_slots(planning, walltime) wanted = {cluster: 0 for cluster in list_of_clusters} start_date, end_date, resources = find_first_slot(slots, wanted) g_nodes = 0 actual_resources = {} for resource, n_nodes in resources.iteritems(): if resource in list_of_clusters and n_nodes > 0: if g_nodes >= 83: break elif g_nodes + n_nodes >= 83: l_nodes = 83 - g_nodes actual_resources = {resource: l_nodes} break else: actual_resources = {resource: n_nodes} g_nodes += n_nodes return start_date, end_date, actual_resources