def onvm_corelist():
	global core_map
	global cores
	global core_map
	global onvm_mgr_corelist
	global onvm_nfs_corelist

	mgr_core_index = 0
	nf_core_index = len(cores)-1
	rem_cores = len(cores)

	# Run calculations for openNetVM corelists
	# ONVM Manager defaults to three threads 1x RX, 1x TX, 1x stat
	total_mgr_thread = ONVM_CONST_MGR_THRD

	for i in range(0, total_mgr_thread):
		onvm_mgr_corelist.append(core_map[(0, mgr_core_index)])
		mgr_core_index += 1
		rem_cores -= 1

	while (rem_cores > 0):
		if rem_cores >= 3:
			onvm_mgr_corelist.append(core_map[(0, cores[mgr_core_index])])
			onvm_nfs_corelist.append(core_map[(0, cores[nf_core_index])])
			onvm_nfs_corelist.append(core_map[(0, cores[nf_core_index-1])])
			mgr_core_index += 1
			nf_core_index -= 2
			rem_cores -= 3
		elif rem_cores == 2:
			onvm_mgr_corelist.append(core_map[(0, cores[mgr_core_index])])
			onvm_nfs_corelist.append(core_map[(0, cores[nf_core_index])])
			mgr_core_index += 1
			nf_core_index -= 1
			rem_cores -= 2
		else:
			break
dataset/ETHPy150Open sdnfv/openNetVM/scripts/corehelper.py/onvm_corelist/original