def run_experiment(data, start_message, ignore, jabber): '''Load and parse data from files and run result.''' if not os.path.isfile(data.sched_file): raise IOError("Cannot find schedule file: %s" % data.sched_file) dir_name, fname = os.path.split(data.sched_file) work_dir = "%s/tmp" % dir_name procs, execs = load_schedule(data.name, data.sched_file, data.params.duration) pre_executables = [] #Load QPS executables to pass as parameter to Experiment class if data.params.scheduler == 'QPS': pre_executables += load_sets(os.path.join(dir_name, FILES['sets_file'])) pre_executables += load_masters(os.path.join(dir_name, FILES['masters_file'])) if data.params.scheduler == 'RUN': pre_executables += load_nodes(os.path.join(dir_name, FILES['nodes_file'])) exp = Experiment(data.name, data.params.scheduler, work_dir, data.out_dir, procs, execs, data.params.tracers, pre_executables) exp.log(start_message) if not ignore: verify_environment(data.params) run_script(data.params.pre_script, exp, dir_name, work_dir) exp.run_exp() run_script(data.params.post_script, exp, dir_name, data.out_dir) if jabber: jabber.send("Completed '%s'" % data.name) # Save parameters used to run dataeriment in out_dir out_params = dict([(PARAMS['sched'], data.params.scheduler), (PARAMS['tasks'], len(execs)), (PARAMS['dur'], data.params.duration)] + data.params.file_params.items()) # Feather-trace clock frequency saved for accurate overhead parsing ft_freq = com.ft_freq() if ft_freq: out_params[PARAMS['cycles']] = ft_freq out_param_f = "%s/%s" % (data.out_dir, FILES['params_file']) with open(out_param_f, 'w') as f: pprint.pprint(out_params, f)