with open(args.schedule) as f: jobs = [] for line in f: jobid, t, d = line.strip().split() jobs.append([jobid, float(t), float(d)]) preset_est = {} if args.estimations is not None: with open(args.estimations) as f: for line in f: jobid, e = line.strip().split() preset_est[jobid] = float(e) estimations = [] err_func = simulator.lognorm_error(args.sigma) for jobid, _, d in jobs: estimations.append(preset_est.get(jobid, err_func(d))) instances = [ ('FIFO', schedulers.FIFO), ('LIFO', schedulers.LIFO), ('LIFO_SR', schedulers.LIFO_SR), ('PS', schedulers.PS), ('SRPT', schedulers.SRPT), ('SRPTPS', schedulers.SRPT_plus_PS), ('FSP', schedulers.FSP), ('FSP+PS', schedulers.FSP_plus_PS), ('LAS', schedulers.LAS), ('FSP+LAS', schedulers.FSP_plus_LAS), ('SRPTLAS', schedulers.SRPT_plus_LAS),
with open(args.file) as f: jobs = (line.strip().split() for line in f) if args.read_estimations: args.sigma = None old_jobs = jobs jobs, estimations = [], [] for job in old_jobs: jobs.append(job[:-1]) estimations.append(float(job[-1])) if args.nojobid: jobs = ((i, t, size) for i, (t, size) in enumerate(jobs)) jobs = [(jobid, float(t), float(size)) for jobid, t, size in jobs] error = (lambda: simulator.fixed_estimations(estimations) if args.read_estimations else lambda: simulator.lognorm_error(args.sigma)) instances = [ ('FIFO', schedulers.FIFO, simulator.identity, None), ('PS', schedulers.PS, simulator.identity, None), ('SRPT (no error)', schedulers.SRPT, simulator.identity, None), ('FSP (no error)', schedulers.FSP, simulator.identity, None), ('LAS', schedulers.LAS, simulator.identity, None), ('SRPT', schedulers.SRPT, error(), args.iterations), ('SRPT + PS', schedulers.SRPT_plus_PS, error(), args.iterations), ('FSP + FIFO', schedulers.FSP, error(), args.iterations), ('FSP + PS', schedulers.FSP_plus_PS, error(), args.iterations), ('FSP + LAS', schedulers.FSP_plus_LAS, error(), args.iterations), ('SRPT + LAS', schedulers.SRPT_plus_LAS, error(), args.iterations), ]
with open(args.file) as f: jobs = (line.strip().split() for line in f) if args.read_estimations: args.sigma = None old_jobs = jobs jobs, estimations = [], [] for job in old_jobs: jobs.append(job[:-1]) estimations.append(float(job[-1])) if args.nojobid: jobs = ((i, t, size) for i, (t, size) in enumerate(jobs)) jobs = [(jobid, float(t), float(size)) for jobid, t, size in jobs] error = ((lambda: simulator.fixed_estimations(estimations)) if args.read_estimations else lambda: simulator.lognorm_error(args.sigma)) instances = [ ('FIFO', schedulers.FIFO, simulator.identity, None), ('LIFO', schedulers.LIFO, simulator.identity, None), ('LIFO_SR', schedulers.LIFO_SR, simulator.identity, None), ('PS', schedulers.PS, simulator.identity, None), ('SRPT (no error)', schedulers.SRPT, simulator.identity, None), ('FSP (no error)', schedulers.FSP, simulator.identity, None), ('LAS', schedulers.LAS, simulator.identity, None), ('SRPT', schedulers.SRPT, error(), args.iterations), ('SRPT + PS', schedulers.SRPT_plus_PS, error(), args.iterations), ('FSP + FIFO', schedulers.FSP, error(), args.iterations), ('FSP + PS', schedulers.FSP_plus_PS, error(), args.iterations), ('FSP + LAS', schedulers.FSP_plus_LAS, error(), args.iterations), ('SRPT + LAS', schedulers.SRPT_plus_LAS, error(), args.iterations),
with open(args.schedule) as f: jobs = [] for line in f: jobid, t, d = line.strip().split() jobs.append([jobid, float(t), float(d)]) preset_est = {} if args.estimations is not None: with open(args.estimations) as f: for line in f: jobid, e = line.strip().split() preset_est[jobid] = float(e) estimations = [] err_func = simulator.lognorm_error(args.sigma) for jobid, _, d in jobs: estimations.append(preset_est.get(jobid, err_func(d))) instances = [ ('FIFO', schedulers.FIFO), ('LIFO', schedulers.LIFO), ('PS', schedulers.PS), ('SRPT', schedulers.SRPT), ('SRPTPS', schedulers.SRPT_plus_PS), ('FSP', schedulers.FSP), ('FSP+PS', schedulers.FSP_plus_PS), ('LAS', schedulers.LAS), ('FSP+LAS', schedulers.FSP_plus_LAS), ('SRPTLAS', schedulers.SRPT_plus_LAS), ('WFQEGPS', schedulers.WFQE_GPS),
args = parser.parse_args() if args.seed is None: seed = random.randrange(2 ** 32) else: seed = args.seed random.seed(seed) sizes = scipy.stats.pareto(args.shape, args.loc).rvs(args.njobs) times = numpy.cumsum(scipy.stats.weibull_min(args.timeshape).rvs(args.njobs)) times *= sizes.sum() * args.load / times[-1] jobs = [(i, t, s) for i, (t, s) in enumerate(zip(times, sizes))] error = simulator.lognorm_error(args.sigma, args.est_factor) instances = [ ('FIFO', schedulers.FIFO, simulator.identity, None), ('LIFO', schedulers.LIFO, simulator.identity, None), ('LIFO_SR', schedulers.LIFO_SR, simulator.identity, None), ('PS', schedulers.PS, simulator.identity, None), ('SRPT', schedulers.SRPT, simulator.identity, None), ('FSP', schedulers.FSP, simulator.identity, None), ('LAS', schedulers.LAS, simulator.identity, None), ('SRPTE', schedulers.SRPT, error, args.iterations), # ('SRPTE+PS', schedulers.SRPT_plus_PS, error, args.iterations), # ('SRPTE+LAS', schedulers.SRPT_plus_LAS, error, args.iterations), ('FSPE', schedulers.FSP, error, args.iterations), ('FSPE+PS', schedulers.FSP_plus_PS, error, args.iterations), # ('FSPE+LAS', schedulers.FSP_plus_LAS, error, args.iterations),
args = parser.parse_args() if args.seed is None: seed = random.randrange(2**32) else: seed = args.seed random.seed(seed) sizes = scipy.stats.pareto(args.shape, args.loc).rvs(args.njobs) times = numpy.cumsum(scipy.stats.weibull_min(args.timeshape).rvs(args.njobs)) times *= sizes.sum() * args.load / times[-1] jobs = [(i, t, s) for i, (t, s) in enumerate(zip(times, sizes))] error = simulator.lognorm_error(args.sigma, args.est_factor) instances = [ ('FIFO', schedulers.FIFO, simulator.identity, None), ('LIFO', schedulers.LIFO, simulator.identity, None), ('LIFO_SR', schedulers.LIFO_SR, simulator.identity, None), ('PS', schedulers.PS, simulator.identity, None), ('SRPT', schedulers.SRPT, simulator.identity, None), ('FSP', schedulers.FSP, simulator.identity, None), ('LAS', schedulers.LAS, simulator.identity, None), ('SRPTE', schedulers.SRPT, error, args.iterations), # ('SRPTE+PS', schedulers.SRPT_plus_PS, error, args.iterations), # ('SRPTE+LAS', schedulers.SRPT_plus_LAS, error, args.iterations), ('FSPE', schedulers.FSP, error, args.iterations), ('FSPE+PS', schedulers.FSP_plus_PS, error, args.iterations), # ('FSPE+LAS', schedulers.FSP_plus_LAS, error, args.iterations),