self.machine_params['latcores'] = cpus_remapped
def generate_lua(self):
- appendix = 'gencores="%s"\n'% ','.join(map(str,
- self.machine_params['gencores']))
- appendix = appendix + 'latcores="%s"\n'% ','.join(map(str,
- self.machine_params['latcores']))
- appendix = (appendix +
- 'bucket_size_exp="{}"\n'.format(self.bucket_size_exp))
+ appendix = 'bucket_size_exp="{}"\n'.format(self.bucket_size_exp)
if 'heartbeat' in self.machine_params.keys():
appendix = (appendix +
'heartbeat="%s"\n'% self.machine_params['heartbeat'])
if self.cpu_mapping is None:
RapidLog.debug('{} ({}): cpu mapping is not defined! Please check the configuration!'.format(self.name, self.ip))
return
-
- if 'mcore' in self.machine_params.keys():
- cpus_remapped = self.remap_cpus(self.machine_params['mcore'])
- RapidLog.debug('{} ({}): mcore {} remapped to {}'.format(self.name, self.ip, self.machine_params['mcore'], cpus_remapped))
- self.machine_params['mcore'] = cpus_remapped
-
- if 'cores' in self.machine_params.keys():
- cpus_remapped = self.remap_cpus(self.machine_params['cores'])
- RapidLog.debug('{} ({}): cores {} remapped to {}'.format(self.name, self.ip, self.machine_params['cores'], cpus_remapped))
- self.machine_params['cores'] = cpus_remapped
-
- if 'altcores' in self.machine_params.keys():
- cpus_remapped = self.remap_cpus(self.machine_params['altcores'])
- RapidLog.debug('{} ({}): altcores {} remapped to {}'.format(self.name, self.ip, self.machine_params['altcores'], cpus_remapped))
- self.machine_params['altcores'] = cpus_remapped
+ for key in self.machine_params.keys():
+ if 'core' in key:
+ cpus_remapped = self.remap_cpus(self.machine_params[key])
+ RapidLog.debug('{} ({}): {} {} remapped to {}'.format(self.name, self.ip, key, self.machine_params[key], cpus_remapped))
+ self.machine_params[key] = cpus_remapped
+ return
def devbind(self):
# Script to bind the right network interface to the poll mode driver
LuaFile.write(eal_line)
else:
LuaFile.write("eal=\"\"\n")
- if 'mcore' in self.machine_params.keys():
- LuaFile.write('mcore="%s"\n'% ','.join(map(str,
- self.machine_params['mcore'])))
- if 'cores' in self.machine_params.keys():
- LuaFile.write('cores="%s"\n'% ','.join(map(str,
- self.machine_params['cores'])))
- if 'altcores' in self.machine_params.keys():
- LuaFile.write('altcores="%s"\n'% ','.join(map(str,
- self.machine_params['altcores'])))
+ for key in self.machine_params.keys():
+ if 'core' in key:
+ cores = ','.join(map(str,self.machine_params[key]))
+ cores = (f'"{cores}"')
+ LuaFile.write('{}={}\n'.format(key,cores))
if 'ports' in self.machine_params.keys():
LuaFile.write('ports="%s"\n'% ','.join(map(str,
self.machine_params['ports'])))