From 1e7eade9baeb53fc629cc2db98367897d0fd7b13 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Fri, 17 Jan 2014 00:23:13 -0500 Subject: Use same taskset for L1-ALL partitionings. We want to compare the partitioning heuristics amongst themselves, as well as different clustering options. Use the same task set to span these combinations in order to make direct comparisons easier to make. --- gen/edf_generators.py | 18 +++++------ gen/generator.py | 87 +++++++++++++++++++++++++++++---------------------- 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/gen/edf_generators.py b/gen/edf_generators.py index 27bc4e6..7a30b4f 100644 --- a/gen/edf_generators.py +++ b/gen/edf_generators.py @@ -108,9 +108,9 @@ class EdfPgmGenerator(gen.Generator): gen.Generator._dist_option('polluters', False, {}, 'Polluters.'), - gen.Generator._dist_option('release_master', False, - {}, - 'Release master.'), +# gen.Generator._dist_option('release_master', False, +# {}, +# 'Release master.'), gen.Generator._dist_option('job_splitting', True, {}, 'Job splitting.'), @@ -120,9 +120,9 @@ class EdfPgmGenerator(gen.Generator): gen.Generator._dist_option('heur_aggressiveness', 0.75, {}, 'heur_aggressiveness.'), - gen.Generator._dist_option('sys_util', [20.0, 9.0, 8.0, 7.0], + gen.Generator._dist_option('sys_util', [20.0, 16.0, 12.0, 9.0], {}, - 'System utilization.')] + 'Task set utilization.')] def _create_exp(self, dp, ts, graphs, subts): '''Create a single experiment with @exp_params in @out_dir.''' @@ -131,7 +131,7 @@ class EdfPgmGenerator(gen.Generator): if ret: self._write_pgm_schedule(dict(dp.items() + [('task_set', ts)] + [('graphs', graphs)] + [('sub_task_set', subts)])) - self._write_params(dict(dp.items() + [('num_tasks', len(ts))])) + self._write_params(dict(dp.items() + [('num_tasks', len(ts)), ('num_graphs', len(graphs))])) return ret @@ -223,13 +223,13 @@ class GedfGenerator(EdfGenerator): class CflSplitPgmGenerator(EdfPgmGenerator): TP_CLUSTER = "plugins/C-FL-split/cluster{$level}" - CLUSTER_OPTION = gen.GenOption('level', ['L1', 'L2', 'L3', 'ALL'], 'L2', - 'Cache clustering level.',) +# CLUSTER_OPTION = gen.GenOption('level', ['L1', 'L2', 'L3', 'ALL'], 'L2', +# 'Cache clustering level.',) def __init__(self, params={}): super(CflSplitPgmGenerator, self).__init__("C-FL-split", [CflSplitPgmGenerator.TP_CLUSTER], - [CflSplitPgmGenerator.CLUSTER_OPTION], + [], params) def _customize(self, ts, graphs, subts, dp): diff --git a/gen/generator.py b/gen/generator.py index 2c84aa3..7b91a93 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -1,5 +1,6 @@ import gen.rv as rv import os +import copy import pprint import schedcat.generator.tasks as tasks import shutil as sh @@ -364,8 +365,9 @@ class Generator(object): partition_method = exp['partitions'] del exp['partitions'] - for dp in PgmDesignPointGenerator(exp): + for _dp in PgmDesignPointGenerator(exp): for trial in xrange(trials): + dp = copy.deepcopy(_dp) dp.num_graphs = NAMED_NUM_GRAPHS[dp.num_graphs] dp.depth_factor = NAMED_HEIGHT_FACTORS[dp.depth_factor] dp.node_placement = NAMED_SHAPES[dp.node_placement] @@ -386,44 +388,53 @@ class Generator(object): ts, graphs, subts = self._create_tasks(dp) dp.tasks = len(ts) + levels = ['L1', 'L2', 'L3', 'ALL'] try: - for pm in partition_method: - dp.partitions = pm - # Create directory name from relevant parameters - dir_leaf = "sched=%s_%s" % (self.scheduler, col_map.encode(dp)) - dir_leaf = dir_leaf.strip('_') # If there are none - dir_leaf += ("_trial=%s" % trial) if trials > 1 else "" - - dir_path = "%s/%s" % (out_dir, dir_leaf.strip('_')) - - if os.path.exists(dir_path): - if force: - sh.rmtree(dir_path) - else: - print("Skipping existing experiment: '%s'" % dir_path) - continue - - os.mkdir(dir_path) - created_dirs.append(dir_path) - - if trials > 1: - dp[PARAMS['trial']] = trial - self.out_dir = dir_path - - dp.system = topology.Topology(machines[dp.host]) - - # Write a sched.py and param.py for each partition method - ret = self._create_exp(dp, ts, graphs, subts) - if not ret: - print("Bin-packing fails for " + dir_leaf) - last_failed = dir_leaf - raise Exception("Failed to partition.") - del(self.out_dir) - if PARAMS['trial'] in dp: - del dp[PARAMS['trial']] - # just generate one experiment for global - if dp['level'] == 'ALL': - break + for lvl in levels: + dp['level'] = lvl + _dp['level'] = lvl + for pm in partition_method: + dp.partitions = pm + # Create directory name from relevant parameters + dir_leaf = "sched=%s_cluster=%s_%s" % (self.scheduler, lvl, col_map.encode(dp)) + dir_leaf = dir_leaf.strip('_') # If there are none + dir_leaf += ("_trial=%s" % trial) if trials > 1 else "" + + dir_path = "%s/%s" % (out_dir, dir_leaf.strip('_')) + + print("Generating for %s" % dir_path) + + if os.path.exists(dir_path): + if force: + sh.rmtree(dir_path) + else: + print("Skipping existing experiment: '%s'" % dir_path) + continue + + os.mkdir(dir_path) + created_dirs.append(dir_path) + + if trials > 1: + dp[PARAMS['trial']] = trial + _dp[PARAMS['trial']] = trial + self.out_dir = dir_path + + _dp.system = topology.Topology(machines[dp.host]) + _dp.partitions = pm + + # Write a sched.py and param.py for each partition method + ret = self._create_exp(_dp, ts, graphs, subts) + if not ret: + print("Bin-packing fails for " + dir_leaf) + last_failed = dir_leaf + raise Exception("Failed to partition.") + del(self.out_dir) + if PARAMS['trial'] in dp: + del dp[PARAMS['trial']] + del _dp[PARAMS['trial']] + # just generate one experiment for global + if dp['level'] == 'ALL': + break success = True except Exception, e: for d in created_dirs: -- cgit v1.2.2