1 | """ |
---|
2 | This runs some benchmark tests, using the data here as input. |
---|
3 | |
---|
4 | The output is a txt file with timings and memory use info. |
---|
5 | |
---|
6 | Check pyvolution.run_profile for an example of how to use the python profile |
---|
7 | module. |
---|
8 | |
---|
9 | """ |
---|
10 | from benchmark_least_squares import BenchmarkLeastSquares |
---|
11 | |
---|
12 | ben = BenchmarkLeastSquares() |
---|
13 | |
---|
14 | ofile = 'lbm_resultsII.csv' |
---|
15 | delimiter = ',' |
---|
16 | |
---|
17 | use_least_squares_list = [False] |
---|
18 | is_fit_list = [True] |
---|
19 | num_of_points_list = [200, 600, 2000, 6000, 10000, 20000] #[5000] #, 500] #, 10000, 100000] #, 10000000] |
---|
20 | maxArea_list = [ 0.008, 0.0016, 0.0008] |
---|
21 | max_points_per_cell_list = [2,4,8,16,30,64] #,4,8,16,32,64,128,255] |
---|
22 | use_file_type_list = ['pts'] |
---|
23 | |
---|
24 | fd = open(ofile,'a') |
---|
25 | # write the title line |
---|
26 | |
---|
27 | fd.write("use_file_type" + delimiter + |
---|
28 | "num_of_points" + delimiter + |
---|
29 | "maxArea" + delimiter + |
---|
30 | "num_of_triangles" + delimiter + |
---|
31 | "max_points_per_cell" + delimiter + |
---|
32 | "is_fit" + delimiter + |
---|
33 | "mem" + delimiter + |
---|
34 | "time" + delimiter + "\n") |
---|
35 | |
---|
36 | |
---|
37 | for maxArea in maxArea_list: |
---|
38 | for use_file_type in use_file_type_list: |
---|
39 | for is_fit in is_fit_list: |
---|
40 | for num_of_points in num_of_points_list: |
---|
41 | for max_points_per_cell in max_points_per_cell_list: |
---|
42 | |
---|
43 | time, mem, num_tri = ben.trial(num_of_points=num_of_points |
---|
44 | ,maxArea=maxArea |
---|
45 | ,max_points_per_cell=max_points_per_cell |
---|
46 | ,is_fit=is_fit |
---|
47 | ,segments_in_mesh=False |
---|
48 | ,use_file_type=use_file_type |
---|
49 | ,save=True |
---|
50 | ) |
---|
51 | print "time",time |
---|
52 | print "mem", mem |
---|
53 | fd.write(str(use_file_type) + delimiter + |
---|
54 | str(num_of_points) + delimiter + |
---|
55 | str(maxArea) + delimiter + |
---|
56 | str(num_tri) + delimiter + |
---|
57 | str(max_points_per_cell) + delimiter + |
---|
58 | str(is_fit) + delimiter + |
---|
59 | str(mem) + delimiter + |
---|
60 | str(time) + delimiter + "\n") |
---|
61 | fd.close() |
---|