decoupled config genration from plot

This allows the user to choose another set of configurations without touching plot code
This commit is contained in:
Guillaume Raffy 2020-10-01 11:01:08 +02:00
parent c588821707
commit 6b91c0d1ca
4 changed files with 85 additions and 43 deletions

View File

@ -726,7 +726,7 @@ class DellMatinfoCsvConfigurator(Configurator):
continue continue
# 2 processeurs Intel Xeon Silver 4210R 2.4GHz, 13.75M Cache,9.60GT/s, 2UPI, Turbo, HT,10C/20T (100W) - DDR4-2400 # 2 processeurs Intel Xeon Silver 4210R 2.4GHz, 13.75M Cache,9.60GT/s, 2UPI, Turbo, HT,10C/20T (100W) - DDR4-2400
match = re.match(r'^2 processeurs Intel Xeon (?P<cpu_class>Silver|Gold|Platinium) (?P<cpu_number>[0-9][0-9][0-9][0-9][RLYU]?).*$', label) match = re.match(r'^2 processeurs Intel Xeon (?P<cpu_class>Silver|Gold|Platinium) (?P<cpu_number>[0-9][0-9][0-9][0-9][RLYUM]?) .*$', label)
if match: if match:
cpu_class = match['cpu_class'].lower() cpu_class = match['cpu_class'].lower()
if cpu_class == 'platinium': if cpu_class == 'platinium':
@ -738,7 +738,7 @@ class DellMatinfoCsvConfigurator(Configurator):
self.base_config.set_cpu(Cpu(base_cpu_id)) self.base_config.set_cpu(Cpu(base_cpu_id))
continue continue
match = re.match(r'^Passage à 2 Processeurs Intel Xeon (?P<cpu_class>Silver|Gold|Platinium) (?P<cpu_number>[0-9][0-9][0-9][0-9][RLYU]?).*', label) match = re.match(r'^Passage à 2 Processeurs Intel Xeon (?P<cpu_class>Silver|Gold|Platinium) (?P<cpu_number>[0-9][0-9][0-9][0-9][RLYUM]?) .*', label)
if match: if match:
price = DellConfiguratorParser.price_str_as_float(line_cells[COLUMN_PRICE]) price = DellConfiguratorParser.price_str_as_float(line_cells[COLUMN_PRICE])
cpu_class = match['cpu_class'].lower() cpu_class = match['cpu_class'].lower()

View File

@ -67,7 +67,11 @@ def create_unique_marker(config_index):
config_index = config_index // alphabet_size config_index = config_index // alphabet_size
return marker_string return marker_string
def plot_system_efficiency(): def plot_system_efficiency(configs):
"""
Args:
configs (list(Config)): the tist of configurations to plot
"""
cpuTable = numpy.genfromtxt('cpu_table.dat', dtype=("|U15", float, int, float, float, float), names=True, delimiter='\t') cpuTable = numpy.genfromtxt('cpu_table.dat', dtype=("|U15", float, int, float, float, float), names=True, delimiter='\t')
#cpuTable = numpy.genfromtxt('dell_ivybridge_table.dat', dtype=(('id', "|S10"), ('clock', float), ('num_cores', int), ('price', float, float)), names=None, delimiter='\t') #cpuTable = numpy.genfromtxt('dell_ivybridge_table.dat', dtype=(('id', "|S10"), ('clock', float), ('num_cores', int), ('price', float, float)), names=None, delimiter='\t')
@ -134,21 +138,8 @@ def plot_system_efficiency():
item_power_consumption = numpy.array([]) item_power_consumption = numpy.array([])
item_speed = numpy.array([]) item_speed = numpy.array([])
item_label = numpy.array([]) item_label = numpy.array([])
configurators = [ for config in configs:
dell.DellMatinfoCsvConfigurator('c6420-20200716-price.tsv'), cpu = config.cpu
dell.DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html'),
dell.DellMatinfoConfigurator('rcrc1406676-4824727 - Cat 2 Conf 7 PowerEdge R940 - Dell.html'),
# dell.DellPowerEdgeR940(),
]
for configurator in configurators:
for cpu in configurator.get_cpu_options():
if not cpu.architecture in ['coffeelake', 'skylake','cascadelake']:
continue
config = configurator.create_config()
config.num_cpu_per_server = config.configurator.chassis.item.num_cpu_slots_per_server
config.set_cpu(cpu)
config.set_ram(ram_per_core=4.0e9)
config_label = str(config.num_servers) + '_' + config.chassis.uid + '_' + cpu.uid + '_' + str(config.ram_size/config.num_servers) + 'gb' config_label = str(config.num_servers) + '_' + config.chassis.uid + '_' + cpu.uid + '_' + str(config.ram_size/config.num_servers) + 'gb'
item_label = numpy.append( item_label, config_label) item_label = numpy.append( item_label, config_label)
# print('procOptionPrice', procOptionPrice) # print('procOptionPrice', procOptionPrice)
@ -259,5 +250,21 @@ def plot_system_efficiency():
plt.show() plt.show()
#plotCpuPassmark(): #plotCpuPassmark():
def plot_efficiency(configurators, ram_per_core, cpu_filter=lambda cpu : True):
configs = []
for configurator in configurators:
for cpu in configurator.get_cpu_options():
if cpu_filter(cpu):
config = configurator.create_config()
config.num_cpu_per_server = config.configurator.chassis.item.num_cpu_slots_per_server
config.set_cpu(cpu)
config.set_ram(ram_per_core=ram_per_core)
configs.append(config)
plot_system_efficiency(configs)
if __name__ == '__main__': if __name__ == '__main__':
plot_system_efficiency() plot_2020_matinfo_configs

