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 __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) with timer_user, timer_cpu, timer_wall: self.run_demand() self.results['demtime_user'] = timer_user.consume() self.results['demtime_cpu'] = timer_cpu.consume() self.results['demtime_wall'] = timer_wall.consume() with timer_user, timer_cpu, timer_wall: self.run_ops() import incoq.runtime self.results['size'] = incoq.runtime.get_total_structure_size( self.module.__dict__) self.results['opstime_user'] = timer_user.consume() self.results['opstime_cpu'] = timer_cpu.consume() self.results['opstime_wall'] = timer_wall.consume() # For the purpose of comparing standard deviation / mean, # don't worry about the time spent demanding things. self.results['stdmetric'] = self.results['opstime_cpu'] self.tearDown() 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.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.dataset = dataset self.prog = prog self.module = None self.results = {} 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) # Make available to run for timeouts. self.timer_cpu = timer_cpu with timer_user, timer_cpu, timer_wall: finished = self.run() if finished: import incoq.runtime self.results['size'] = incoq.runtime.get_total_structure_size( self.module.__dict__) self.results['time_user'] = timer_user.consume() self.results['time_cpu'] = timer_cpu.consume() self.results['time_wall'] = timer_wall.consume() self.results['stdmetric'] = self.results['time_cpu'] else: self.results['timedout'] = True 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 __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.simplified_query = '_simp_' in prog self.module = None self.results = {} self.qseq = dataset['qseq'] 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() import incoq.runtime self.results['size'] = incoq.runtime.get_total_structure_size( self.module.__dict__) self.results['time_user'] = timer_user.consume() self.results['time_cpu'] = timer_cpu.consume() self.results['time_wall'] = timer_wall.consume() self.results['stdmetric'] = self.results['time_cpu'] self.tearDown() with open(pipe_filename, 'wb') as pf: pickle.dump(self.results, pf)