def run_local(options, module_name, class_name, method_name): ret = None RunnerClass = get_runner_class(options.bench_runner_class) bench = RunnerClass(module_name, class_name, method_name, options) # Start a HTTP server optionally if options.debugserver: http_server_thread = FunkLoadHTTPServer(bench, options.debugport) http_server_thread.start() try: ret = bench.run() except KeyboardInterrupt: trace("* ^C received *") return ret
try: distmgr.prepare_workers(allow_errors=True) ret = distmgr.run() distmgr.final_collect() except KeyboardInterrupt: trace("* ^C received *") finally: # in any case we want to stop the workers at the end distmgr.abort() _manager = None return ret else: bench = BenchRunner(module_name, klass, method, options) # Start a HTTP server optionally if options.debugserver: http_server_thread = FunkLoadHTTPServer(bench, options.debugport) http_server_thread.start() ret = None try: ret = bench.run() except KeyboardInterrupt: trace("* ^C received *") return ret if __name__ == '__main__': ret = main() sys.exit(ret)
except UserWarning, error: trace(red_str("Distribution failed with:%s \n" % (error))) try: distmgr.prepare_workers(allow_errors=True) ret = distmgr.run() distmgr.final_collect() except KeyboardInterrupt: trace("* ^C received *") distmgr.abort() sys.exit(ret) else: bench = BenchRunner(args[0], klass, method, options) # Start a HTTP server optionally if options.debugserver == True: http_server_thread = FunkLoadHTTPServer(bench, options.debugport) http_server_thread.start() ret = None try: ret = bench.run() except KeyboardInterrupt: trace("* ^C received *") sys.exit(ret) if __name__ == '__main__': main()