diff options
| author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-22 15:51:48 -0500 |
|---|---|---|
| committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-01-22 15:51:48 -0500 |
| commit | d4b955262433d927e966e49d59179808e5d5239f (patch) | |
| tree | 641919ba6c352570592e504dcc1b111b8b2c6f5a | |
| parent | 160c52110d14300bf317eca5fe64379766ac47cd (diff) | |
(1)fix merge conflict. (2)fix schedcat integr. bug
| -rw-r--r-- | gen/edf_generators.py | 9 | ||||
| -rw-r--r-- | gen/generator.py | 58 |
2 files changed, 13 insertions, 54 deletions
diff --git a/gen/edf_generators.py b/gen/edf_generators.py index e8507f6..bd32f47 100644 --- a/gen/edf_generators.py +++ b/gen/edf_generators.py | |||
| @@ -111,10 +111,10 @@ class EdfPgmGenerator(gen.Generator): | |||
| 111 | gen.Generator._dist_option('task_util', ['uni-medium'], | 111 | gen.Generator._dist_option('task_util', ['uni-medium'], |
| 112 | NAMED_UTILIZATIONS, | 112 | NAMED_UTILIZATIONS, |
| 113 | 'Task utilization.'), | 113 | 'Task utilization.'), |
| 114 | gen.Generator._dist_option('polluters', [False, True], | 114 | gen.Generator._dist_option('polluters', [False], |
| 115 | {}, | 115 | {}, |
| 116 | 'Polluters.'), | 116 | 'Polluters.'), |
| 117 | gen.Generator._dist_option('job_splitting', True, | 117 | gen.Generator._dist_option('job_splitting', [True], |
| 118 | {}, | 118 | {}, |
| 119 | 'Job splitting.'), | 119 | 'Job splitting.'), |
| 120 | gen.Generator._dist_option('ovh_type', 'max', | 120 | gen.Generator._dist_option('ovh_type', 'max', |
| @@ -258,6 +258,11 @@ class CflSplitPgmGenerator(EdfPgmGenerator): | |||
| 258 | overheads = get_overheads(dp, dp.system) | 258 | overheads = get_overheads(dp, dp.system) |
| 259 | # do the partition here | 259 | # do the partition here |
| 260 | ts = partition.clear_partitioning(ts) | 260 | ts = partition.clear_partitioning(ts) |
| 261 | |||
| 262 | if overheads.consumer is not None: | ||
| 263 | for t in ts: | ||
| 264 | overheads.consumer.place_production(t) | ||
| 265 | |||
| 261 | try: | 266 | try: |
| 262 | ts = PARTITION_METHOD[exp_params['partitions']](ts, graphs, subts, cluster_sz, dp.nr_clusters, dp.system, dp.heur_aggressiveness, overheads) | 267 | ts = PARTITION_METHOD[exp_params['partitions']](ts, graphs, subts, cluster_sz, dp.nr_clusters, dp.system, dp.heur_aggressiveness, overheads) |
| 263 | except DidNotFit: | 268 | except DidNotFit: |
diff --git a/gen/generator.py b/gen/generator.py index 409cd43..47b2a7c 100644 --- a/gen/generator.py +++ b/gen/generator.py | |||
| @@ -427,57 +427,6 @@ class Generator(object): | |||
| 427 | dp.tasks = len(ts) | 427 | dp.tasks = len(ts) |
| 428 | 428 | ||
| 429 | try: | 429 | try: |
| 430 | <<<<<<< HEAD | ||
| 431 | for lvl in levels: | ||
| 432 | dp['level'] = lvl | ||
| 433 | _dp['level'] = lvl | ||
| 434 | for pm in partition_method: | ||
| 435 | dp.partitions = pm | ||
| 436 | # Create directory name from relevant parameters | ||
| 437 | temp = dp.wss | ||
| 438 | dp.wss = _dp.wss | ||
| 439 | dir_leaf = "sched=%s_cluster=%s_%s" % (self.scheduler, lvl, col_map.encode(dp)) | ||
| 440 | dir_leaf = dir_leaf.strip('_') # If there are none | ||
| 441 | dir_leaf += ("_trial=%s" % trial) if trials > 1 else "" | ||
| 442 | |||
| 443 | dir_path = "%s/%s" % (out_dir, dir_leaf.strip('_')) | ||
| 444 | |||
| 445 | print("Generating for %s" % dir_path) | ||
| 446 | |||
| 447 | dp.wss = temp | ||
| 448 | |||
| 449 | if os.path.exists(dir_path): | ||
| 450 | if force: | ||
| 451 | sh.rmtree(dir_path) | ||
| 452 | else: | ||
| 453 | print("Skipping existing experiment: '%s'" % dir_path) | ||
| 454 | continue | ||
| 455 | |||
| 456 | os.mkdir(dir_path) | ||
| 457 | created_dirs.append(dir_path) | ||
| 458 | |||
| 459 | if trials > 1: | ||
| 460 | dp[PARAMS['trial']] = trial | ||
| 461 | _dp[PARAMS['trial']] = trial | ||
| 462 | self.out_dir = dir_path | ||
| 463 | |||
| 464 | _dp.system = topology.Topology(machines[dp.host]) | ||
| 465 | _dp.partitions = pm | ||
| 466 | |||
| 467 | # Write a sched.py and param.py for each partition method | ||
| 468 | ret = self._create_exp(_dp, ts, graphs, subts) | ||
| 469 | if not ret: | ||
| 470 | print("Bin-packing fails for " + dir_leaf) | ||
| 471 | last_failed = dir_leaf | ||
| 472 | raise Exception("Failed to partition.") | ||
| 473 | del(self.out_dir) | ||
| 474 | if PARAMS['trial'] in dp: | ||
| 475 | del dp[PARAMS['trial']] | ||
| 476 | del _dp[PARAMS['trial']] | ||
| 477 | # just generate one experiment for global | ||
| 478 | if dp['level'] == 'ALL': | ||
| 479 | break | ||
| 480 | ======= | ||
| 481 | for shp in shared_params: | 430 | for shp in shared_params: |
| 482 | dp['level'] = shp.clustering | 431 | dp['level'] = shp.clustering |
| 483 | _dp['level'] = shp.clustering | 432 | _dp['level'] = shp.clustering |
| @@ -489,6 +438,9 @@ class Generator(object): | |||
| 489 | dp.job_splitting = shp.splitting | 438 | dp.job_splitting = shp.splitting |
| 490 | 439 | ||
| 491 | # Create directory name from relevant parameters | 440 | # Create directory name from relevant parameters |
| 441 | temp = dp.wss | ||
| 442 | # slam the wss parameter to get a text-based name | ||
| 443 | dp.wss = _dp.wss | ||
| 492 | dir_parts = [] | 444 | dir_parts = [] |
| 493 | dir_parts.append("sched=%s" % self.scheduler) | 445 | dir_parts.append("sched=%s" % self.scheduler) |
| 494 | dir_parts.append("cluster=%s" % shp.clustering) | 446 | dir_parts.append("cluster=%s" % shp.clustering) |
| @@ -504,6 +456,8 @@ class Generator(object): | |||
| 504 | 456 | ||
| 505 | print("Generating %s" % dir_leaf) | 457 | print("Generating %s" % dir_leaf) |
| 506 | 458 | ||
| 459 | dp.wss = temp | ||
| 460 | |||
| 507 | if os.path.exists(dir_path): | 461 | if os.path.exists(dir_path): |
| 508 | if force: | 462 | if force: |
| 509 | sh.rmtree(dir_path) | 463 | sh.rmtree(dir_path) |
| @@ -534,9 +488,9 @@ class Generator(object): | |||
| 534 | if PARAMS['trial'] in dp: | 488 | if PARAMS['trial'] in dp: |
| 535 | del dp[PARAMS['trial']] | 489 | del dp[PARAMS['trial']] |
| 536 | del _dp[PARAMS['trial']] | 490 | del _dp[PARAMS['trial']] |
| 537 | >>>>>>> 424917db79a1e8855c5e867bcc602476899fa28e | ||
| 538 | success = True | 491 | success = True |
| 539 | except Exception, e: | 492 | except Exception, e: |
| 493 | print e | ||
| 540 | for d in created_dirs: | 494 | for d in created_dirs: |
| 541 | sh.rmtree(d) | 495 | sh.rmtree(d) |
| 542 | if not success: | 496 | if not success: |
