Changeset 7017
- Timestamp:
- May 12, 2009, 9:59:44 AM (16 years ago)
- 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 59 59 sys.exit(10) 60 60 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 61 80 # run the tests 62 81 for test_module in Tests: 63 82 (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 66 84 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 8 8 import test_utils as util 9 9 10 name = 'Dump of the acceptance test environment' 10 11 11 12 def test(logfile): 12 start_time = time.time()13 14 13 (cluster, domain) = util.get_hostname() 15 16 util.header(logfile, 'Dump of the acceptance test environment on %s.' % cluster)17 14 18 15 # show the hostname … … 57 54 util.log_print_nl(logfile) 58 55 59 util.footer(logfile, start_time)60 56 return True 61 57 -
branches/numpy_misc/tools/acceptance_tests/test_filesystem_accessibility.py
r6996 r7017 10 10 # paths we are testig 11 11 Test_Paths = ('/nas/gemd/georisk_models', 12 '/nas/gemd' # just to get 2 paths13 12 ) 13 14 name = 'Test of filesystem accessibility' 14 15 15 16 def test(logfile): 16 17 result = True 17 start_time = time.time()18 18 19 19 (cluster, domain) = util.get_hostname() 20 20 21 util.header(logfile, 'Test of filesystem accessibility on %s.' % cluster)22 21 # get python to run 23 22 python_env_var = os.getenv('PYTHON') … … 37 36 result = False 38 37 39 util.footer(logfile, start_time)40 38 return result 41 39 -
branches/numpy_misc/tools/acceptance_tests/test_latency_bandwidth.py
r6996 r7017 9 9 Processor_Numbers = [2, 4, 8, 16] 10 10 11 name = 'Running latency/bandwidth test' 12 11 13 def test(logfile): 12 14 result = True 13 start_time = time.time()14 15 15 16 (cluster, domain) = util.get_hostname() 16 17 util.header(logfile, 'Running latency/bandwidth test on %s.' % cluster)18 17 19 18 # get python to run … … 23 22 obj_file = 'ctiming_%s' % cluster 24 23 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) 26 26 (_, fd) = os.popen4(cmd) 27 27 output = fd.read() … … 30 30 util.log_print_nl(logfile, 'ERRORS COMPILING') 31 31 util.log_print(logfile, output) 32 util.footer(logfile, start_time)33 32 return False 34 33 35 util.log_print_nl(logfile , 'OK\n')34 util.log_print_nl(logfile) 36 35 37 36 # run the tests … … 39 38 machines_file = os.path.join('~', '.machines_%s' % cluster) 40 39 for num_procs in Processor_Numbers: 41 cmd = ('mpirun -n p %2d -hostfile %s %s'40 cmd = ('mpirun -nolocal -np %2d -hostfile %s %s' 42 41 % (num_procs, machines_file, obj_file)) 43 42 util.log_print(logfile, cmd + ' ...') … … 48 47 util.log_print_nl(logfile, 'ERRORS') 49 48 util.log_print(logfile, '\n'.join(output)) 50 util.footer(logfile, start_time)51 49 return False 52 50 … … 66 64 util.log_print_nl(logfile, 'ERRORS') 67 65 util.log_print(logfile, '\n'.join(output)) 68 util.footer(logfile, start_time)69 66 return False 70 67 … … 79 76 util.log_print(logfile, '%d\t%.1f\t%d\n' 80 77 % (num_processors, estimated_bandwidth, estimated_latency)) 81 82 util.footer(logfile, start_time)83 78 84 79 os.remove(obj_file) -
branches/numpy_misc/tools/acceptance_tests/test_python_packages.py
r6996 r7017 16 16 'import pypar', 17 17 'import matplotlib', 18 'import pylab') 18 'import pylab', 19 'import psyco', 20 ) 21 22 name = 'Test if python packages are importable' 19 23 20 24 def test(logfile): 21 25 result = True 22 start_time = time.time()23 26 24 27 (cluster, domain) = util.get_hostname() 25 26 util.header(logfile, 'Test if python packages are importable on %s.' % cluster)27 28 28 29 # get python to run … … 80 81 util.log_print_nl(logfile, '\t%s' % pkg) 81 82 82 util.footer(logfile, start_time)83 83 return result 84 84 -
branches/numpy_misc/tools/acceptance_tests/test_quadrature_parallel_interleaved.py
r6996 r7017 9 9 Processor_Numbers = [1, 2, 4, 8, 16] 10 10 11 name = 'Running quadrature parallel interleaved test' 12 11 13 def test(logfile): 12 14 result = True 13 start_time = time.time()14 15 15 16 (cluster, domain) = util.get_hostname() 16 17 util.header(logfile, 'Running quadrature parallel interleaved test on %s.' % cluster)18 17 19 18 # get python to run … … 21 20 22 21 # compile C code 22 util.log_print_nl(logfile, 'Compiling quadrature_parallel_interleaved.c:') 23 23 obj_file = 'quadrature_parallel_interleaved' 24 24 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) 26 26 (_, fd) = os.popen4(cmd) 27 27 output = fd.read() … … 30 30 util.log_print_nl(logfile, 'ERRORS COMPILING') 31 31 util.log_print(logfile, output) 32 util.footer(logfile, start_time)33 32 return False 34 33 35 util.log_print_nl(logfile , 'OK\n')34 util.log_print_nl(logfile) 36 35 37 36 # run the tests … … 40 39 single_processor_time = None 41 40 for num_procs in Processor_Numbers: 42 cmd = ('mpirun -n p %2d -hostfile %s %s'41 cmd = ('mpirun -nolocal -np %2d -hostfile %s %s' 43 42 % (num_procs, machines_file, obj_file)) 44 43 util.log_print(logfile, cmd + ' ...') … … 49 48 util.log_print_nl(logfile, 'ERRORS') 50 49 util.log_print(logfile, '\n'.join(output)) 51 util.footer(logfile, start_time)52 50 return False 53 51 … … 62 60 util.log_print_nl(logfile, 'ERRORS') 63 61 util.log_print(logfile, '\n'.join(output)) 64 util.footer(logfile, start_time)65 62 return False 66 63 … … 83 80 util.log_print(logfile, '%d\t%.2f\t%.2f\t%.2f\n' 84 81 % (num_processors, elapsed_time, speedup, parallel_efficiency)) 85 86 util.footer(logfile, start_time)87 82 88 83 os.remove(obj_file) -
branches/numpy_misc/tools/acceptance_tests/test_ssh_to_compute_nodes.py
r6996 r7017 7 7 import test_utils as util 8 8 9 name = 'Test of compute-node accessibility via ssh' 9 10 10 11 def test(logfile): 11 12 result = True 12 start_time = time.time()13 13 14 14 (cluster, domain) = util.get_hostname() 15 16 util.header(logfile, 'Test of compute-node accessibility via ssh on %s.' % cluster)17 15 18 16 # get python to run … … 26 24 util.log_print_nl(logfile, '\t%s' % name) 27 25 util.log_print_nl(logfile, 'You are on the %s machine.' % cluster) 28 util.footer(logfile, start_time)29 26 return False 30 27 … … 46 43 result = False 47 44 48 util.footer(logfile, start_time)49 45 return result 50 46 -
branches/numpy_misc/tools/acceptance_tests/test_test_all.py
r6996 r7017 7 7 import test_utils as util 8 8 9 name = 'Running ANUGA test_all.py' 9 10 10 11 def test(logfile): 11 12 result = True 12 start_time = time.time()13 13 14 14 (cluster, domain) = util.get_hostname() 15 16 util.header(logfile, 'Running ANUGA test_all.py on %s.' % cluster)17 15 18 16 # get python to run … … 41 39 os.chdir(home_directory) 42 40 43 util.footer(logfile, start_time)44 41 return result 45 42 -
branches/numpy_misc/tools/acceptance_tests/test_test_pypar.py
r6996 r7017 9 9 Processor_Numbers = [1, 2, 4, 8, 16] 10 10 11 name = 'Running pypar test' 12 11 13 def test(logfile): 12 14 result = True 13 start_time = time.time()14 15 15 16 (cluster, domain) = util.get_hostname() 16 17 util.header(logfile, 'Running pypar test on %s.' % cluster)18 19 17 20 18 # get python to run … … 24 22 machines_file = os.path.join('~', '.machines_%s' % cluster) 25 23 for num_procs in Processor_Numbers: 26 cmd = ('mpirun -n p %2d -hostfile %s %s test_pypar.py'24 cmd = ('mpirun -nolocal -np %2d -hostfile %s %s test_pypar.py' 27 25 % (num_procs, machines_file, python_env_var)) 28 26 util.log_print(logfile, cmd + ' ...') … … 33 31 util.log_print_nl(logfile, 'ERRORS') 34 32 util.log_print(logfile, '\n'.join(output)) 35 util.footer(logfile, start_time)36 33 result = False 37 34 else: … … 64 61 result_data = [] 65 62 for num_procs in Processor_Numbers: 66 cmd = ('mpirun -n p %2d -hostfile %s %s mandel_parallel_cyclic.py'63 cmd = ('mpirun -nolocal -np %2d -hostfile %s %s mandel_parallel_cyclic.py' 67 64 % (num_procs, machines_file, python_env_var)) 68 65 util.log_print(logfile, cmd + ' ...') … … 109 106 os.chdir(home_directory) 110 107 111 util.footer(logfile, start_time)112 113 108 return result 114 109 -
branches/numpy_misc/tools/acceptance_tests/test_utils.py
r6997 r7017 40 40 ''' 41 41 42 log(logfile, msg +' ')42 log(logfile, msg) 43 43 print msg, 44 44 sys.stdout.flush() … … 56 56 57 57 58 def header(logfile, m sg):58 def header(logfile, module, msg): 59 59 '''Write testlet header to log and stdout.''' 60 60 … … 64 64 log_print_nl(logfile, '#' * 80) 65 65 log_print_nl(logfile, '# ' + time_now + ' - ' + msg) 66 log_print_nl(logfile, '# %s' % module) 66 67 log_print_nl(logfile, '#' * 80) 67 68 log_print_nl(logfile)
Note: See TracChangeset
for help on using the changeset viewer.