source: anuga_core/source/anuga/fit_interpolate/run_long_benchmark.py @ 4839

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

speeding up slow functions in general mesh. Fix for ticket 201. Also checking in GA validation test for profiling fitting

File size: 2.3 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_results.csv'
15delimiter = ','
16
17use_least_squares_list = [False]
18is_fit_list = [True, False]
19num_of_points_list = [50, 1000] #, 500, 10000, 100000] #, 10000000]
20maxArea_list = [0.01, 0.001, 0.0001] #,0.00001] #, 0.0000001] #, 0.06, 0.00001, 0.0000001]
21max_points_per_cell_list = [8]
22use_file_type_list = ['pts']
23
24fd = open(ofile,'a')
25# write the title line
26
27fd.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
37for is_fit in is_fit_list:
38    for maxArea in maxArea_list:
39        for use_file_type in use_file_type_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(
44                        num_of_points=num_of_points
45                        ,maxArea=maxArea
46                        ,max_points_per_cell=max_points_per_cell
47                        ,is_fit=is_fit
48                        ,segments_in_mesh=False
49                        ,use_file_type=use_file_type
50                        ,save=True
51                        )
52                    print "time",time
53                    print "mem", mem
54                    print "num_tri", num_tri
55                    fd.write(str(use_file_type) + delimiter +
56                             str(num_of_points) + delimiter +
57                             str(maxArea) + delimiter +
58                             str(num_tri) + delimiter +
59                             str(max_points_per_cell) + delimiter +
60                             str(is_fit) + delimiter +
61                             str(mem)  + delimiter +
62                             str(time) + delimiter + "\n")
63fd.close()                         
Note: See TracBrowser for help on using the repository browser.