decoupled config genration from plot
This allows the user to choose another set of configurations without touching plot code
This commit is contained in:
		
							parent
							
								
									c588821707
								
							
						
					
					
						commit
						6b91c0d1ca
					
				|  | @ -726,7 +726,7 @@ class DellMatinfoCsvConfigurator(Configurator): | |||
|                     continue | ||||
| 
 | ||||
|                 # 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: | ||||
|                     cpu_class = match['cpu_class'].lower() | ||||
|                     if cpu_class == 'platinium': | ||||
|  | @ -738,7 +738,7 @@ class DellMatinfoCsvConfigurator(Configurator): | |||
|                     self.base_config.set_cpu(Cpu(base_cpu_id)) | ||||
|                     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: | ||||
|                     price = DellConfiguratorParser.price_str_as_float(line_cells[COLUMN_PRICE]) | ||||
|                     cpu_class = match['cpu_class'].lower() | ||||
|  |  | |||
|  | @ -67,7 +67,11 @@ def create_unique_marker(config_index): | |||
|             config_index = config_index // alphabet_size | ||||
|     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('dell_ivybridge_table.dat', dtype=(('id', "|S10"), ('clock', float), ('num_cores', int), ('price', float, float)), names=None, delimiter='\t') | ||||
|  | @ -134,41 +138,28 @@ def plot_system_efficiency(): | |||
|     item_power_consumption = numpy.array([]) | ||||
|     item_speed = numpy.array([]) | ||||
|     item_label = numpy.array([]) | ||||
|     configurators = [ | ||||
|         dell.DellMatinfoCsvConfigurator('c6420-20200716-price.tsv'), | ||||
|         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' | ||||
|             item_label = numpy.append( item_label, config_label) | ||||
|             # print('procOptionPrice', procOptionPrice) | ||||
|             # config_price = procOptionPrice | ||||
|             # config_price += config.get_empty_price() | ||||
|             # print('config.get_empty_price()', config.get_empty_price()) | ||||
|             # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_core=4.0e9) | ||||
|             # # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_server=192.0e9) | ||||
|             # # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_cpu=96.0e9) | ||||
|             # print('ram_update_price', ram_update_price) | ||||
|             # config_price += ram_update_price | ||||
|             # config_price += config.get_guarantee_price(5) | ||||
|             # print('config.config.get_guarantee_price(5)', config.get_guarantee_price(5)) | ||||
|             # config_price += config.get_disk_upgrade_price(2.0e12) | ||||
|             # print('config.get_disk_upgrade_price(2.0e12)', config.get_disk_upgrade_price(2.0e12)) | ||||
|             # print(item_label, config.get_price(), config.get_power_consumption()) | ||||
|             item_price = numpy.append( item_price, config.get_price() ) | ||||
|             item_power_consumption = numpy.append( item_power_consumption, config.get_power_consumption()) | ||||
|             # # print(hostTypeId, procId, item_power_consumption[-1]) | ||||
|             item_speed = numpy.append( item_speed, config.get_flops()) | ||||
|     for config in configs: | ||||
|         cpu = config.cpu | ||||
|         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) | ||||
|         # print('procOptionPrice', procOptionPrice) | ||||
|         # config_price = procOptionPrice | ||||
|         # config_price += config.get_empty_price() | ||||
|         # print('config.get_empty_price()', config.get_empty_price()) | ||||
|         # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_core=4.0e9) | ||||
|         # # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_server=192.0e9) | ||||
|         # # ram_update_price = config.get_ram_update_price(cpu=cpu, ram_per_cpu=96.0e9) | ||||
|         # print('ram_update_price', ram_update_price) | ||||
|         # config_price += ram_update_price | ||||
|         # config_price += config.get_guarantee_price(5) | ||||
|         # print('config.config.get_guarantee_price(5)', config.get_guarantee_price(5)) | ||||
|         # config_price += config.get_disk_upgrade_price(2.0e12) | ||||
|         # print('config.get_disk_upgrade_price(2.0e12)', config.get_disk_upgrade_price(2.0e12)) | ||||
|         # print(item_label, config.get_price(), config.get_power_consumption()) | ||||
|         item_price = numpy.append( item_price, config.get_price() ) | ||||
|         item_power_consumption = numpy.append( item_power_consumption, config.get_power_consumption()) | ||||
|         # # print(hostTypeId, procId, item_power_consumption[-1]) | ||||
|         item_speed = numpy.append( item_speed, config.get_flops()) | ||||
| 
 | ||||
|     #pylab.plot(x, y, '+') | ||||
|     #pylab.xlabel('speed/price ratio [core.MHz/euros]') | ||||
|  | @ -259,5 +250,21 @@ def plot_system_efficiency(): | |||
|     plt.show() | ||||
| 
 | ||||
| #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__': | ||||
|     plot_system_efficiency() | ||||
|     plot_2020_matinfo_configs | ||||
|  |  | |||
|  | @ -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-6238	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-6240	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-6240y	2.6	18 	150	0	0 | ||||
| intel-xeon-gold-6242	2.8	16 	150	0	0 | ||||
|  |  | |||
|  | @ -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_efficiency | ||||
| 
 | ||||
| def test_function(): | ||||
| def test_all_matinfo_2020_configs(): | ||||
|     # configurator = DellMatinfoConfigurator('rcrc1406676-4834664 - Cat2 Conf4 PowerEdge R640 - Dell.html') | ||||
|     # 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__': | ||||
|     test_function() | ||||
|     test_all_matinfo_2020_configs() | ||||
		Loading…
	
		Reference in New Issue