import os from benchmarker import Benchmarker os.chdir('../..') config_file_64 = os.path.abspath("./tests/performance/conf_gen_64.ini") config_file_128 = os.path.abspath("./tests/performance/conf_gen_128.ini") config_file_256 = os.path.abspath("./tests/performance/conf_gen_256.ini") config_file_512 = os.path.abspath("./tests/performance/conf_gen_512.ini") CONFIG_FILES = [config_file_64, config_file_128, config_file_256, config_file_512] with Benchmarker() as bench: for i,config_file in enumerate(CONFIG_FILES): size = 2**(6+i) @bench(f"generation 1 core {size} tamaño") def _(bm): with bm: os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") @bench(f"generation 8 core {size} tamaño") def _(bm): with bm: os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output")