Beispiel #1
0
                retcode = loop.run_until_complete(
                    env.execute_main(args.sys_config_to_use,
                                     conf_name,
                                     running_time=32.0,
                                     emulate_opts=emulate_opts))
            if retcode not in (0, -signal.SIGTERM, -signal.SIGKILL):
                print(
                    'The main program exited abnormaly, and we ignore the results! (exit code: {0})'
                    .format(retcode))
                continue

        if args.transparent:
            continue

        # Fetch results of throughput measurement and compute average.
        num_nodes = env.get_num_nodes()
        thruput_records = thruput_reader.get_records()
        avg_thruput_mpps, avg_thruput_gbps = 0.0, 0.0
        for node_id in range(num_nodes):
            mpps = [t.mpps for t in thruput_records if t.node_id == node_id]
            gbps = [t.gbps for t in thruput_records if t.node_id == node_id]
            if len(mpps) > 0:
                avg_thruput_mpps += mean(mpps)
            if len(gbps) > 0:
                avg_thruput_gbps += mean(gbps)
        print('{0:6.2f}'.format(avg_thruput_mpps), end=' ')
        print('{0:6.2f}'.format(avg_thruput_gbps), end=' ')
        all_thruput_records.extend(thruput_records)

        ## Fetch results of cpu util measurement and compute average.
        #io_usr_avg = io_sys_avg = coproc_usr_avg = coproc_sys_avg = 0
Beispiel #2
0
         conf_name = base + '-gpuonly'
         conf_path = p[0] + '-gpuonly' + p[1]
         conf_names.append(conf_name)
         args._conf_path_map[conf_name] = conf_path
     else:
         conf_name = os.path.splitext(os.path.basename(elem_config))[0]
         conf_path = elem_config
         conf_names.append(conf_name)
         args._conf_path_map[conf_name] = conf_path
 combinations = tuple(product(
     conf_names,
     args.io_batch_sizes,
     args.comp_batch_sizes,
     args.coproc_ppdepths,
     args.num_cores,
     tuple(range(env.get_num_nodes())),
     (0,) if args.trace else args.pkt_sizes
 ))
 combinations_without_node_id = tuple(product(
     conf_names,
     args.io_batch_sizes,
     args.comp_batch_sizes,
     args.coproc_ppdepths,
     args.num_cores,
     (0,) if args.trace else args.pkt_sizes
 ))
 mi = pd.MultiIndex.from_tuples(combinations, names=[
     'conf',
     'io_batchsz',
     'comp_batchsz',
     'coproc_ppdepth',
Beispiel #3
0
                config_path = os.path.normpath(os.path.join('configs', args.sys_config_to_use))
                click_path = os.path.normpath(os.path.join('configs', conf_name))
                main_cmdargs = ['bin/main'] + env.mangle_main_args(config_path, click_path, emulate_opts=emulate_opts)
                retcode = loop.run_until_complete(execute_async_simple(main_cmdargs, timeout=args.timeout))
            else:
                retcode = loop.run_until_complete(env.execute_main(args.sys_config_to_use, conf_name,
                                                                   running_time=32.0, emulate_opts=emulate_opts))
            if retcode not in (0, -signal.SIGTERM, -signal.SIGKILL):
                print('The main program exited abnormaly, and we ignore the results! (exit code: {0})'.format(retcode))
                continue

        if args.transparent:
            continue

        # Fetch results of throughput measurement and compute average.
        num_nodes = env.get_num_nodes()
        thruput_records = thruput_reader.get_records()
        avg_thruput_mpps, avg_thruput_gbps = 0.0, 0.0
        for node_id in range(num_nodes):
            mpps = [t.mpps for t in thruput_records if t.node_id == node_id]
            gbps = [t.gbps for t in thruput_records if t.node_id == node_id]
            if len(mpps) > 0:
                avg_thruput_mpps += mean(mpps)
            if len(gbps) > 0:
                avg_thruput_gbps += mean(gbps)
        print('{0:6.2f}'.format(avg_thruput_mpps), end=' ')
        print('{0:6.2f}'.format(avg_thruput_gbps), end=' ')
        all_thruput_records.extend(thruput_records)

        ## Fetch results of cpu util measurement and compute average.
        #io_usr_avg = io_sys_avg = coproc_usr_avg = coproc_sys_avg = 0
    env.register_reader(thruput_reader)
    loop = asyncio.get_event_loop()

    pktgen = PktGenController()
    loop.run_until_complete(pktgen.init())

    conf_names = []
    args._conf_path_map = dict()
    for elem_config in args.element_configs:
        conf_name = os.path.splitext(os.path.basename(elem_config))[0]
        assert 'lbratio' in conf_name  # check config compatibility
        conf_path = elem_config
        conf_names.append(conf_name)
        args._conf_path_map[conf_name] = conf_path
    combinations = tuple(
        product(conf_names, tuple(range(env.get_num_nodes())),
                (0, ) if args.trace else args.pkt_sizes, cpu_ratio_list))
    combinations_without_node_id = tuple(
        product(conf_names, (0, ) if args.trace else args.pkt_sizes,
                cpu_ratio_list))
    mi = pd.MultiIndex.from_tuples(combinations,
                                   names=[
                                       'conf',
                                       'node_id',
                                       'pktsz',
                                       'cpu_ratio',
                                   ])
    all_tput_recs = pd.DataFrame(index=mi, columns=[
        'mpps',
        'gbps',
    ])