def run_latency(warmup_time_s, upstream_ip, upstream_port, duration_s, ssl): switch = Switch(DPID("00:00:00:00:00:00:00:01"), warmup_time_s, upstream_ip, upstream_port, 1, False, ssl) switch.start() time.sleep(duration_s) print("stop!") switch.stop() FileWriter().write_results_to_file(switch.get_results())
switch = None try: switch = Switch(options) if not options.no_ocl: import OpenCLMiner for miner in OpenCLMiner.initialize(options): switch.add_miner(miner) if not options.no_bfl: import BFLMiner for miner in BFLMiner.initialize(options): switch.add_miner(miner) for miner in switch.miners: miner.start() if switch.miners: switch.loop() else: print '\nNothing to mine on, exiting\n' except KeyboardInterrupt: print '\nbye' finally: for miner in switch.miners: miner.stop() if switch: switch.stop() if not options.no_ocl: OpenCLMiner.shutdown() sleep(1.1)
try: switch = Switch(options) if not options.no_ocl: import OpenCLMiner for miner in OpenCLMiner.initialize(options): switch.add_miner(miner) if not options.no_bfl: import BFLMiner for miner in BFLMiner.initialize(options): switch.add_miner(miner) if not switch.servers: print '\nAt least one server is required\n' elif not switch.miners: print '\nNothing to mine on, exiting\n' else: for miner in switch.miners: miner.start() switch.loop() except KeyboardInterrupt: print '\nbye' finally: for miner in switch.miners: miner.stop() if switch: switch.stop() if not options.no_ocl: OpenCLMiner.shutdown() sleep(1.1)
import OpenCLMiner for miner in OpenCLMiner.initialize(options): switch.add_miner(miner) if not options.no_bfl: import BFLMiner for miner in BFLMiner.initialize(options): switch.add_miner(miner) if not switch.servers: print "\nAt least one server is required\n" elif not switch.miners: print "\nNothing to mine on, exiting\n" else: for miner in switch.miners: miner.start() switch.loop() except KeyboardInterrupt: print "\nbye" finally: for miner in switch.miners: miner.stop() if switch: switch.stop() if not options.no_ocl: OpenCLMiner.shutdown() sleep(1.1)