Пример #1
0
 def start(self):
     # Load schedule with the schedule builder
     loaded = schedule_builder.load_schedule(conf_schedule.SCHEDULE_ID)
     
     # Create queue based on schedule
     abs_time = self.pump.sim_time()
     for sentry in loaded.entries:
         # Skip static entries with predefined domain name
         if sentry.domain_name is not None:
             print 'skipping schedule entry: %s' % sentry.domain_name
             continue
         
         # Start tame based on current simulation time
         start = abs_time + sentry.offset 
         
         # End time based on start time, ramp-up and ramp-down
         end = start + sentry.duration + sentry.rampUp + sentry.rampDown
         
         ientry = Entry(start, end, sentry.workload_profile_index, sentry.domain_size)
         self.queue.append(ientry)
     
     # Sort queue
     self.queue.sort(key=lambda q: q.schedule_for)
     
     
     self.launch = 0
     # Schedule message pump if entries exist
     if self.queue:
         self.pump.callLater(self.queue[0].schedule_for - abs_time, self.run)
Пример #2
0
def run():
    # Load domain schedule
    print 'Loading schedule...'
    schedule = schedule_builder.load_schedule(conf_schedule.SCHEDULE_ID)
    
    # Get CPU demand trace for each VM
    for entry in schedule.entries:
        index = entry.workload_profile_index
        freq, ts = load.get_cpu_trace(index, entry.domain_size)
        
        # Attach load to schedule entry
        entry.freq = freq
        entry.ts = ts

    # Solve domain schedule
    print 'solving...'        
    result = solve(conf_nodes.NODE_CPU_CORES, conf_nodes.NODE_MEM, schedule)
    
    if result:
        # Print results
        print 'Schedule length: %i' % (len(schedule.entries))
        return result
    else:
        print 'Infeasible model for SCHEDULE_ID: %i' % conf_schedule.SCHEDULE_ID
        return None
Пример #3
0
 def fill_static_params(self, run, treatment_params_map):
     # Determine schedule domain size set and set it
     schedule = treatment_params_map['SCHEDULE_ID']
     from schedule import schedule_builder
     schedule = schedule_builder.load_schedule(schedule)
     return ['-DOMAIN_SIZES_SET', str(schedule.get_domain_size_set())]