Changeset 7242


Ignore:
Timestamp:
Jun 22, 2009, 12:21:51 PM (15 years ago)
Author:
rwilson
Message:

Changed time/memory values to those on current hardware.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy_anuga_validation/automated_validation_tests/fitting/validate_benchmark_fit.py

    r7240 r7242  
    2424mem 30200
    2525
     262009 June 22 - RW
     27Changed the time/memory values to be exactly those found on the hardware.
     28Took 10 measurements, used maximum in found values.
     29
    2630"""
    2731
     
    3438    def setUp(self):
    3539        pass
    36        
    3740
    3841    def tearDown(self):
     
    4548    # That's because v4872 is using geo-ref, whereas the
    4649    # previous version did not.
     50
    4751    def test_fit_time_and_mem(self):
    4852        import socket
    4953        host =  socket.gethostname()
    50         #print "host", host
    5154        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
     55        (time, mem, num_tri, one_t,
     56         more_t, quad_t) = ben.trial(num_of_points=1000,
     57                                     maxArea=0.0001,
     58                                     is_fit=True,
     59                                     segments_in_mesh=False,
     60                                     use_file_type='pts',
     61                                     save=False
     62                                    )
    6463
    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 = 30204
    74            
    75         elif host.find('compute') == 0: # cyclone or tornado node
    76             time_standard = 19.0
    77             mem_standard = 30204
     64        # define dictionary of expected time/memory usage per machine
     65        # key must be unique *prefix* of machine name, lowercase
     66        # value is tuple: (time, memory) in seconds and KiB
     67        expected_results = {'tornado':  (10.8, 40468),  # tornado headnode
     68                            'cyclone':  (7.4,  40468),  # cyclone headnode
     69                            'compute':  (10.8, 40468),  # cluster computenode
     70                            'nautilus': (8.1 , 16104),  # Ole's 32bit Ubuntu
     71                            'bogong':   (14.2, 30000),  # ANU?
     72                            'pc-31569': (31.6, 15000),  # DSG's PC
     73                            'pc-32572': (12.8, 15788),  # Ross' 32bit work Ubuntu
     74                            'saturn':   (12.8, 39404)   # Ross' 64bit home Ubuntu
     75                           }
    7876
    79         elif host.find('cyclone') == 0: # cyclone headnode
    80             time_standard = 13.3
    81             mem_standard = 30204
    82             #mem_standard = 29424
     77        # Get expected machine values, else a default set of values
     78        time_standard = 15.0        # max of above, plus a little
     79        mem_standard = 40000
     80        for key in expected_results:
     81            if host.lower().startswith(key):
     82                (time_standard, mem_standard) = expected_results[key]
    8383
    84         elif host.find('nautilus') == 0:
    85             time_standard = 27.6
    86            
    87             # v 4910 is giving a mem of 15572
    88             mem_standard = 15572
    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
     84        # don't want exception here, report on time *and* memory
     85        got_error = False
    11886        msg = ('Time used was %.1f s, standard is %.1f s +20%% (%.1f s)'
    11987               % (time, time_standard, int(time_standard*1.2)))
    12088        #print msg
    121         assert time < time_standard*1.2, msg
    122 
    123 
     89        #assert time < time_standard*1.2, msg
     90        if time > time_standard*1.2:
     91            print msg
     92            got_error = True
    12493
    12594        if sys.platform == 'win32':
     
    138107        #print msg
    139108        assert mem < mem_standard*1.2, msg           
     109
     110        if got_error:
     111            raise RuntimeError
    140112           
    141113#-------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.