Example #1
0
  def runAll(self):
    # create schedule and run it
    input = self.workload['input']
    schedulesummary = self.workload['schedulesummary']
    schedule = self.workload['schedule']
    executions = self.workload['executions']
    self.log.info("")
    self.log.info("##############################################")
    self.log.info("# Running " + input)
    self.log.info("##############################################")
    self.log.info("")
    proc = Processor()
    w = Utils.loadYaml(input)
    pm = ProcessorMonitor(w)
    proc.addMonitor(pm)
    sc = Scheduler(w, proc)
    sc.run()
    Utils.dumpSchedule(sc.getSchedule(), schedulesummary)
    Utils.dumpYaml(sc.getSchedule(), schedule)
    Utils.dumpYaml(pm.getResults(), executions)

    # plot the schedule
    p = Plot(sc.getSchedule(), pm.getResults(), sc.getH(), sc.getI(), self.wid)
    p.create()
    
    # verify the schedule
    v = Verifier(Utils.loadYaml(executions), sc.getH(), input)
    v.verifySchedule()
    
    return p.getFigure()
Example #2
0
 def testScheduler(self):
   print "testScheduler():"
   self.pm = ProcessorMonitor(self.y1)
   self.proc.addMonitor(self.pm)
   s = Scheduler(self.y1, self.proc)
   s.run()
   Utils.dumpSchedule(s.getSchedule(), self.s1)
   Utils.dumpYaml(self.pm.getResults(), self.e1)
   print
Example #3
0
def runTasks():

  log = logging.getLogger("main")
  
  # setup
  workloads = { 'workload1': { 'input':'input/workload1.yaml', 'schedulesummary':'output/schedule1.txt', 
                'schedule':'output/schedule1.yaml', 'executions':'output/executions1.yaml' },
                'workload2': { 'input':'input/workload2.yaml', 'schedulesummary':'output/schedule2.txt', 
                'schedule':'output/schedule2.yaml', 'executions':'output/executions2.yaml' } }

  for id,workload in workloads.iteritems():
    # create schedule and run it
    input = workload['input']
    schedulesummary = workload['schedulesummary']
    schedule = workload['schedule']
    executions = workload['executions']
    log.info("")
    log.info("##############################################")
    log.info("# Running " + input)
    log.info("##############################################")
    log.info("")
    proc = Processor()
    w = Utils.loadYaml(input)
    pm = ProcessorMonitor(w)
    proc.addMonitor(pm)
    sc = Scheduler(w, proc)
    sc.run()
    Utils.dumpSchedule(sc.getSchedule(), schedulesummary)
    Utils.dumpYaml(sc.getSchedule(), schedule)
    Utils.dumpYaml(pm.getResults(), executions)

    # plot the schedule
    p = Plot(sc.getSchedule(), pm.getResults(), sc.getH(), sc.getI(), id)
    p.create()
    
    # verify the schedule
    v = Verifier(Utils.loadYaml(executions), sc.getH(), input)
    v.verifySchedule()
    
  # show the plot
  p.show()