aboutsummaryrefslogtreecommitdiffstats
path: root/gen/generator.py
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2014-01-22 15:51:48 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2014-01-22 15:51:48 -0500
commitd4b955262433d927e966e49d59179808e5d5239f (patch)
tree641919ba6c352570592e504dcc1b111b8b2c6f5a /gen/generator.py
parent160c52110d14300bf317eca5fe64379766ac47cd (diff)
(1)fix merge conflict. (2)fix schedcat integr. bug
Diffstat (limited to 'gen/generator.py')
-rw-r--r--gen/generator.py58
1 files changed, 6 insertions, 52 deletions
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: