def parse_exp(exp_force): # Tupled for multiprocessing exp, force = exp_force result_file = exp.work_dir + "/exp_point.pkl" should_load = not force and os.path.exists(result_file) result = None if should_load: with open(result_file, 'rb') as f: try: # No need to go through this work twice result = pickle.load(f) except: pass if not result: try: result = ExpPoint(exp.path) cycles = exp.params[conf.PARAMS['cycles']] # Write overheads into result ft.extract_ft_data(result, exp.path, exp.work_dir, cycles) # Write scheduling statistics into result st.extract_sched_data(result, exp.path, exp.work_dir) with open(result_file, 'wb') as f: pickle.dump(result, f) except: traceback.print_exc() return (exp, result)
def parse_exp(exp_force): # Tupled for multiprocessing exp, force = exp_force result_file = exp.work_dir + "/exp_point.pkl" should_load = not force and os.path.exists(result_file) result = None if should_load: with open(result_file, 'rb') as f: try: # No need to go through this work twice result = pickle.load(f) except: pass if not result: try: # Create a readable name name = os.path.relpath(exp.path) name = name if name != "." else os.path.split(os.getcwd())[1] result = ExpPoint(name) # Write overheads into result cycles = exp.params[PARAMS['cycles']] ft.extract_ft_data(result, exp.path, exp.work_dir, cycles) # Write scheduling statistics into result st.extract_sched_data(result, exp.path, exp.work_dir) with open(result_file, 'wb') as f: pickle.dump(result, f) except: traceback.print_exc() return (exp, result)