def __init__(self, pipe_filename): import gc import pickle gc.disable() with open(pipe_filename, 'rb') as pf: dataset, prog, other_tparams = pickle.load(pf) os.remove(pipe_filename) self.dataset = dataset self.prog = prog self.noq = other_tparams['noq'] self.module = None self.results = {'output': []} self.setUp() from frexp.util import StopWatch, user_time from time import process_time, perf_counter timer_user = StopWatch(user_time) timer_cpu = StopWatch(process_time) timer_wall = StopWatch(perf_counter) with timer_user, timer_cpu, timer_wall: self.run() self.results = canonize(self.results) with open(pipe_filename, 'wb') as pf: pickle.dump(self.results, pf)
def dispatch_test(self, dataset, prog, other_tparams): # Use verify=True for spawn_java(). # Canonize result. if 'java' in prog: # jql_<level>_java_<cache> level = prog[4:5] cache = {'cache': True, 'nocache': False}[prog.split('_')[-1]] config = get_config() results = spawn_java(config, level, cache, True, dataset) results['output'] = canonize(results['output'], use_hash=self.condense_output) return results else: return super().dispatch_test(dataset, prog, other_tparams)
def __init__(self, pipe_filename): import gc import pickle gc.disable() with open(pipe_filename, 'rb') as pf: dataset, prog, other_tparams = pickle.load(pf) os.remove(pipe_filename) self.dataset = dataset self.prog = prog self.noq = other_tparams['noq'] self.module = None self.results = {} self.reps = dataset['reps'] self.upkind = dataset['upkind'] self.setUp() from frexp.util import StopWatch, user_time from time import process_time, perf_counter timer_user = StopWatch(user_time) timer_cpu = StopWatch(process_time) timer_wall = StopWatch(perf_counter) self.results['output'] = [] with timer_user, timer_cpu, timer_wall: self.run_demand() with timer_user, timer_cpu, timer_wall: self.run_ops() self.tearDown() self.results['output'] = canonize(self.results['output'], use_hash=self.condense_output) with open(pipe_filename, 'wb') as pf: pickle.dump(self.results, pf)
def __init__(self, pipe_filename): import gc import pickle gc.disable() with open(pipe_filename, 'rb') as pf: dataset, prog, other_tparams = pickle.load(pf) os.remove(pipe_filename) self.prog = prog self.module = None self.N = dataset['N'] self.init_att = dataset['INIT_ATT'] self.ops = dataset['OPS'] self.results = {} self.setUp() from frexp.util import StopWatch from time import process_time, perf_counter timer_cpu = StopWatch(process_time) timer_wall = StopWatch(perf_counter) self.results['output'] = [] with timer_cpu, timer_wall: finished = self.run() self.tearDown() self.results['output'] = canonize(self.results['output'], use_hash=self.condense_output) with open(pipe_filename, 'wb') as pf: pickle.dump(self.results, pf)
def log_output(self, output): canon_value = canonize(output, use_hash=self.condense_output) self.results['output'].append(canon_value)