diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-08 16:17:16 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-08 16:17:16 -0400 |
commit | 2ddd4b06389b7dde8c8fbb43b19b23fde5c40b22 (patch) | |
tree | 541d0981fbd203c39f3ec3ee6e58592456bd7cc1 | |
parent | d169debf732270c9571be6ea6e7d920345bffc33 (diff) |
Replaced num_tasks with tasks for consistency.
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | gen/generator.py | 20 |
2 files changed, 17 insertions, 17 deletions
@@ -224,13 +224,13 @@ The `-d` option will describe the properties of a generator or generators and th | |||
224 | ```bash | 224 | ```bash |
225 | $ gen_exps.py -d G-EDF,P-EDF | 225 | $ gen_exps.py -d G-EDF,P-EDF |
226 | Generator GSN-EDF: | 226 | Generator GSN-EDF: |
227 | num_tasks -- Number of tasks per experiment. | 227 | tasks -- Number of tasks per experiment. |
228 | Default: [24, 48, 72, 96] | 228 | Default: [24, 48, 72, 96] |
229 | Allowed: <type 'int'> | 229 | Allowed: <type 'int'> |
230 | .... | 230 | .... |
231 | 231 | ||
232 | Generator PSN-EDF: | 232 | Generator PSN-EDF: |
233 | num_tasks -- Number of tasks per experiment. | 233 | tasks -- Number of tasks per experiment. |
234 | Default: [24, 48, 72, 96] | 234 | Default: [24, 48, 72, 96] |
235 | Allowed: <type 'int'> | 235 | Allowed: <type 'int'> |
236 | cpus -- Number of processors on target system. | 236 | cpus -- Number of processors on target system. |
@@ -239,7 +239,7 @@ Generator PSN-EDF: | |||
239 | .... | 239 | .... |
240 | ``` | 240 | ``` |
241 | 241 | ||
242 | You create experiments by specifying a generator. The following will create experiments 4 schedules with 24, 48, 72, and 96 tasks, because the default value of `num_tasks` is an array of these values (see above). | 242 | You create experiments by specifying a generator. The following will create experiments 4 schedules with 24, 48, 72, and 96 tasks, because the default value of `tasks` is an array of these values (see above). |
243 | 243 | ||
244 | ```bash | 244 | ```bash |
245 | $ gen_exps.py P-EDF | 245 | $ gen_exps.py P-EDF |
@@ -251,7 +251,7 @@ sched=GSN-EDF_num-tasks=72/ sched=GSN-EDF_num-tasks=96/ | |||
251 | You can modify the default using a single value (the `-f` option deletes previous experiments in the output directory, defaulting to `exps/`, changeable with `-o`): | 251 | You can modify the default using a single value (the `-f` option deletes previous experiments in the output directory, defaulting to `exps/`, changeable with `-o`): |
252 | 252 | ||
253 | ```bash | 253 | ```bash |
254 | $ gen_exps.py -f P-EDF num_tasks=24 | 254 | $ gen_exps.py -f P-EDF tasks=24 |
255 | $ ls exps/ | 255 | $ ls exps/ |
256 | sched=GSN-EDF_num-tasks=24/ | 256 | sched=GSN-EDF_num-tasks=24/ |
257 | ``` | 257 | ``` |
@@ -259,7 +259,7 @@ sched=GSN-EDF_num-tasks=24/ | |||
259 | Or with an array of values, specified as a comma-seperated list: | 259 | Or with an array of values, specified as a comma-seperated list: |
260 | 260 | ||
261 | ```bash | 261 | ```bash |
262 | $ gen_exps.py -f num_tasks=`seq -s, 24 2 30` P-EDF | 262 | $ gen_exps.py -f tasks=`seq -s, 24 2 30` P-EDF |
263 | sched=PSN-EDF_num-tasks=24/ sched=PSN-EDF_num-tasks=26/ | 263 | sched=PSN-EDF_num-tasks=24/ sched=PSN-EDF_num-tasks=26/ |
264 | sched=PSN-EDF_num-tasks=28/ sched=PSN-EDF_num-tasks=30/ | 264 | sched=PSN-EDF_num-tasks=28/ sched=PSN-EDF_num-tasks=30/ |
265 | ``` | 265 | ``` |
@@ -267,7 +267,7 @@ sched=PSN-EDF_num-tasks=28/ sched=PSN-EDF_num-tasks=30/ | |||
267 | The generator will create a different directory for each possible configuration of the parameters. Each parameter which is varied is included in the name of the schedule directory. For example, to vary the number of CPUs but not the number of tasks: | 267 | The generator will create a different directory for each possible configuration of the parameters. Each parameter which is varied is included in the name of the schedule directory. For example, to vary the number of CPUs but not the number of tasks: |
268 | 268 | ||
269 | ```bash | 269 | ```bash |
270 | $ gen_exps.py -f num_tasks=24 cpus=3,6 P-EDF | 270 | $ gen_exps.py -f tasks=24 cpus=3,6 P-EDF |
271 | $ ls exps | 271 | $ ls exps |
272 | sched=PSN-EDF_cpus=3/ sched=PSN-EDF_cpus=6/ | 272 | sched=PSN-EDF_cpus=3/ sched=PSN-EDF_cpus=6/ |
273 | ``` | 273 | ``` |
@@ -283,7 +283,7 @@ $ cat exps/sched\=PSN-EDF_cpus\=3/params.py | |||
283 | You can also have multiple schedules generated with the same configuration using the `-n` option: | 283 | You can also have multiple schedules generated with the same configuration using the `-n` option: |
284 | 284 | ||
285 | ```bash | 285 | ```bash |
286 | $ gen_exps.py -f num_tasks=24 -n 5 P-EDF | 286 | $ gen_exps.py -f tasks=24 -n 5 P-EDF |
287 | $ ls exps/ | 287 | $ ls exps/ |
288 | sched=PSN-EDF_trial=0/ sched=PSN-EDF_trial=1/ sched=PSN-EDF_trial=2/ | 288 | sched=PSN-EDF_trial=0/ sched=PSN-EDF_trial=1/ sched=PSN-EDF_trial=2/ |
289 | sched=PSN-EDF_trial=3/ sched=PSN-EDF_trial=4/ | 289 | sched=PSN-EDF_trial=3/ sched=PSN-EDF_trial=4/ |
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.''' |