Changeset 7017


Ignore:
Timestamp:
May 12, 2009, 9:59:44 AM (11 years ago)
Author:
rwilson
Message:

Improved reporting.

Location:
branches/numpy_misc/tools/acceptance_tests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy_misc/tools/acceptance_tests/test_all.py

    r6996 r7017  
    5959        sys.exit(10)
    6060
     61    # make sure all OK with user
     62    print '*' * 80
     63    print '* Acceptance test for %s cluster' % hostname
     64    print '*' * 80
     65    print ''
     66    print 'PYTHON=%s' % python
     67    print 'PYTHONPATH=%s' % pythonpath
     68    print ''
     69    res = raw_input('This test will run with the above environment variables, OK? ')
     70    if res[0].upper() != 'Y':
     71        sys.exit(10)
     72    print ''
     73
     74    # put header on log
     75    util.log_nl(logfile, '#' * 80)
     76    util.log_nl(logfile, '# Acceptance test of cluster %s' % hostname)
     77    util.log_nl(logfile, '#' * 80)
     78    util.log_nl(logfile)
     79
    6180    # run the tests
    6281    for test_module in Tests:
    6382        (import_name, _) = test_module.split('.', 1)
    64         test_code = ("import %s\n%s.test('%s')"
    65                      % (import_name, import_name, logfile))
     83        import_code = 'import %s as test' % import_name
    6684
    67         exec test_code
     85        exec import_code
     86
     87        start_time = time.time()
     88        test_name = test.name
     89        util.header(logfile, test_module, '%s on %s.' % (test_name, hostname))
     90        #test_code = ("test.test('%s')" % logfile)
     91
     92        test.test(logfile)
     93        #exec test_code
     94
     95        util.footer(logfile, start_time)
  • branches/numpy_misc/tools/acceptance_tests/test_dump_python_environment.py

    r6998 r7017  
    88import test_utils as util
    99
     10name = 'Dump of the acceptance test environment'
    1011
    1112def test(logfile):
    12     start_time = time.time()
    13 
    1413    (cluster, domain) = util.get_hostname()
    15 
    16     util.header(logfile, 'Dump of the acceptance test environment on %s.' % cluster)
    1714
    1815    # show the hostname
     
    5754    util.log_print_nl(logfile)
    5855
    59     util.footer(logfile, start_time)
    6056    return True
    6157
  • branches/numpy_misc/tools/acceptance_tests/test_filesystem_accessibility.py

    r6996 r7017  
    1010# paths we are testig
    1111Test_Paths = ('/nas/gemd/georisk_models',
    12               '/nas/gemd'       # just to get 2 paths
    1312             )
     13
     14name = 'Test of filesystem accessibility'
    1415
    1516def test(logfile):
    1617    result = True
    17     start_time = time.time()
    1818
    1919    (cluster, domain) = util.get_hostname()
    2020
    21     util.header(logfile, 'Test of filesystem accessibility on %s.' % cluster)
    2221    # get python to run
    2322    python_env_var = os.getenv('PYTHON')
     
    3736            result = False
    3837
    39     util.footer(logfile, start_time)
    4038    return result
    4139
  • branches/numpy_misc/tools/acceptance_tests/test_latency_bandwidth.py

    r6996 r7017  
    99Processor_Numbers = [2, 4, 8, 16]
    1010
     11name = 'Running latency/bandwidth test'
     12
    1113def test(logfile):
    1214    result = True
    13     start_time = time.time()
    1415
    1516    (cluster, domain) = util.get_hostname()
    16 
    17     util.header(logfile, 'Running latency/bandwidth test on %s.' % cluster)
    1817
    1918    # get python to run
     
    2322    obj_file = 'ctiming_%s' % cluster
    2423    cmd = ('mpicc ctiming.c -lm -o %s' % obj_file)
    25     util.log_print(logfile, 'Compiling ctiming.c ...')
     24    util.log_print_nl(logfile, 'Compiling ctiming.c:')
     25    util.log_print_nl(logfile,cmd)
    2626    (_, fd) = os.popen4(cmd)
    2727    output = fd.read()
     
    3030        util.log_print_nl(logfile, 'ERRORS COMPILING')
    3131        util.log_print(logfile, output)
    32         util.footer(logfile, start_time)
    3332        return False
    3433
    35     util.log_print_nl(logfile, 'OK\n')
     34    util.log_print_nl(logfile)
    3635
    3736    # run the tests
     
    3938    machines_file = os.path.join('~', '.machines_%s' % cluster)
    4039    for num_procs in Processor_Numbers:
    41         cmd = ('mpirun -np %2d -hostfile %s %s'
     40        cmd = ('mpirun -nolocal -np %2d -hostfile %s %s'
    4241               % (num_procs, machines_file, obj_file))
    4342        util.log_print(logfile, cmd + ' ...')
     
    4847            util.log_print_nl(logfile, 'ERRORS')
    4948            util.log_print(logfile, '\n'.join(output))
    50             util.footer(logfile, start_time)
    5149            return False
    5250
     
    6664            util.log_print_nl(logfile, 'ERRORS')
    6765            util.log_print(logfile, '\n'.join(output))
    68             util.footer(logfile, start_time)
    6966            return False
    7067           
     
    7976        util.log_print(logfile, '%d\t%.1f\t%d\n'
    8077                       % (num_processors, estimated_bandwidth, estimated_latency))
    81 
    82     util.footer(logfile, start_time)
    8378
    8479    os.remove(obj_file)
  • branches/numpy_misc/tools/acceptance_tests/test_python_packages.py

    r6996 r7017  
    1616                   'import pypar',
    1717                   'import matplotlib',
    18                    'import pylab')
     18                   'import pylab',
     19                   'import psyco',
     20                  )
     21
     22name = 'Test if python packages are importable'
    1923
    2024def test(logfile):
    2125    result = True
    22     start_time = time.time()
    2326
    2427    (cluster, domain) = util.get_hostname()
    25 
    26     util.header(logfile, 'Test if python packages are importable on %s.' % cluster)
    2728
    2829    # get python to run
     
    8081            util.log_print_nl(logfile, '\t%s' % pkg)
    8182   
    82     util.footer(logfile, start_time)
    8383    return result
    8484
  • branches/numpy_misc/tools/acceptance_tests/test_quadrature_parallel_interleaved.py

    r6996 r7017  
    99Processor_Numbers = [1, 2, 4, 8, 16]
    1010
     11name = 'Running quadrature parallel interleaved test'
     12
    1113def test(logfile):
    1214    result = True
    13     start_time = time.time()
    1415
    1516    (cluster, domain) = util.get_hostname()
    16 
    17     util.header(logfile, 'Running quadrature parallel interleaved test on %s.' % cluster)
    1817
    1918    # get python to run
     
    2120
    2221    # compile C code
     22    util.log_print_nl(logfile, 'Compiling quadrature_parallel_interleaved.c:')
    2323    obj_file = 'quadrature_parallel_interleaved'
    2424    cmd = ('mpicc quadrature_parallel_interleaved.c -lm -o %s' % obj_file)
    25     util.log_print(logfile, 'Compiling quadrature_parallel_interleaved.c ...')
     25    util.log_print_nl(logfile, cmd)
    2626    (_, fd) = os.popen4(cmd)
    2727    output = fd.read()
     
    3030        util.log_print_nl(logfile, 'ERRORS COMPILING')
    3131        util.log_print(logfile, output)
    32         util.footer(logfile, start_time)
    3332        return False
    3433
    35     util.log_print_nl(logfile, 'OK\n')
     34    util.log_print_nl(logfile)
    3635
    3736    # run the tests
     
    4039    single_processor_time = None
    4140    for num_procs in Processor_Numbers:
    42         cmd = ('mpirun -np %2d -hostfile %s %s'
     41        cmd = ('mpirun -nolocal -np %2d -hostfile %s %s'
    4342               % (num_procs, machines_file, obj_file))
    4443        util.log_print(logfile, cmd + ' ...')
     
    4948            util.log_print_nl(logfile, 'ERRORS')
    5049            util.log_print(logfile, '\n'.join(output))
    51             util.footer(logfile, start_time)
    5250            return False
    5351
     
    6260            util.log_print_nl(logfile, 'ERRORS')
    6361            util.log_print(logfile, '\n'.join(output))
    64             util.footer(logfile, start_time)
    6562            return False
    6663           
     
    8380        util.log_print(logfile, '%d\t%.2f\t%.2f\t%.2f\n'
    8481                       % (num_processors, elapsed_time, speedup, parallel_efficiency))
    85 
    86     util.footer(logfile, start_time)
    8782
    8883    os.remove(obj_file)
  • branches/numpy_misc/tools/acceptance_tests/test_ssh_to_compute_nodes.py

    r6996 r7017  
    77import test_utils as util
    88
     9name = 'Test of compute-node accessibility via ssh'
    910
    1011def test(logfile):
    1112    result = True
    12     start_time = time.time()
    1313
    1414    (cluster, domain) = util.get_hostname()
    15 
    16     util.header(logfile, 'Test of compute-node accessibility via ssh on %s.' % cluster)
    1715
    1816    # get python to run
     
    2624            util.log_print_nl(logfile, '\t%s' % name)
    2725        util.log_print_nl(logfile, 'You are on the %s machine.' % cluster)
    28         util.footer(logfile, start_time)
    2926        return False
    3027
     
    4643            result = False
    4744
    48     util.footer(logfile, start_time)
    4945    return result
    5046
  • branches/numpy_misc/tools/acceptance_tests/test_test_all.py

    r6996 r7017  
    77import test_utils as util
    88
     9name = 'Running ANUGA test_all.py'
    910
    1011def test(logfile):
    1112    result = True
    12     start_time = time.time()
    1313
    1414    (cluster, domain) = util.get_hostname()
    15 
    16     util.header(logfile, 'Running ANUGA test_all.py on %s.' % cluster)
    1715
    1816    # get python to run
     
    4139    os.chdir(home_directory)
    4240
    43     util.footer(logfile, start_time)
    4441    return result
    4542
  • branches/numpy_misc/tools/acceptance_tests/test_test_pypar.py

    r6996 r7017  
    99Processor_Numbers = [1, 2, 4, 8, 16]
    1010
     11name = 'Running pypar test'
     12
    1113def test(logfile):
    1214    result = True
    13     start_time = time.time()
    1415
    1516    (cluster, domain) = util.get_hostname()
    16 
    17     util.header(logfile, 'Running pypar test on %s.' % cluster)
    18 
    1917
    2018    # get python to run
     
    2422    machines_file = os.path.join('~', '.machines_%s' % cluster)
    2523    for num_procs in Processor_Numbers:
    26         cmd = ('mpirun -np %2d -hostfile %s %s test_pypar.py'
     24        cmd = ('mpirun -nolocal -np %2d -hostfile %s %s test_pypar.py'
    2725               % (num_procs, machines_file, python_env_var))
    2826        util.log_print(logfile, cmd + ' ...')
     
    3331            util.log_print_nl(logfile, 'ERRORS')
    3432            util.log_print(logfile, '\n'.join(output))
    35             util.footer(logfile, start_time)
    3633            result = False
    3734        else:
     
    6461    result_data = []
    6562    for num_procs in Processor_Numbers:
    66         cmd = ('mpirun -np %2d -hostfile %s %s mandel_parallel_cyclic.py'
     63        cmd = ('mpirun -nolocal -np %2d -hostfile %s %s mandel_parallel_cyclic.py'
    6764               % (num_procs, machines_file, python_env_var))
    6865        util.log_print(logfile, cmd + ' ...')
     
    109106    os.chdir(home_directory)
    110107
    111     util.footer(logfile, start_time)
    112 
    113108    return result
    114109
  • branches/numpy_misc/tools/acceptance_tests/test_utils.py

    r6997 r7017  
    4040    '''
    4141
    42     log(logfile, msg+' ')
     42    log(logfile, msg)
    4343    print msg,
    4444    sys.stdout.flush()
     
    5656
    5757
    58 def header(logfile, msg):
     58def header(logfile, module, msg):
    5959    '''Write testlet header to log and stdout.'''
    6060
     
    6464    log_print_nl(logfile, '#' * 80)
    6565    log_print_nl(logfile, '# ' + time_now + ' - ' + msg)
     66    log_print_nl(logfile, '# %s' % module)
    6667    log_print_nl(logfile, '#' * 80)
    6768    log_print_nl(logfile)
Note: See TracChangeset for help on using the changeset viewer.