View File

@ -123,9 +123,11 @@ intel-xeon-gold-6230r 2.1 26 150 0 0
intel-xeon-gold-6234 3.3 8 130 0 0 intel-xeon-gold-6234 3.3 8 130 0 0
intel-xeon-gold-6238 2.1 22 140 0 0 intel-xeon-gold-6238 2.1 22 140 0 0
intel-xeon-gold-6238l 2.1 22 140 0 0 intel-xeon-gold-6238l 2.1 22 140 0 0
intel-xeon-gold-6238m 2.1 22 140 0 0
intel-xeon-gold-6238r 2.2 28 165 0 0 intel-xeon-gold-6238r 2.2 28 165 0 0
intel-xeon-gold-6240 2.6 18 150 0 0 intel-xeon-gold-6240 2.6 18 150 0 0
intel-xeon-gold-6240l 2.6 18 150 0 0 intel-xeon-gold-6240l 2.6 18 150 0 0
intel-xeon-gold-6240m 2.6 18 150 0 0
intel-xeon-gold-6240r 2.4 24 165 0 0 intel-xeon-gold-6240r 2.4 24 165 0 0
intel-xeon-gold-6240y 2.6 18 150 0 0 intel-xeon-gold-6240y 2.6 18 150 0 0
intel-xeon-gold-6242 2.8 16 150 0 0 intel-xeon-gold-6242 2.8 16 150 0 0

View File

@ -1,10 +1,43 @@
from concho.dell import DellConfiguratorParser from concho.dell import DellMatinfoCsvConfigurator
from concho.dell import DellMatinfoConfigurator
from concho.procs_chooser import plot_system_efficiency from concho.procs_chooser import plot_system_efficiency
from concho.procs_chooser import plot_efficiency
def test_function(): def test_all_matinfo_2020_configs():
# configurator = DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html') # configurator = DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html')
# print(configurator) # print(configurator)
plot_system_efficiency() configurators = [
DellMatinfoCsvConfigurator('c6420-20200716-price.tsv'),
DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html'),
DellMatinfoConfigurator('rcrc1406676-4824727 - Cat 2 Conf 7 PowerEdge R940 - Dell.html'),
# dell.DellPowerEdgeR940(),
]
plot_efficiency(configurators=configurators, ram_per_core=4.0e9)
def test_credits_2020_configs():
# configurator = DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html')
# print(configurator)
configurators = [
DellMatinfoCsvConfigurator('c6420-20200716-price.tsv'),
DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html'),
DellMatinfoConfigurator('rcrc1406676-4824727 - Cat 2 Conf 7 PowerEdge R940 - Dell.html'),
# dell.DellPowerEdgeR940(),
]
cpu_filter = lambda cpu : cpu.uid in [
'intel-xeon-gold-5222',
'intel-xeon-gold-6226r',
'intel-xeon-gold-6230r',
'intel-xeon-gold-6234r',
'intel-xeon-gold-6240r',
'intel-xeon-gold-6248r',
'intel-xeon-gold-6230',
'intel-xeon-gold-6240',
]
plot_efficiency(configurators=configurators, ram_per_core=4.0e9, cpu_filter=cpu_filter)
if __name__ == '__main__': if __name__ == '__main__':
test_function() test_all_matinfo_2020_configs()