コード例 #1
0
ファイル: test.py プロジェクト: jbcuglietta/ece420Lab4
def perform_run(problem_Size):
	print_problem_header(problem_Size)
	common.run_datagen(problem_Size)
	all_correct = True

	for i in range(1,problem_Size+1):
		if (problem_Size % i == 0):
			common.run_main(problem_Size)
			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;
コード例 #2
0
ファイル: stats.py プロジェクト: ryant26/ece420Lab4
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
コード例 #3
0
ファイル: stats.py プロジェクト: jbcuglietta/ece420Lab4
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;
コード例 #4
0
                all_correct = False

            print("Threads", i, ":", out)

    if (all_correct):
        print("TEST WAS SUCCESSFUL!")
    else:
        print("TEST FAILED!!")

    return all_correct


def perform_multiple_sizes(sizes):
    result = True
    for i in sizes:
        result = result and perform_run(i)

    print(
        "====================================================================="
    )

    if (result):
        print("All problem sizes passed")
    else:
        print("There were failures!!!!")


# perform_multiple_sizes([3, 5, 10, 15, 20, 30, 40, 50, 100, 100, 100, 200, 300])
common.run_datagen(1112)
perform_run(1112)
common.cleanup()
コード例 #5
0
ファイル: test.py プロジェクト: ryant26/ece420Lab4
			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_multiple_sizes(sizes):
	result = True;
	for i in sizes:
		result = result and perform_run(i)

	print("=====================================================================")

	if (result):
		print("All problem sizes passed")
	else:
		print("There were failures!!!!")

# perform_multiple_sizes([3, 5, 10, 15, 20, 30, 40, 50, 100, 100, 100, 200, 300])
common.run_datagen(1112)
perform_run(1112)
common.cleanup()
コード例 #6
0
ファイル: stats.py プロジェクト: jbcuglietta/ece420Lab3
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")