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

Last change on this file since 5485 was 4655, checked in by duncan, 17 years ago

When fitting, cell data - triangle vertices and norms - are calculated the first time a point is looked for in a cell. This is to speed things up. Also, the old point info is deleted to save memory.

File size: 2.6 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
14ofile = 'lbm_resultsII.csv'
15delimiter = ','
16run_profile = False #True
17is_fit_list = [True, False]
18num_of_points_list = [3, 200, 600, 2000, 6000, 10000, 20000] 
19#maxArea_list = [ 0.008, 0.0016, 0.0008]
20max_points_per_cell_list = [2,4,8,16,30,64]
21use_file_type_list = ['pts'] #'pts'
22#num_of_points_list = [10]
23maxArea_list = [ 0.008, 0.0016]
24max_points_per_cell_list = [4]
25
26fd = open(ofile,'a')
27# write the title line
28
29fd.write("use_file_type" + delimiter +
30    "num_of_points" + delimiter +
31         "maxArea" + delimiter +
32         "num_of_triangles" + delimiter +
33         "max_points_per_cell" + delimiter +
34         "is_fit" + delimiter +
35         "is_profiling" + delimiter +
36         "mem"  + delimiter +
37         "time" + delimiter + "\n")
38
39
40for maxArea in maxArea_list:
41    for use_file_type in use_file_type_list:
42        for is_fit in is_fit_list:
43            for num_of_points in num_of_points_list:
44                for max_points_per_cell in max_points_per_cell_list:
45   
46                    time, mem, num_tri = ben.trial(num_of_points=num_of_points
47                                                   ,maxArea=maxArea
48                                                   ,max_points_per_cell=max_points_per_cell
49                                                   ,is_fit=is_fit
50                                                   ,segments_in_mesh=False
51                                                   ,use_file_type=use_file_type
52                                                   ,save=True
53                                                   ,run_profile=run_profile
54                                               )
55                    print "time",time
56                    print "mem", mem
57                    fd.write(str(use_file_type) + delimiter +
58                             str(num_of_points) + delimiter +
59                             str(maxArea) + delimiter +
60                             str(num_tri) + delimiter +
61                             str(max_points_per_cell) + delimiter +
62                             str(is_fit) + delimiter +
63                             str(run_profile) + delimiter +
64                             str(mem)  + delimiter +
65                             str(time) + delimiter + "\n")
66fd.close()                         
Note: See TracBrowser for help on using the repository browser.