nba.IOThread(core_id=node_cpus[1][1], attached_rxqs=[(4, 1), (5, 1), (6, 1), (7, 1)], mode='normal'), nba.IOThread(core_id=node_cpus[1][2], attached_rxqs=[(4, 2), (5, 2), (6, 2), (7, 2)], mode='normal'), ] comp_threads = [ # core_id nba.CompThread(core_id=node_cpus[0][0] + _ht_diff), nba.CompThread(core_id=node_cpus[0][1] + _ht_diff), nba.CompThread(core_id=node_cpus[0][2] + _ht_diff), nba.CompThread(core_id=node_cpus[1][0] + _ht_diff), nba.CompThread(core_id=node_cpus[1][1] + _ht_diff), nba.CompThread(core_id=node_cpus[1][2] + _ht_diff), ] coproc_threads = [ # core_id, device_id nba.CoprocThread(core_id=node_cpus[0][7] + _ht_diff, device_id=0), nba.CoprocThread(core_id=node_cpus[1][7] + _ht_diff, device_id=1), ] comp_input_queues = [ # node_id, template nba.Queue(node_id=0, template='swrx'), nba.Queue(node_id=0, template='swrx'), nba.Queue(node_id=0, template='swrx'), nba.Queue(node_id=1, template='swrx'), nba.Queue(node_id=1, template='swrx'), nba.Queue(node_id=1, template='swrx'), ] coproc_input_queues = [ # node_id, template
io_threads.append( nba.IOThread(core_id=node_cpus[node_id][i], attached_rxqs=attached_rxq_gen, mode='normal')) comp_threads = [] for node_id in range(no_node): for i in range(no_cpu): comp_threads.append( nba.CompThread(core_id=node_cpus[node_id][i] + _ht_diff)) coproc_threads = [] for nid in range(no_node): # core_id, device_id coproc_threads.append( nba.CoprocThread(core_id=node_cpus[nid][7] + _ht_diff, device_id=nid)) comp_input_queues = [] for nid in range(no_node): for i in range(no_cpu): comp_input_queues.append(nba.Queue(node_id=nid, template='swrx')) coproc_input_queues = [] for nid in range(no_node): coproc_input_queues.append(nba.Queue(node_id=nid, template='taskin')) coproc_completion_queues = [] for node_id in range(no_node): for i in range(no_cpu): coproc_completion_queues.append( nba.Queue(node_id=node_id, template='taskout'))
io_threads = [ # core_id, list of (port_id, rxq_idx) nba.IOThread(core_id=node_cpus[0][0], attached_rxqs=[(0, 0)], mode='normal'), ] comp_threads = [ # core_id nba.CompThread(core_id=node_cpus[0][0] + _ht_diff), ] coproc_threads = [ # core_id, device_id nba.CoprocThread(core_id=node_cpus[0][7] + _ht_diff, device_id=coprocessors[0].device_id), ] queues = [ nba.Queue(node_id=0, template='swrx'), nba.Queue(node_id=0, template='taskin'), nba.Queue(node_id=0, template='taskout'), ] thread_connections = [ # from-thread, to-thread, queue-instance (io_threads[0], comp_threads[0], queues[0]), (comp_threads[0], coproc_threads[0], queues[1]), (coproc_threads[0], comp_threads[0], queues[2]), ]
new_core_list.append(c) return new_core_list thread_connections = [] coproc_threads = [] coproc_input_queues = [] node_local_coprocs = [] for node_id, node_cores in enumerate(node_cpus): node_local_coprocs.append( [coproc for coproc in coprocessors if coproc.numa_node == node_id]) for node_local_idx, coproc in enumerate(node_local_coprocs[node_id]): core_id = node_cores[-(node_local_idx + 1)] coproc_threads.append( nba.CoprocThread(core_id=core_id + _ht_diff, device_id=coproc.device_id)) coproc_input_queues.append( nba.Queue(node_id=node_id, template='taskin')) io_threads = [] comp_threads = [] comp_input_queues = [] coproc_completion_queues = [] for node_id, node_cores in enumerate(node_cpus): node_local_netdevices = [ netdev for netdev in netdevices if netdev.numa_node == node_id ] num_coproc_in_node = len(node_local_coprocs[node_id]) node_cores = clean_siblings(node_cores) if num_coproc_in_node > 0: io_cores_in_node = node_cores[:-num_coproc_in_node]