Changeset 7276 for anuga_validation/automated_validation_tests/fitting
- Timestamp:
- Jun 30, 2009, 2:07:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/fitting/validate_benchmark_fit.py
r7259 r7276 24 24 mem 30200 25 25 26 2009 June 22 - RW 27 Changed the time/memory values to be exactly those found on the hardware. 28 Took 10 measurements, used maximum in found values. 29 26 30 """ 27 31 … … 34 38 def setUp(self): 35 39 pass 36 37 40 38 41 def tearDown(self): … … 45 48 # That's because v4872 is using geo-ref, whereas the 46 49 # previous version did not. 50 47 51 def test_fit_time_and_mem(self): 48 52 import socket 53 54 # get hostname - for *nix and Windows 49 55 host = socket.gethostname() 50 #print "host", host 56 57 # define dictionary of expected time/memory usage per machine. 58 # key must be unique *prefix* of machine name, lowercase. 59 # value is tuple: (time, memory) in seconds and KiB. 60 expected_results = {'tornado': (10.8, 40468), # tornado headnode 61 'cyclone': (7.4, 40468), # cyclone headnode 62 'compute': (10.8, 40468), # cluster computenode 63 'nautilus': (8.1, 16104), # Ole's 32bit Ubuntu 64 'bogong': (14.2, 30000), # ANU? 65 'pc-31569': (31.6, 15000), # DSG's PC? 66 'pc-32572': (12.8, 15788), # Ross' 32bit work Ubuntu 67 'saturn': (12.8, 39404) # Ross' 64bit home Ubuntu 68 } 69 70 # run trial, report on time and memory 51 71 ben = BenchmarkLeastSquares() 52 time, mem, num_tri, one_t, more_t, quad_t = ben.trial( 53 num_of_points=1000 54 ,maxArea=0.0001 55 ,is_fit=True 56 ,segments_in_mesh=False 57 ,use_file_type='pts' 58 ,save=False 59 ) 60 61 62 #print "time", time 63 #print "mem", mem 72 (time, mem, num_tri, one_t, 73 more_t, quad_t) = ben.trial(num_of_points=1000, 74 maxArea=0.0001, 75 is_fit=True, 76 segments_in_mesh=False, 77 use_file_type='pts', 78 save=False 79 ) 64 80 65 #Defaults 66 time_standard = 120. 67 mem_standard = 50000 68 69 if host.find('tornado') == 0: 70 # Tornado headnode 71 #time_standard = 14.5 72 time_standard = 24. 73 mem_standard = 40468 74 75 elif host.find('compute') == 0: # cyclone or tornado node 76 time_standard = 19.0 77 mem_standard = 40468 81 # Get expected machine values, else a default set of values 82 time_standard = 15.0 # max of above, plus a little 83 mem_standard = 40000 84 for key in expected_results: 85 if host.lower().startswith(key): 86 (time_standard, mem_standard) = expected_results[key] 87 break 78 88 79 elif host.find('cyclone') == 0: # cyclone headnode 80 time_standard = 13.3 81 mem_standard = 40468 82 #mem_standard = 29424 83 84 elif host.find('nautilus') == 0: 85 time_standard = 27.6 86 87 # v 4910 is giving a mem of 15572 88 mem_standard = 16104 89 90 91 elif host.find('bogong') == 0: 92 time_standard = 14.2 93 mem_standard = 30000 # Updated by Ole 20080507 94 95 96 elif host.find('pc-31569') == 0: # DSG's PC 97 time_standard = 31.6 98 mem_standard = 15000 #? 99 100 elif host.find('PC-32572') == 0: # Ross' Ubuntu box - nump trunk 101 time_standard = 12.8 102 mem_standard = 15788 #? 103 104 """ 105 test_fit_time_and_mem (__main__.Test_uq) ... very start mem_usage() 98076 106 before fitting mem_usage() 120012 107 after fitting mem_usage() 150212 108 time 15.19490695 109 mem 30200 110 111 test_fit_time_and_mem (__main__.Test_uq) ... very start mem_usage() 98108 112 before fitting mem_usage() 134696 113 after fitting mem_usage() 155820 114 115 """ 116 117 # Do the assertions here 89 # don't want exception here, report on time *and* memory 90 got_error = False 118 91 msg = ('Time used was %.1f s, standard is %.1f s +20%% (%.1f s)' 119 92 % (time, time_standard, int(time_standard*1.2))) 120 assert time < time_standard*1.2, msg 121 122 93 #print msg 94 #assert time < time_standard*1.2, msg 95 if time > time_standard*1.2: 96 print msg 97 got_error = True 123 98 124 99 if sys.platform == 'win32': … … 135 110 msg = ('Memory used was %d KiB, standard is %d KiB +20%% (%d KiB)' 136 111 % (mem, mem_standard, int(mem_standard*1.2))) 112 #print msg 137 113 assert mem < mem_standard*1.2, msg 114 115 if got_error: 116 raise RuntimeError 138 117 139 118 #-------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.