- Timestamp:
- May 12, 2009, 9:59:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.