def main(): logger = logging.getLogger("suw") logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) logger.addHandler(ch) parser = OptionParser(conflict_handler='resolve') expert_grp = parser.add_option_group('Expert') resource_manager.add_options(parser, expert_grp) parser.add_option( '-c', '--cfg', action='store', type='string', default=None, help='Specifiy configuration file, default: none', config='false', ) (options, args) = parser.parse_args() if options.cfg is not None: (options, args) = parser.parse_args(files=[options.cfg]) print 'Using configuration file %s' % options.cfg start_resource_manager(resource_manager, 'PA', options)
def main(): parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") ofdm_mrrc_benchmark.add_options(parser, expert_grp) transmit_path.add_options(parser, expert_grp) receive_path.add_options(parser, expert_grp) fusb_options.add_options(expert_grp) parser.add_option("-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false") (options, args) = parser.parse_args() if options.cfg is not None: (options, args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % (options.cfg) benchmark = ofdm_mrrc_benchmark(options) runtime = benchmark r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print "Couldn't enable realtime scheduling" else: print "Enabled realtime scheduling" try: if options.dot_graph: string_benchmark = runtime.dot_graph() filetx = os.path.expanduser('benchmark_mrrc_ofdm.dot') dot_file = open(filetx, 'w') dot_file.write(string_benchmark) dot_file.close() runtime.run() #runtime.start() try: tx.txpath._control._id_source.ready() except: pass except KeyboardInterrupt: runtime.stop() runtime.wait() if options.measure: print "min", tx.m.get_min() print "max", tx.m.get_max() print "avg", tx.m.get_avg()
def main(): parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") ofdm_mrrc_benchmark.add_options(parser, expert_grp) transmit_path.add_options(parser, expert_grp) receive_path.add_options(parser, expert_grp) fusb_options.add_options(expert_grp) parser.add_option( "-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false" ) (options, args) = parser.parse_args() if options.cfg is not None: (options,args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % ( options.cfg ) benchmark = ofdm_mrrc_benchmark(options) runtime = benchmark r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print "Couldn't enable realtime scheduling" else: print "Enabled realtime scheduling" try: if options.dot_graph: string_benchmark = runtime.dot_graph() filetx = os.path.expanduser('benchmark_mrrc_ofdm.dot') dot_file = open(filetx,'w') dot_file.write(string_benchmark) dot_file.close() runtime.run() #runtime.start() try: tx.txpath._control._id_source.ready() except: pass except KeyboardInterrupt: runtime.stop() runtime.wait() if options.measure: print "min",tx.m.get_min() print "max",tx.m.get_max() print "avg",tx.m.get_avg()
def main(): parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") ofdm_tx.add_options(parser, expert_grp) transmit_path.add_options(parser, expert_grp) fusb_options.add_options(expert_grp) parser.add_option("-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false") (options, args) = parser.parse_args() if options.cfg is not None: (options, args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % (options.cfg) tx = ofdm_tx(options) runtime = tx r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print "Couldn't enable realtime scheduling" else: print "Enabled realtime scheduling" try: orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) string_tx = runtime.dot_graph() dot_file = open("text_tx.dot", 'w') dot_file.write(string_tx) dot_file.close() runtime.start() try: tx.txpath._control._id_source.ready() except: pass orb.run() except KeyboardInterrupt: runtime.stop() runtime.wait() if options.measure: print "min", tx.m.get_min() print "max", tx.m.get_max() print "avg", tx.m.get_avg()
def main(): parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") ofdm_tx.add_options(parser, expert_grp) transmit_path.add_options(parser, expert_grp) fusb_options.add_options(expert_grp) parser.add_option( "-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false" ) (options, args) = parser.parse_args() if options.cfg is not None: (options,args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % ( options.cfg ) tx = ofdm_tx(options) runtime = tx r = gr.enable_realtime_scheduling() if r != gr.RT_OK: print "Couldn't enable realtime scheduling" else: print "Enabled realtime scheduling" try: orb = CORBA.ORB_init(sys.argv,CORBA.ORB_ID) string_tx = runtime.dot_graph() dot_file = open("text_tx.dot",'w') dot_file.write(string_tx) dot_file.close() runtime.start() try: tx.txpath._control._id_source.ready() except: pass orb.run() except KeyboardInterrupt: runtime.stop() runtime.wait() if options.measure: print "min",tx.m.get_min() print "max",tx.m.get_max() print "avg",tx.m.get_avg()
def main(): logger = logging.getLogger("suw") logger.setLevel(logging.DEBUG) # logfilename = "suw_" + strftime("%Y%m%d%H%M%S",gmtime()) + ".log" # fh = logging.FileHandler(logfilename) # fh.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") # fh.setFormatter(formatter) # ch.setFormatter(formatter) # logger.addHandler(fh) logger.addHandler(ch) # logger.info("Log filename is %s" %(logfilename)) parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") resource_manager.add_options(parser, expert_grp) parser.add_option( "-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false", ) (options, args) = parser.parse_args() if options.cfg is not None: (options, args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % (options.cfg) start_resource_manager(resource_manager, "PA", options)
def main(): logger = logging.getLogger("suw") logger.setLevel(logging.DEBUG) # logfilename = "suw_" + strftime("%Y%m%d%H%M%S",gmtime()) + ".log" # fh = logging.FileHandler(logfilename) # fh.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") # fh.setFormatter(formatter) # ch.setFormatter(formatter) # logger.addHandler(fh) logger.addHandler(ch) # logger.info("Log filename is %s" %(logfilename)) parser = OptionParser(conflict_handler="resolve") expert_grp = parser.add_option_group("Expert") resource_manager.add_options(parser, expert_grp) parser.add_option("-c", "--cfg", action="store", type="string", default=None, help="Specifiy configuration file, default: none", config="false") (options, args) = parser.parse_args() if options.cfg is not None: (options, args) = parser.parse_args(files=[options.cfg]) print "Using configuration file %s" % (options.cfg) start_resource_manager(resource_manager, "PA", options)
def add_option(self, *args, **kwargs): # if kwargs['action'] == 'store': # kwargs['action'] = 'callback' # kwargs['callback'] = Parser.parse_dict return OptionParser.add_option(self, *args, **kwargs)