aboutsummaryrefslogtreecommitdiffstats
path: root/gen/generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'gen/generator.py')
-rw-r--r--gen/generator.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/gen/generator.py b/gen/generator.py
index 3a6524d..56563b1 100644
--- a/gen/generator.py
+++ b/gen/generator.py
@@ -75,7 +75,7 @@ class Generator(object):
75 release_master = list(set([False, config])) 75 release_master = list(set([False, config]))
76 76
77 77
78 return [GenOption('num_tasks', int, range(cpus, 5*cpus, cpus), 78 return [GenOption('tasks', int, range(cpus, 5*cpus, cpus),
79 'Number of tasks per experiment.'), 79 'Number of tasks per experiment.'),
80 GenOption('cpus', int, [cpus], 80 GenOption('cpus', int, [cpus],
81 'Number of processors on target system.'), 81 'Number of processors on target system.'),
@@ -106,13 +106,13 @@ class Generator(object):
106 tg = tasks.TaskGenerator(period=periods, util=utils) 106 tg = tasks.TaskGenerator(period=periods, util=utils)
107 ts = [] 107 ts = []
108 tries = 0 108 tries = 0
109 while len(ts) != params['num_tasks'] and tries < 100: 109 while len(ts) != params['tasks'] and tries < 100:
110 ts = tg.make_task_set(max_tasks = params['num_tasks'], max_util=max_util) 110 ts = tg.make_task_set(max_tasks = params['tasks'], max_util=max_util)
111 tries += 1 111 tries += 1
112 if len(ts) != params['num_tasks']: 112 if len(ts) != params['tasks']:
113 print(("Only created task set of size %d < %d for params %s. " + 113 print(("Only created task set of size %d < %d for params %s. " +
114 "Switching to light utilization.") % 114 "Switching to light utilization.") %
115 (len(ts), params['num_tasks'], params)) 115 (len(ts), params['tasks'], params))
116 print("Switching to light util. This usually means the " + 116 print("Switching to light util. This usually means the " +
117 "utilization distribution is too agressive.") 117 "utilization distribution is too agressive.")
118 return self._create_taskset(params, periods, NAMED_UTILIZATIONS['uni-light'], 118 return self._create_taskset(params, periods, NAMED_UTILIZATIONS['uni-light'],
@@ -130,18 +130,18 @@ class Generator(object):
130 '''Write out file with relevant parameters.''' 130 '''Write out file with relevant parameters.'''
131 # Don't include this in the parameters. It will be automatically added 131 # Don't include this in the parameters. It will be automatically added
132 # in run_exps.py 132 # in run_exps.py
133 if 'num_tasks' in params: 133 if 'tasks' in params:
134 num_tasks = params.pop('num_tasks') 134 tasks = params.pop('tasks')
135 else: 135 else:
136 num_tasks = 0 136 tasks = 0
137 137
138 exp_params_file = self.out_dir + "/" + DEFAULTS['params_file'] 138 exp_params_file = self.out_dir + "/" + DEFAULTS['params_file']
139 with open(exp_params_file, 'wa') as f: 139 with open(exp_params_file, 'wa') as f:
140 params['scheduler'] = self.name 140 params['scheduler'] = self.name
141 pprint.pprint(params, f) 141 pprint.pprint(params, f)
142 142
143 if num_tasks: 143 if tasks:
144 params['num_tasks'] = num_tasks 144 params['tasks'] = tasks
145 145
146 def __setup_params(self, params): 146 def __setup_params(self, params):
147 '''Set default parameter values and check that values are valid.''' 147 '''Set default parameter values and check that values are valid.'''