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

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

benchmarking fit

File size: 2.4 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 = ','
16
17use_least_squares_list = [False]
18is_fit_list = [True]
19num_of_points_list = [200, 600, 2000, 6000, 10000, 20000]  #[5000] #, 500] #, 10000, 100000] #, 10000000]
20maxArea_list = [ 0.008, 0.0016, 0.0008]
21max_points_per_cell_list = [2,4,8,16,30,64] #,4,8,16,32,64,128,255]
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 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")
61fd.close()                         
Note: See TracBrowser for help on using the repository browser.