From 2ddd4b06389b7dde8c8fbb43b19b23fde5c40b22 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Mon, 8 Apr 2013 16:17:16 -0400 Subject: Replaced num_tasks with tasks for consistency. --- README.md | 14 +++++++------- gen/generator.py | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index dd6b417..d258900 100644 --- a/README.md +++ b/README.md @@ -224,13 +224,13 @@ The `-d` option will describe the properties of a generator or generators and th ```bash $ gen_exps.py -d G-EDF,P-EDF Generator GSN-EDF: - num_tasks -- Number of tasks per experiment. + tasks -- Number of tasks per experiment. Default: [24, 48, 72, 96] Allowed: .... Generator PSN-EDF: - num_tasks -- Number of tasks per experiment. + tasks -- Number of tasks per experiment. Default: [24, 48, 72, 96] Allowed: cpus -- Number of processors on target system. @@ -239,7 +239,7 @@ Generator PSN-EDF: .... ``` -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). +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). ```bash $ gen_exps.py P-EDF @@ -251,7 +251,7 @@ sched=GSN-EDF_num-tasks=72/ sched=GSN-EDF_num-tasks=96/ 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`): ```bash -$ gen_exps.py -f P-EDF num_tasks=24 +$ gen_exps.py -f P-EDF tasks=24 $ ls exps/ sched=GSN-EDF_num-tasks=24/ ``` @@ -259,7 +259,7 @@ sched=GSN-EDF_num-tasks=24/ Or with an array of values, specified as a comma-seperated list: ```bash -$ gen_exps.py -f num_tasks=`seq -s, 24 2 30` P-EDF +$ gen_exps.py -f tasks=`seq -s, 24 2 30` P-EDF sched=PSN-EDF_num-tasks=24/ sched=PSN-EDF_num-tasks=26/ sched=PSN-EDF_num-tasks=28/ sched=PSN-EDF_num-tasks=30/ ``` @@ -267,7 +267,7 @@ sched=PSN-EDF_num-tasks=28/ sched=PSN-EDF_num-tasks=30/ 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: ```bash -$ gen_exps.py -f num_tasks=24 cpus=3,6 P-EDF +$ gen_exps.py -f tasks=24 cpus=3,6 P-EDF $ ls exps sched=PSN-EDF_cpus=3/ sched=PSN-EDF_cpus=6/ ``` @@ -283,7 +283,7 @@ $ cat exps/sched\=PSN-EDF_cpus\=3/params.py You can also have multiple schedules generated with the same configuration using the `-n` option: ```bash -$ gen_exps.py -f num_tasks=24 -n 5 P-EDF +$ gen_exps.py -f tasks=24 -n 5 P-EDF $ ls exps/ sched=PSN-EDF_trial=0/ sched=PSN-EDF_trial=1/ sched=PSN-EDF_trial=2/ 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): release_master = list(set([False, config])) - return [GenOption('num_tasks', int, range(cpus, 5*cpus, cpus), + return [GenOption('tasks', int, range(cpus, 5*cpus, cpus), 'Number of tasks per experiment.'), GenOption('cpus', int, [cpus], 'Number of processors on target system.'), @@ -106,13 +106,13 @@ class Generator(object): tg = tasks.TaskGenerator(period=periods, util=utils) ts = [] tries = 0 - while len(ts) != params['num_tasks'] and tries < 100: - ts = tg.make_task_set(max_tasks = params['num_tasks'], max_util=max_util) + while len(ts) != params['tasks'] and tries < 100: + ts = tg.make_task_set(max_tasks = params['tasks'], max_util=max_util) tries += 1 - if len(ts) != params['num_tasks']: + if len(ts) != params['tasks']: print(("Only created task set of size %d < %d for params %s. " + "Switching to light utilization.") % - (len(ts), params['num_tasks'], params)) + (len(ts), params['tasks'], params)) print("Switching to light util. This usually means the " + "utilization distribution is too agressive.") return self._create_taskset(params, periods, NAMED_UTILIZATIONS['uni-light'], @@ -130,18 +130,18 @@ class Generator(object): '''Write out file with relevant parameters.''' # Don't include this in the parameters. It will be automatically added # in run_exps.py - if 'num_tasks' in params: - num_tasks = params.pop('num_tasks') + if 'tasks' in params: + tasks = params.pop('tasks') else: - num_tasks = 0 + tasks = 0 exp_params_file = self.out_dir + "/" + DEFAULTS['params_file'] with open(exp_params_file, 'wa') as f: params['scheduler'] = self.name pprint.pprint(params, f) - if num_tasks: - params['num_tasks'] = num_tasks + if tasks: + params['tasks'] = tasks def __setup_params(self, params): '''Set default parameter values and check that values are valid.''' -- cgit v1.2.2