source: anuga_core/source/anuga/fit_interpolate/profile_long_benchmark.py @ 5485

Last change on this file since 5485 was 4859, checked in by duncan, 16 years ago

check the last triangle fit/interp speed up. Upgrading the code to time runs

File size: 2.9 KB
Line 
1"""
2This runs some benchmark tests, using the data here as input.
3
4The output is a txt file with timings and memory use info.
5
6Check pyvolution.run_profile for an example of how to use the python profile
7module.
8
9"""
10from benchmark_least_squares import BenchmarkLeastSquares
11
12ben = BenchmarkLeastSquares()
13
14delimiter = ','
15
16use_least_squares_list = [False]
17is_fit_list = [True, False]
18# 45 is for the interp example
19# 4617 is 3 points per triangle
20#30780 is 20 points per triangle
21# 92340 is 60 points per triangle
22num_of_points_list = [92340] #[45,4617,30780,92340,] #, 500, 10000, 100000] #, 10000000]
23maxArea_list = [0.001] #,0.00001] #, 0.0000001] #, 0.06, 0.00001, 0.0000001]
24max_points_per_cell_list = [13]
25use_file_type_list = ['pts']
26run_profile = True
27
28
29if run_profile is True:
30    ofile = 'profiling_lbm_results.csv'
31else:
32    ofile = 'lbm_results.csv'
33fd = open(ofile,'a')
34# write the title line
35
36fd.write("use_file_type" + delimiter +
37    "num_of_points" + delimiter +
38         "maxArea" + delimiter +
39         "num_of_triangles" + delimiter +
40         "max_points_per_cell" + delimiter +
41         "is_fit" + delimiter +
42         "search_one_cell_time" + delimiter +
43         "search_more_cells_time" + delimiter +
44         "build_quadtree_time" + delimiter +
45         "mem"  + delimiter +
46         "time" + delimiter + "\n")
47
48
49for is_fit in is_fit_list:
50    for maxArea in maxArea_list:
51        for use_file_type in use_file_type_list:
52            for num_of_points in num_of_points_list:
53                for max_points_per_cell in max_points_per_cell_list:
54   
55                    time, mem, num_tri, one_t, more_t, quad_t = ben.trial(
56                        num_of_points=num_of_points
57                        ,maxArea=maxArea
58                        ,max_points_per_cell=max_points_per_cell
59                        ,is_fit=is_fit
60                        ,segments_in_mesh=False
61                        ,use_file_type=use_file_type
62                        ,save=True
63                        ,run_profile=run_profile
64                        )
65                    print "time",time
66                    print "mem", mem
67                    print "num_tri", num_tri
68                    fd.write(str(use_file_type) + delimiter +
69                             str(num_of_points) + delimiter +
70                             str(maxArea) + delimiter +
71                             str(num_tri) + delimiter +
72                             str(max_points_per_cell) + delimiter +
73                             str(is_fit) + delimiter +
74                             str(one_t) + delimiter +
75                             str(more_t) + delimiter +
76                             str(quad_t) + delimiter +
77                             str(mem)  + delimiter +
78                             str(time) + delimiter + "\n")
79fd.close()                         
Note: See TracBrowser for help on using the repository browser.