def perform_run(problem_Size): print_problem_header(problem_Size) all_correct = True for i in range(1, problem_Size + 1): if (problem_Size % i == 0): common.run_main(i) if (common.is_result_correct()): out = "Correct" else: out = "Wrong!!!" all_correct = False print("Threads", i, ":", out) if (all_correct): print("TEST WAS SUCCESSFUL!") else: print("TEST FAILED!!") return all_correct
def perform_run(problem_Size): print_problem_header(problem_Size) all_correct = True for i in range(1,problem_Size+1): if (problem_Size % i == 0): common.run_main(i) if (common.is_result_correct()): out = "Correct" else: out = "Wrong!!!" all_correct = False print("Threads", i, ":", out) if (all_correct): print("TEST WAS SUCCESSFUL!") else: print("TEST FAILED!!") return all_correct;
def run(ws, starting_row, problem_size): write_header(ws, starting_row) common.run_datagen(problem_size) counter = 0 for i in range(1, min(problem_size + 1, 201)): if (problem_size % i == 0): counter += 1 average = 0 ws['A' + str(starting_row + counter)] = i for j in range(5): common.run_main(i) runtime = common.get_runtime() ws[columns[j + 1] + str(starting_row + counter)] = runtime average += runtime average = average / 5 ws[columns[6] + str(starting_row + counter)] = average common.cleanup() return counter + 2
def run(ws, starting_row, problem_size): write_header(ws, starting_row) common.run_datagen(problem_size) counter = 0; for i in range(1, min(problem_size+1, 201)): if(problem_size % i == 0): counter += 1 average = 0 ws['A'+str(starting_row + counter)] = i for j in range(5): common.run_main(i) runtime = common.get_runtime() ws[columns[j+1]+str(starting_row + counter)] = runtime average += runtime average = average / 5 ws[columns[6]+str(starting_row + counter)] = average common.cleanup() return counter + 2;
return img, cctx def main(argv): layoutcls, ctype, theme, args = parse_args(argv) layout = layoutcls(ctype) surface, cctx = create_surface(layout, args.scale) with open(args.events, 'r') as source: context = Context(theme, ctype, js.HandlerJsEvents(source)) context.init_time(args.start - args.delay, absstart=args.absstart) anim = ControlsAnimation(context, layout.controls, fps=args.fps) writer = FFMpegWriter(surface, cctx, args.templateargs, position=args.position, fps=args.fps, unpremultiply=args.unpremultiply) try: anim.save(writer) except BrokenPipeError: pass return writer.exit_status if __name__ == '__main__': from common import run_main run_main(main)
int(layout.width * scale), int(layout.height * scale)) cctx = cairo.Context(img) cctx.scale(scale) return img, cctx def main(argv): layoutcls, ctype, theme, args = parse_args(argv) layout = layoutcls(ctype) surface, cctx = create_surface(layout, args.scale) with open(args.events, 'r') as source: context = Context(theme, ctype, js.HandlerJsEvents(source)) context.init_time(args.start - args.delay, absstart=args.absstart) anim = ControlsAnimation(context, layout.controls, fps=args.fps) writer = FFMpegWriter(surface, cctx, args.templateargs, position=args.position, fps=args.fps, unpremultiply=args.unpremultiply) try: anim.save(writer) except BrokenPipeError: pass return writer.exit_status if __name__ == '__main__': from common import run_main run_main(main)
from openpyxl import Workbook import common wb = Workbook() ws = wb.active columns = ['A', 'B', 'C', 'D', 'E', 'F', 'G'] headers = ['Threads', 'Run 1', 'Run 2', 'Run 3', 'Run 4', 'Run 5', 'Average'] # Setup Headers for i in range(7): ws[columns[i]+'1'] = headers[i] common.run_datagen(5) common.run_main(5) print("runtime: ",common.get_runtime()) if (common.is_result_correct()): print("Result was correct!") common.cleanup() wb.save("stats.xlsx")