diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-03-18 10:52:47 -0400 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-03-18 10:52:47 -0400 |
| commit | 7200ba40d1283f56891697cd40df7a118f37d05e (patch) | |
| tree | d9444fb6940745d46bc219bc998f51fb6bc7b37b | |
| parent | 7e4e76d6e05e686023455e1553c3a42aee4e0540 (diff) | |
Automatically merge experiments with the trial parameter.
| -rw-r--r-- | config/config.py | 11 | ||||
| -rw-r--r-- | gen/generator.py | 8 | ||||
| -rw-r--r-- | parse/col_map.py | 3 | ||||
| -rwxr-xr-x | parse_exps.py | 2 |
4 files changed, 14 insertions, 10 deletions
diff --git a/config/config.py b/config/config.py index 31ef7c7..ec35ea6 100644 --- a/config/config.py +++ b/config/config.py | |||
| @@ -20,11 +20,12 @@ FILES = {'ft_data' : 'ft.bin', | |||
| 20 | 'log_data' : 'trace.slog'} | 20 | 'log_data' : 'trace.slog'} |
| 21 | 21 | ||
| 22 | '''Default parameter names in params.py.''' | 22 | '''Default parameter names in params.py.''' |
| 23 | PARAMS = {'sched' : 'scheduler', # Scheduler used by run_exps | 23 | PARAMS = {'sched' : 'scheduler', # Scheduler used by run_exps |
| 24 | 'dur' : 'duration', # Duration of tests in run_exps | 24 | 'dur' : 'duration', # Duration of tests in run_exps |
| 25 | 'kernel' : 'uname', # Regex of required OS name in run_exps | 25 | 'kernel' : 'uname', # Regex of required OS name in run_exps |
| 26 | 'cycles' : 'clock-frequency', # Frequency run_exps was run with | 26 | 'cycles' : 'clock-frequency', # Frequency run_exps was run with |
| 27 | 'tasks' : 'tasks' # Number of tasks | 27 | 'tasks' : 'tasks', # Number of tasks |
| 28 | 'trial' : 'trial' # For multiple exps with same config | ||
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | '''Default values for program options.''' | 31 | '''Default values for program options.''' |
diff --git a/gen/generator.py b/gen/generator.py index 73ccf45..dbf2a7b 100644 --- a/gen/generator.py +++ b/gen/generator.py | |||
| @@ -6,7 +6,7 @@ import shutil as sh | |||
| 6 | from Cheetah.Template import Template | 6 | from Cheetah.Template import Template |
| 7 | from collections import namedtuple | 7 | from collections import namedtuple |
| 8 | from common import get_config_option | 8 | from common import get_config_option |
| 9 | from config.config import DEFAULTS | 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 |
| 12 | 12 | ||
| @@ -199,14 +199,14 @@ class Generator(object): | |||
| 199 | os.mkdir(dir_path) | 199 | os.mkdir(dir_path) |
| 200 | 200 | ||
| 201 | if trials > 1: | 201 | if trials > 1: |
| 202 | dp['trial'] = trial | 202 | dp[PARAMS['trial']] = trial |
| 203 | self.out_dir = dir_path | 203 | self.out_dir = dir_path |
| 204 | 204 | ||
| 205 | self._create_exp(dict(dp)) | 205 | self._create_exp(dict(dp)) |
| 206 | 206 | ||
| 207 | del(self.out_dir) | 207 | del(self.out_dir) |
| 208 | if 'trial' in dp: | 208 | if PARAMS['trial'] in dp: |
| 209 | del dp['trial'] | 209 | del dp[PARAMS['trial']] |
| 210 | 210 | ||
| 211 | 211 | ||
| 212 | def print_help(self): | 212 | def print_help(self): |
diff --git a/parse/col_map.py b/parse/col_map.py index 8132639..15e1d64 100644 --- a/parse/col_map.py +++ b/parse/col_map.py | |||
| @@ -14,7 +14,8 @@ class ColMapBuilder(object): | |||
| 14 | self.value_map[column].add( value ) | 14 | self.value_map[column].add( value ) |
| 15 | 15 | ||
| 16 | def try_remove(self, column): | 16 | def try_remove(self, column): |
| 17 | del(self.value_map[column]) | 17 | if column in self.value_map: |
| 18 | del(self.value_map[column]) | ||
| 18 | 19 | ||
| 19 | class ColMap(object): | 20 | class ColMap(object): |
| 20 | def __init__(self, col_list, values = None): | 21 | def __init__(self, col_list, values = None): |
diff --git a/parse_exps.py b/parse_exps.py index 4cdc0a1..7dfc9cd 100755 --- a/parse_exps.py +++ b/parse_exps.py | |||
| @@ -131,6 +131,8 @@ def main(): | |||
| 131 | if opts.ignore: | 131 | if opts.ignore: |
| 132 | for param in opts.ignore.split(","): | 132 | for param in opts.ignore.split(","): |
| 133 | builder.try_remove(param) | 133 | builder.try_remove(param) |
| 134 | # Always average multiple trials | ||
| 135 | builder.try_remove(conf.PARAMS['trial']) | ||
| 134 | 136 | ||
| 135 | col_map = builder.build() | 137 | col_map = builder.build() |
| 136 | result_table = TupleTable(col_map) | 138 | result_table = TupleTable(col_map) |
