43 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Python
		
	
	
	
| import unittest
 | |
| from pathlib import Path
 | |
| from concho.config import HtmlConfigurator
 | |
| from concho.dell import DellConfiguratorParser2021
 | |
| from concho.procs_chooser import plot_configurators
 | |
| from concho.procs_chooser import ConfigPrice
 | |
| from concho.procs_chooser import ConfigFlopsPerEuro
 | |
| 
 | |
| 
 | |
| class Test(unittest.TestCase):
 | |
| 
 | |
|     def __init__(self, *args, **kwargs):
 | |
|         super().__init__(*args, **kwargs)
 | |
|         self.plots_dir = Path('./plots/')
 | |
|         self.plots_dir.mkdir(exist_ok=True, parents=True)
 | |
| 
 | |
|     def test_credits_2021_configs(self):
 | |
|         configurators = [
 | |
|             HtmlConfigurator(Path('catalogs/dell/20210407 - Cat2 Conf4 PowerEdge R640 - Dell.html'), DellConfiguratorParser2021()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/20210407 - Cat2 Conf7 PowerEdge R940 - Dell.html'), DellConfiguratorParser2021()),
 | |
|             HtmlConfigurator(Path('catalogs/dell/20210407 - Cat2 Conf8 PowerEdge R7525 - Dell.html'), DellConfiguratorParser2021()),
 | |
|             # HtmlConfigurator('20210407 - Cat2 Conf10 PowerEdge R6525 - Dell.html', DellConfiguratorParser2021()),
 | |
|         ]
 | |
|         # config_filter = lambda config : config.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',
 | |
|         #     ]
 | |
| 
 | |
|         def config_filter(config):
 | |
|             return config.get_price() < 40000.0
 | |
| 
 | |
|         plot_configurators(configurators=configurators, ram_per_core=4.0e9, xaxis_def=ConfigPrice(), yaxis_def=ConfigFlopsPerEuro(), plot_title='physmol/ts credit 2021 configs', config_filter=config_filter, figure_file_path=self.plots_dir / '2021-credits-configs.pdf')
 | |
| 
 | |
| 
 | |
| if __name__ == '__main__':
 | |
|     unittest.main()
 |