diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-23 17:28:12 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-23 17:28:12 -0400 |
commit | 2ceaa6c607ef85bde4f14017634d9d1621efca29 (patch) | |
tree | c85e755e59907a48ff762fd56473449f33c23894 /gen/generator.py | |
parent | a0e4b9fe9d7fab9a50a626cfeda3c614a9a6af5d (diff) | |
parent | 7545402506aa76261e18d85af585ff0ac1cf05c1 (diff) |
Merge branch 'master' into wip-color-mc
Conflicts:
gen/generator.py
parse/sched.py
parse_exps.py
Diffstat (limited to 'gen/generator.py')
-rw-r--r-- | gen/generator.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/gen/generator.py b/gen/generator.py index 693e52f..bc86cfe 100644 --- a/gen/generator.py +++ b/gen/generator.py | |||
@@ -5,7 +5,7 @@ import schedcat.generator.tasks as tasks | |||
5 | import shutil as sh | 5 | import shutil as sh |
6 | 6 | ||
7 | from Cheetah.Template import Template | 7 | from Cheetah.Template import Template |
8 | from common import get_config_option,num_cpus,recordtype | 8 | from common import get_config_option,num_cpus,recordtype,log_once |
9 | from config.config import DEFAULTS,PARAMS | 9 | from config.config import DEFAULTS,PARAMS |
10 | from gen.dp import DesignPointGenerator | 10 | from gen.dp import DesignPointGenerator |
11 | from parse.col_map import ColMapBuilder | 11 | from parse.col_map import ColMapBuilder |
@@ -69,11 +69,10 @@ class Generator(object): | |||
69 | else: | 69 | else: |
70 | self.cpus = num_cpus() | 70 | self.cpus = num_cpus() |
71 | try: | 71 | try: |
72 | config = get_config_option("RELEASE_MASTER") and True | 72 | rm_config = get_config_option("RELEASE_MASTER") and True |
73 | except: | 73 | except: |
74 | config = False | 74 | rm_config = False |
75 | self.release_master = list(set([False, config])) | 75 | self.release_master = list(set([False, bool(rm_config)])) |
76 | |||
77 | 76 | ||
78 | def __make_options(self, params): | 77 | def __make_options(self, params): |
79 | '''Return generic Litmus options.''' | 78 | '''Return generic Litmus options.''' |
@@ -116,11 +115,11 @@ class Generator(object): | |||
116 | ts = tg.make_task_set(max_tasks = params['tasks'], max_util=max_util) | 115 | ts = tg.make_task_set(max_tasks = params['tasks'], max_util=max_util) |
117 | tries += 1 | 116 | tries += 1 |
118 | if len(ts) != params['tasks']: | 117 | if len(ts) != params['tasks']: |
119 | print(("Only created task set of size %d < %d for params %s. " + | 118 | log_once("only", ("Only created task set of size %d < %d for " + |
120 | "Switching to light utilization.") % | 119 | "params %s. Switching to light utilization.") % |
121 | (len(ts), params['tasks'], params)) | 120 | (len(ts), params['tasks'], params)) |
122 | print("Switching to light util. This usually means the " + | 121 | log_once("light", "Switching to light util. This usually means " + |
123 | "utilization distribution is too agressive.") | 122 | "the utilization distribution is too agressive.") |
124 | return self._create_taskset(params, periods, NAMED_UTILIZATIONS['uni-light'], | 123 | return self._create_taskset(params, periods, NAMED_UTILIZATIONS['uni-light'], |
125 | max_util) | 124 | max_util) |
126 | return ts | 125 | return ts |
@@ -156,7 +155,10 @@ class Generator(object): | |||
156 | '''Set default parameter values and check that values are valid.''' | 155 | '''Set default parameter values and check that values are valid.''' |
157 | for option in self.options: | 156 | for option in self.options: |
158 | if option.name not in params: | 157 | if option.name not in params: |
159 | params[option.name] = option.default | 158 | val = option.default |
159 | val = val if type(val) == type([]) else [val] | ||
160 | |||
161 | params[option.name] = val | ||
160 | else: | 162 | else: |
161 | option.hidden = True | 163 | option.hidden = True |
162 | params[option.name] = self._check_value(option.name, | 164 | params[option.name] = self._check_value(option.name, |