From 10cb61d6a707557bc4cc51dc62fe75943da3aa57 Mon Sep 17 00:00:00 2001 From: Oli Date: Sat, 27 Nov 2021 18:36:43 -0300 Subject: [PATCH 01/12] generation performance tests. wip --- Makefile | 5 +++- requirements.txt | 4 ++- tests/integration/test.py | 2 +- tests/performance/conf_gen_128.ini | 44 ++++++++++++++++++++++++++++++ tests/performance/conf_gen_256.ini | 44 ++++++++++++++++++++++++++++++ tests/performance/conf_gen_64.ini | 44 ++++++++++++++++++++++++++++++ tests/performance/generation.py | 33 ++++++++++++++++++++++ tools/generation/fftma_gen.py | 6 ++-- 8 files changed, 176 insertions(+), 6 deletions(-) create mode 100644 tests/performance/conf_gen_128.ini create mode 100644 tests/performance/conf_gen_256.ini create mode 100644 tests/performance/conf_gen_64.ini create mode 100644 tests/performance/generation.py diff --git a/Makefile b/Makefile index dd1eb89..4dbc27f 100644 --- a/Makefile +++ b/Makefile @@ -12,4 +12,7 @@ binaries: ./script_fortran.sh test: binaries - cd tests/integration && python3 -m unittest test.py \ No newline at end of file + cd tests/integration && python3 -m unittest test.py + +perf: binaries + cd tests/performance && python3 generation.py \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e8a4617..ca21216 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,6 @@ jupyter pandas sympy nose -mpi4py \ No newline at end of file +mpi4py +Benchmarker==4.0.1 +memory_profiler \ No newline at end of file diff --git a/tests/integration/test.py b/tests/integration/test.py index 1eee165..124a115 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -35,7 +35,7 @@ class TestIntegration(unittest.TestCase): def setUpClass(cls): os.chdir('../..') config_file = os.path.abspath("./tests/integration/conf_test.ini") - os.system("CONFIG_FILE_PATH="+ config_file + " mpirun python3 mpirunner.py") + os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -np 1 python3 mpirunner.py") binary_results = {} for binary in BINARIES: diff --git a/tests/performance/conf_gen_128.ini b/tests/performance/conf_gen_128.ini new file mode 100644 index 0000000..77c549f --- /dev/null +++ b/tests/performance/conf_gen_128.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 128 +Ny = 128 +Nz = 128 +variogram_type=1 +binary = yes +kh = 100 +kl = 0.01 +compute_lc = yes +lcBin=yes +genera=yes + + +[Connectivity] +keep_aspect= no +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=no + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_gen_256.ini b/tests/performance/conf_gen_256.ini new file mode 100644 index 0000000..77c549f --- /dev/null +++ b/tests/performance/conf_gen_256.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 128 +Ny = 128 +Nz = 128 +variogram_type=1 +binary = yes +kh = 100 +kl = 0.01 +compute_lc = yes +lcBin=yes +genera=yes + + +[Connectivity] +keep_aspect= no +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=no + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_gen_64.ini b/tests/performance/conf_gen_64.ini new file mode 100644 index 0000000..551f3c7 --- /dev/null +++ b/tests/performance/conf_gen_64.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 64 +Ny = 64 +Nz = 64 +variogram_type=1 +binary = yes +kh = 100 +kl = 0.01 +compute_lc = yes +lcBin=yes +genera=yes + + +[Connectivity] +keep_aspect= no +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=no + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/generation.py b/tests/performance/generation.py new file mode 100644 index 0000000..4725be1 --- /dev/null +++ b/tests/performance/generation.py @@ -0,0 +1,33 @@ +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_FILES = [config_file_64, config_file_128, config_file_256] + +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") \ No newline at end of file diff --git a/tools/generation/fftma_gen.py b/tools/generation/fftma_gen.py index ff0df94..8cfee67 100755 --- a/tools/generation/fftma_gen.py +++ b/tools/generation/fftma_gen.py @@ -9,9 +9,9 @@ from scipy.interpolate import interp1d import sys import time import os +from memory_profiler import profile - - +# @profile def fftmaGenerator(datadir,job,conffile): t0=time.time() @@ -79,7 +79,7 @@ def obtainLctobinBack(p,con,vario): return 1.0/f(p) - +#@profile def generate_K(Nx,Ny,Nz,con,lc,p,kh,kl,seed,logn,LogVariance,vario,datadir,compute_lc,uselc_bin): From 1f613c87a83d7c633c15d7b6cac6cbc50432506e Mon Sep 17 00:00:00 2001 From: Oli Date: Sat, 27 Nov 2021 19:54:17 -0300 Subject: [PATCH 02/12] change fttma invocation --- .gitignore | 1 + tests/performance/conf_gen_512.ini | 44 ++++++++++++++++++++++++++++++ tests/performance/generation.py | 4 ++- tools/Prealization.py | 5 ++-- tools/generation/fftma_gen.py | 12 ++++---- 5 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 tests/performance/conf_gen_512.ini diff --git a/.gitignore b/.gitignore index 6405099..1fc7913 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ tools/__pycache__/ tools/generation/__pycache__/ output/ tests/integration/tmp_output/ +tests/performance/tmp_gen_output/ output/ tests/integration/__pycache__/ fftma_module/gen/build/ diff --git a/tests/performance/conf_gen_512.ini b/tests/performance/conf_gen_512.ini new file mode 100644 index 0000000..f487be8 --- /dev/null +++ b/tests/performance/conf_gen_512.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 512 +Ny = 512 +Nz = 512 +variogram_type=1 +binary = yes +kh = 100 +kl = 0.01 +compute_lc = yes +lcBin=yes +genera=yes + + +[Connectivity] +keep_aspect= no +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=no + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/generation.py b/tests/performance/generation.py index 4725be1..3a62ac6 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -9,7 +9,9 @@ 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_FILES = [config_file_64, config_file_128, config_file_256] +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: diff --git a/tools/Prealization.py b/tools/Prealization.py index 5ce8148..099ca32 100755 --- a/tools/Prealization.py +++ b/tools/Prealization.py @@ -8,6 +8,7 @@ from tools.postprocessK.comp_PostKeff import comp_postKeff from shutil import copyfile from tools.solver.comp_Kperm_scale import comp_kperm_sub from tools.solver.Ndar import PetscP +from tools.generation.fftma_gen import fftmaGenerator CONFIG_FILE_PATH = 'config.ini' if 'CONFIG_FILE_PATH' not in os.environ else os.environ['CONFIG_FILE_PATH'] @@ -33,8 +34,8 @@ def realization(job): genera=parser.get('Generation',"genera") if genera!='no': - os.system('CONFIG_FILE_PATH=' + CONFIG_FILE_PATH + ' python3 ./tools/generation/fftma_gen.py ' + datadir +' ' + str(job)) - + fftmaGenerator(datadir, job, CONFIG_FILE_PATH) + #os.system('CONFIG_FILE_PATH=' + CONFIG_FILE_PATH + ' python3 ./tools/generation/fftma_gen.py ' + datadir +' ' + str(job)) nr= DotheLoop(job,parser, iterables)[3] -iterables['seeds'][0] diff --git a/tools/generation/fftma_gen.py b/tools/generation/fftma_gen.py index 8cfee67..2676a0c 100755 --- a/tools/generation/fftma_gen.py +++ b/tools/generation/fftma_gen.py @@ -3,15 +3,15 @@ from scipy.special import erf, erfinv from scipy.optimize import curve_fit from scipy.stats import norm from FFTMA import gen -from config import DotheLoop, get_config -from variograma import get_lc +from tools.generation.config import DotheLoop, get_config +from tools.generation.variograma import get_lc from scipy.interpolate import interp1d import sys import time import os -from memory_profiler import profile +#from memory_profiler import profile -# @profile +#@profile def fftmaGenerator(datadir,job,conffile): t0=time.time() @@ -154,6 +154,6 @@ def binarize(kc,kh,kl,p): kc=np.where(kc Date: Sat, 27 Nov 2021 19:57:46 -0300 Subject: [PATCH 03/12] Update README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 59276eb..f19a670 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ make run make test ``` +## Correr las pruebas de performance + +``` +make perf +``` + ## Instalar el binario FFTMA ``` From d3716caa239cf07702e58d41ef0dbf86c04334db Mon Sep 17 00:00:00 2001 From: Oli Date: Sat, 27 Nov 2021 20:31:58 -0300 Subject: [PATCH 04/12] fix bug. not nice --- tests/performance/generation.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/performance/generation.py b/tests/performance/generation.py index 3a62ac6..7d61dfe 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -13,23 +13,33 @@ 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] +index_1 = 0 + +index_8 = 0 + with Benchmarker() as bench: - for i,config_file in enumerate(CONFIG_FILES): + for i in range(len(CONFIG_FILES)): size = 2**(6+i) @bench(f"generation 1 core {size} tamaño") def _(bm): + global index_1 + config_file = CONFIG_FILES[index_1] 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") + index_1 +=1 @bench(f"generation 8 core {size} tamaño") def _(bm): + global index_8 + config_file = CONFIG_FILES[index_8] 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") \ No newline at end of file + os.system("rm -rf ./tests/performance/tmp_gen_output") + index_8 +=1 \ No newline at end of file From 6524fae7a3d725c9924cb30eff87432b0e0bbf22 Mon Sep 17 00:00:00 2001 From: chortas Date: Sat, 27 Nov 2021 20:42:37 -0300 Subject: [PATCH 05/12] Add travis file --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dc63579 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: + - "3.8" +install: + - make install +script: + - make test \ No newline at end of file From bea64b75da3a2b7a832b3fc7ec88560af5fb50d5 Mon Sep 17 00:00:00 2001 From: chortas Date: Sun, 28 Nov 2021 12:40:26 -0300 Subject: [PATCH 06/12] Add connectivity perf test --- Makefile | 3 +- tests/performance/conf_conn_128.ini | 44 +++++++++++++++++++++++++ tests/performance/conf_conn_256.ini | 44 +++++++++++++++++++++++++ tests/performance/conf_conn_512.ini | 44 +++++++++++++++++++++++++ tests/performance/conf_conn_64.ini | 44 +++++++++++++++++++++++++ tests/performance/connectivity.py | 51 +++++++++++++++++++++++++++++ 6 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 tests/performance/conf_conn_128.ini create mode 100644 tests/performance/conf_conn_256.ini create mode 100644 tests/performance/conf_conn_512.ini create mode 100644 tests/performance/conf_conn_64.ini create mode 100644 tests/performance/connectivity.py diff --git a/Makefile b/Makefile index 4dbc27f..bf17567 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,5 @@ test: binaries cd tests/integration && python3 -m unittest test.py perf: binaries - cd tests/performance && python3 generation.py \ No newline at end of file + cd tests/performance && python3 generation.py + cd tests/performance && python3 connectivity.py \ No newline at end of file diff --git a/tests/performance/conf_conn_128.ini b/tests/performance/conf_conn_128.ini new file mode 100644 index 0000000..f1a4233 --- /dev/null +++ b/tests/performance/conf_conn_128.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 128 +Ny = 128 +Nz = 128 +variogram_type=1 +binary = no +kh = 100 +kl = 0.01 +compute_lc = no +lcBin=no +genera=no + + +[Connectivity] +keep_aspect=yes +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=yes + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_conn_256.ini b/tests/performance/conf_conn_256.ini new file mode 100644 index 0000000..f1a4233 --- /dev/null +++ b/tests/performance/conf_conn_256.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 128 +Ny = 128 +Nz = 128 +variogram_type=1 +binary = no +kh = 100 +kl = 0.01 +compute_lc = no +lcBin=no +genera=no + + +[Connectivity] +keep_aspect=yes +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=yes + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_conn_512.ini b/tests/performance/conf_conn_512.ini new file mode 100644 index 0000000..ba15232 --- /dev/null +++ b/tests/performance/conf_conn_512.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 512 +Ny = 512 +Nz = 512 +variogram_type=1 +binary = no +kh = 100 +kl = 0.01 +compute_lc = no +lcBin=no +genera=no + + +[Connectivity] +keep_aspect= yes +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=yes + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_conn_64.ini b/tests/performance/conf_conn_64.ini new file mode 100644 index 0000000..23fea9c --- /dev/null +++ b/tests/performance/conf_conn_64.ini @@ -0,0 +1,44 @@ +[General] +simDir=tests/performance/tmp_gen_output +startJob=0 +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] + +[Generation] +Nx = 64 +Ny = 64 +Nz = 64 +variogram_type=1 +binary = no +kh = 100 +kl = 0.01 +compute_lc = no +lcBin=no +genera=no + + +[Connectivity] +keep_aspect= yes +block_size = 4 +indicators_MinBlockSize =4 +Max_sample_size = 12 +compGconec= 1 +conec=yes + + +[Solver] +num_of_cores = 1 +ref = 2 +solve = no +rtol = 1e-4 + +[K-Postprocess] +MinBlockSize =1 +Max_sample_size = 4 +kperm=no +postprocess=no +SaveVfield=no \ No newline at end of file diff --git a/tests/performance/connectivity.py b/tests/performance/connectivity.py new file mode 100644 index 0000000..a7245a6 --- /dev/null +++ b/tests/performance/connectivity.py @@ -0,0 +1,51 @@ +import os +from benchmarker import Benchmarker + +os.chdir('../..') + +config_gen_file_64 = os.path.abspath("./tests/performance/conf_gen_64.ini") +config_gen_file_128 = os.path.abspath("./tests/performance/conf_gen_128.ini") +config_gen_file_256 = os.path.abspath("./tests/performance/conf_gen_256.ini") + +config_conn_file_64 = os.path.abspath("./tests/performance/conf_conn_64.ini") +config_conn_file_128 = os.path.abspath("./tests/performance/conf_conn_128.ini") +config_conn_file_256 = os.path.abspath("./tests/performance/conf_conn_256.ini") + +GEN_CONFIG_FILES = [config_gen_file_64] +CONN_CONFIG_FILES = [config_conn_file_64] + +index_1 = 0 + +index_8 = 0 + +with Benchmarker() as bench: + + for i in range(len(CONN_CONFIG_FILES)): + size = 2**(6+i) + + @bench(f"Connectivity 1 core with size {size}") + def _(bm): + global index_1 + print(f"Running generation for {GEN_CONFIG_FILES[index_1]}") + os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 mpirunner.py") + print(f"End of generation for {GEN_CONFIG_FILES[index_1]}") + with bm: + os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 mpirunner.py") + + ## teardown + os.system("rm -rf ./tests/performance/tmp_gen_output") + index_1 +=1 + + @bench(f"Connectivity 8 core with size {size}") + def _(bm): + global index_8 + print(f"Running generation for {GEN_CONFIG_FILES[index_8]}") + os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 mpirunner.py") + print(f"End of generation for {GEN_CONFIG_FILES[index_8]}") + with bm: + os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 mpirunner.py") + + ## teardown + os.system("rm -rf ./tests/performance/tmp_gen_output") + index_8 +=1 + From df7e1f631e7daa98ed4410f573471090a2277bc8 Mon Sep 17 00:00:00 2001 From: Oli Date: Sun, 28 Nov 2021 16:52:22 -0300 Subject: [PATCH 07/12] add memory profiling in generation --- mpirunner.py | 3 ++- tests/performance/conf_gen_128.ini | 4 ++-- tests/performance/conf_gen_256.ini | 10 +++++----- tests/performance/conf_gen_512.ini | 4 ++-- tests/performance/conf_gen_64.ini | 4 ++-- tests/performance/generation.py | 4 +--- tools/generation/config.py | 1 - tools/generation/fftma_gen.py | 1 - 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/mpirunner.py b/mpirunner.py index 581ad57..cd27910 100755 --- a/mpirunner.py +++ b/mpirunner.py @@ -23,7 +23,7 @@ def main(): return - +@profile def sequential(): comm = MPI.COMM_WORLD conffile = CONFIG_FILE_PATH @@ -49,6 +49,7 @@ def manager(): return +@profile def worker(): comm = MPI.COMM_WORLD rank = comm.Get_rank() diff --git a/tests/performance/conf_gen_128.ini b/tests/performance/conf_gen_128.ini index 77c549f..baf0547 100644 --- a/tests/performance/conf_gen_128.ini +++ b/tests/performance/conf_gen_128.ini @@ -2,10 +2,10 @@ simDir=tests/performance/tmp_gen_output startJob=0 [Iterables] -p=[10,39,15] +p=[10,39,10] seeds=[5462,2] lc=[4] -connectivity=[1,2,3] +connectivity=[1] variances=[1] [Generation] diff --git a/tests/performance/conf_gen_256.ini b/tests/performance/conf_gen_256.ini index 77c549f..627fcd6 100644 --- a/tests/performance/conf_gen_256.ini +++ b/tests/performance/conf_gen_256.ini @@ -2,16 +2,16 @@ simDir=tests/performance/tmp_gen_output startJob=0 [Iterables] -p=[10,39,15] +p=[10,39,10] seeds=[5462,2] lc=[4] -connectivity=[1,2,3] +connectivity=[1] variances=[1] [Generation] -Nx = 128 -Ny = 128 -Nz = 128 +Nx = 256 +Ny = 256 +Nz = 256 variogram_type=1 binary = yes kh = 100 diff --git a/tests/performance/conf_gen_512.ini b/tests/performance/conf_gen_512.ini index f487be8..e4a0e89 100644 --- a/tests/performance/conf_gen_512.ini +++ b/tests/performance/conf_gen_512.ini @@ -2,10 +2,10 @@ simDir=tests/performance/tmp_gen_output startJob=0 [Iterables] -p=[10,39,15] +p=[10,39,10] seeds=[5462,2] lc=[4] -connectivity=[1,2,3] +connectivity=[1] variances=[1] [Generation] diff --git a/tests/performance/conf_gen_64.ini b/tests/performance/conf_gen_64.ini index 551f3c7..7143e33 100644 --- a/tests/performance/conf_gen_64.ini +++ b/tests/performance/conf_gen_64.ini @@ -2,10 +2,10 @@ simDir=tests/performance/tmp_gen_output startJob=0 [Iterables] -p=[10,39,15] +p=[10,39,10] seeds=[5462,2] lc=[4] -connectivity=[1,2,3] +connectivity=[1] variances=[1] [Generation] diff --git a/tests/performance/generation.py b/tests/performance/generation.py index 7d61dfe..76cfbab 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -9,9 +9,7 @@ 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] +CONFIG_FILES = [config_file_64, config_file_128, config_file_256] index_1 = 0 diff --git a/tools/generation/config.py b/tools/generation/config.py index 8f89238..cad562f 100755 --- a/tools/generation/config.py +++ b/tools/generation/config.py @@ -49,7 +49,6 @@ def DotheLoop(job,parser,iterables): njobs=len(variances)*len(cons)*len(seeds)*len(lcs) else: njobs=len(variances)*(len(cons)-1)*len(seeds)*len(lcs)+len(variances)*len(seeds) - return njobs i=0 diff --git a/tools/generation/fftma_gen.py b/tools/generation/fftma_gen.py index 2676a0c..483ebde 100755 --- a/tools/generation/fftma_gen.py +++ b/tools/generation/fftma_gen.py @@ -11,7 +11,6 @@ import time import os #from memory_profiler import profile -#@profile def fftmaGenerator(datadir,job,conffile): t0=time.time() From 03c9901e88211bafc13872a0b209b024a51ee617 Mon Sep 17 00:00:00 2001 From: chortas Date: Sun, 28 Nov 2021 17:12:15 -0300 Subject: [PATCH 08/12] Fixing conflicts --- tests/performance/conf_conn_64.ini | 4 ++-- tests/performance/connectivity.py | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/performance/conf_conn_64.ini b/tests/performance/conf_conn_64.ini index 23fea9c..f3ce2c5 100644 --- a/tests/performance/conf_conn_64.ini +++ b/tests/performance/conf_conn_64.ini @@ -2,10 +2,10 @@ simDir=tests/performance/tmp_gen_output startJob=0 [Iterables] -p=[10,39,15] +p=[10,39,10] seeds=[5462,2] lc=[4] -connectivity=[1,2,3] +connectivity=[1] variances=[1] [Generation] diff --git a/tests/performance/connectivity.py b/tests/performance/connectivity.py index a7245a6..4f3ca8e 100644 --- a/tests/performance/connectivity.py +++ b/tests/performance/connectivity.py @@ -26,11 +26,9 @@ with Benchmarker() as bench: @bench(f"Connectivity 1 core with size {size}") def _(bm): global index_1 - print(f"Running generation for {GEN_CONFIG_FILES[index_1]}") - os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 mpirunner.py") - print(f"End of generation for {GEN_CONFIG_FILES[index_1]}") + os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") with bm: - os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 mpirunner.py") + os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") @@ -39,11 +37,9 @@ with Benchmarker() as bench: @bench(f"Connectivity 8 core with size {size}") def _(bm): global index_8 - print(f"Running generation for {GEN_CONFIG_FILES[index_8]}") - os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 mpirunner.py") - print(f"End of generation for {GEN_CONFIG_FILES[index_8]}") + os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") with bm: - os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 mpirunner.py") + os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") From 17cb088c42509ada75801e0048abd7808660ea14 Mon Sep 17 00:00:00 2001 From: chortas Date: Sun, 28 Nov 2021 17:13:19 -0300 Subject: [PATCH 09/12] Fixing conflicts --- tests/performance/conf_conn_256.ini | 6 +++--- tests/performance/conf_conn_64.ini | 2 +- tests/performance/connectivity.py | 20 +++++++++++++++----- tests/performance/generation.py | 8 +++++--- tools/Prealization.py | 2 +- tools/connec/comp_cmap.py | 2 +- 6 files changed, 26 insertions(+), 14 deletions(-) diff --git a/tests/performance/conf_conn_256.ini b/tests/performance/conf_conn_256.ini index f1a4233..6679457 100644 --- a/tests/performance/conf_conn_256.ini +++ b/tests/performance/conf_conn_256.ini @@ -9,9 +9,9 @@ connectivity=[1,2,3] variances=[1] [Generation] -Nx = 128 -Ny = 128 -Nz = 128 +Nx = 256 +Ny = 256 +Nz = 256 variogram_type=1 binary = no kh = 100 diff --git a/tests/performance/conf_conn_64.ini b/tests/performance/conf_conn_64.ini index f3ce2c5..4a5c9c8 100644 --- a/tests/performance/conf_conn_64.ini +++ b/tests/performance/conf_conn_64.ini @@ -13,7 +13,7 @@ Nx = 64 Ny = 64 Nz = 64 variogram_type=1 -binary = no +binary = yes kh = 100 kl = 0.01 compute_lc = no diff --git a/tests/performance/connectivity.py b/tests/performance/connectivity.py index 4f3ca8e..29110a6 100644 --- a/tests/performance/connectivity.py +++ b/tests/performance/connectivity.py @@ -4,12 +4,7 @@ from benchmarker import Benchmarker os.chdir('../..') config_gen_file_64 = os.path.abspath("./tests/performance/conf_gen_64.ini") -config_gen_file_128 = os.path.abspath("./tests/performance/conf_gen_128.ini") -config_gen_file_256 = os.path.abspath("./tests/performance/conf_gen_256.ini") - config_conn_file_64 = os.path.abspath("./tests/performance/conf_conn_64.ini") -config_conn_file_128 = os.path.abspath("./tests/performance/conf_conn_128.ini") -config_conn_file_256 = os.path.abspath("./tests/performance/conf_conn_256.ini") GEN_CONFIG_FILES = [config_gen_file_64] CONN_CONFIG_FILES = [config_conn_file_64] @@ -18,6 +13,21 @@ index_1 = 0 index_8 = 0 +''' +Esta etapa tarda mucho tiempo y no es muy independiente de la generación de medios. +Si se generan medios con los parámetros dados: +[Iterables] +p=[10,39,15] +seeds=[5462,2] +lc=[4] +connectivity=[1,2,3] +variances=[1] +Se generan 90 medios: 15 (p[2]) * 2 (seeds[1]) * 3 (len(connectivity)) * 1 (len(lc)) +Pero si se toman esos medios generados y se aplica solo la etapa de conectividad +Se calcula la conectividad sobre 6 medios: 2 (seeds[1]) * 3 (len(connectivity)) * 1 (len(variances))* 1 (len(lc)) +Solucion: marcar en la etapa de generacion binary = yes -> esta bien esto? +''' + with Benchmarker() as bench: for i in range(len(CONN_CONFIG_FILES)): diff --git a/tests/performance/generation.py b/tests/performance/generation.py index 76cfbab..a2103e7 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -9,7 +9,9 @@ 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_FILES = [config_file_64, config_file_128, config_file_256] +config_file_512 = os.path.abspath("./tests/performance/conf_gen_512.ini") + +CONFIG_FILES = [config_file_64] index_1 = 0 @@ -28,7 +30,7 @@ with Benchmarker() as bench: 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") + # os.system("rm -rf ./tests/performance/tmp_gen_output") index_1 +=1 @bench(f"generation 8 core {size} tamaño") @@ -39,5 +41,5 @@ with Benchmarker() as bench: 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") + # os.system("rm -rf ./tests/performance/tmp_gen_output") index_8 +=1 \ No newline at end of file diff --git a/tools/Prealization.py b/tools/Prealization.py index 099ca32..f2bb0cc 100755 --- a/tools/Prealization.py +++ b/tools/Prealization.py @@ -38,9 +38,9 @@ def realization(job): #os.system('CONFIG_FILE_PATH=' + CONFIG_FILE_PATH + ' python3 ./tools/generation/fftma_gen.py ' + datadir +' ' + str(job)) nr= DotheLoop(job,parser, iterables)[3] -iterables['seeds'][0] - Cconec=parser.get('Connectivity',"conec") if Cconec!='no': + print(f"Datadir is {datadir}") comp_connec(parser,datadir,nr) n_p=int(parser.get('Solver',"num_of_cores")) diff --git a/tools/connec/comp_cmap.py b/tools/connec/comp_cmap.py index 5f867b4..e6c8682 100755 --- a/tools/connec/comp_cmap.py +++ b/tools/connec/comp_cmap.py @@ -9,7 +9,7 @@ import json def comp_connec(parser,rundir,nr): - + print(f"Rundir is {rundir}") kc=np.load(rundir+'k.npy') keep_aspect = parser.get('Connectivity','keep_aspect') kh,sx = float(parser.get('Generation','kh')),int(parser.get('Connectivity','block_size')) From ab87cc80991c359dd5a07f935604131a02280a89 Mon Sep 17 00:00:00 2001 From: chortas Date: Sun, 28 Nov 2021 17:24:37 -0300 Subject: [PATCH 10/12] Remove extra prints and change generation --- tests/performance/conf_conn_128.ini | 44 ----------------------------- tests/performance/conf_conn_256.ini | 44 ----------------------------- tests/performance/conf_conn_512.ini | 44 ----------------------------- tests/performance/generation.py | 8 ++---- tools/Prealization.py | 1 - tools/connec/comp_cmap.py | 1 - 6 files changed, 3 insertions(+), 139 deletions(-) delete mode 100644 tests/performance/conf_conn_128.ini delete mode 100644 tests/performance/conf_conn_256.ini delete mode 100644 tests/performance/conf_conn_512.ini diff --git a/tests/performance/conf_conn_128.ini b/tests/performance/conf_conn_128.ini deleted file mode 100644 index f1a4233..0000000 --- a/tests/performance/conf_conn_128.ini +++ /dev/null @@ -1,44 +0,0 @@ -[General] -simDir=tests/performance/tmp_gen_output -startJob=0 -[Iterables] -p=[10,39,15] -seeds=[5462,2] -lc=[4] -connectivity=[1,2,3] -variances=[1] - -[Generation] -Nx = 128 -Ny = 128 -Nz = 128 -variogram_type=1 -binary = no -kh = 100 -kl = 0.01 -compute_lc = no -lcBin=no -genera=no - - -[Connectivity] -keep_aspect=yes -block_size = 4 -indicators_MinBlockSize =4 -Max_sample_size = 12 -compGconec= 1 -conec=yes - - -[Solver] -num_of_cores = 1 -ref = 2 -solve = no -rtol = 1e-4 - -[K-Postprocess] -MinBlockSize =1 -Max_sample_size = 4 -kperm=no -postprocess=no -SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_conn_256.ini b/tests/performance/conf_conn_256.ini deleted file mode 100644 index 6679457..0000000 --- a/tests/performance/conf_conn_256.ini +++ /dev/null @@ -1,44 +0,0 @@ -[General] -simDir=tests/performance/tmp_gen_output -startJob=0 -[Iterables] -p=[10,39,15] -seeds=[5462,2] -lc=[4] -connectivity=[1,2,3] -variances=[1] - -[Generation] -Nx = 256 -Ny = 256 -Nz = 256 -variogram_type=1 -binary = no -kh = 100 -kl = 0.01 -compute_lc = no -lcBin=no -genera=no - - -[Connectivity] -keep_aspect=yes -block_size = 4 -indicators_MinBlockSize =4 -Max_sample_size = 12 -compGconec= 1 -conec=yes - - -[Solver] -num_of_cores = 1 -ref = 2 -solve = no -rtol = 1e-4 - -[K-Postprocess] -MinBlockSize =1 -Max_sample_size = 4 -kperm=no -postprocess=no -SaveVfield=no \ No newline at end of file diff --git a/tests/performance/conf_conn_512.ini b/tests/performance/conf_conn_512.ini deleted file mode 100644 index ba15232..0000000 --- a/tests/performance/conf_conn_512.ini +++ /dev/null @@ -1,44 +0,0 @@ -[General] -simDir=tests/performance/tmp_gen_output -startJob=0 -[Iterables] -p=[10,39,15] -seeds=[5462,2] -lc=[4] -connectivity=[1,2,3] -variances=[1] - -[Generation] -Nx = 512 -Ny = 512 -Nz = 512 -variogram_type=1 -binary = no -kh = 100 -kl = 0.01 -compute_lc = no -lcBin=no -genera=no - - -[Connectivity] -keep_aspect= yes -block_size = 4 -indicators_MinBlockSize =4 -Max_sample_size = 12 -compGconec= 1 -conec=yes - - -[Solver] -num_of_cores = 1 -ref = 2 -solve = no -rtol = 1e-4 - -[K-Postprocess] -MinBlockSize =1 -Max_sample_size = 4 -kperm=no -postprocess=no -SaveVfield=no \ No newline at end of file diff --git a/tests/performance/generation.py b/tests/performance/generation.py index a2103e7..76cfbab 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -9,9 +9,7 @@ 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_FILES = [config_file_64, config_file_128, config_file_256] index_1 = 0 @@ -30,7 +28,7 @@ with Benchmarker() as bench: 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") + os.system("rm -rf ./tests/performance/tmp_gen_output") index_1 +=1 @bench(f"generation 8 core {size} tamaño") @@ -41,5 +39,5 @@ with Benchmarker() as bench: 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") + os.system("rm -rf ./tests/performance/tmp_gen_output") index_8 +=1 \ No newline at end of file diff --git a/tools/Prealization.py b/tools/Prealization.py index f2bb0cc..21a566f 100755 --- a/tools/Prealization.py +++ b/tools/Prealization.py @@ -40,7 +40,6 @@ def realization(job): nr= DotheLoop(job,parser, iterables)[3] -iterables['seeds'][0] Cconec=parser.get('Connectivity',"conec") if Cconec!='no': - print(f"Datadir is {datadir}") comp_connec(parser,datadir,nr) n_p=int(parser.get('Solver',"num_of_cores")) diff --git a/tools/connec/comp_cmap.py b/tools/connec/comp_cmap.py index e6c8682..412584e 100755 --- a/tools/connec/comp_cmap.py +++ b/tools/connec/comp_cmap.py @@ -9,7 +9,6 @@ import json def comp_connec(parser,rundir,nr): - print(f"Rundir is {rundir}") kc=np.load(rundir+'k.npy') keep_aspect = parser.get('Connectivity','keep_aspect') kh,sx = float(parser.get('Generation','kh')),int(parser.get('Connectivity','block_size')) From 7c40bde80c5fb8e2946049bfc504a7c51509b2ee Mon Sep 17 00:00:00 2001 From: chortas Date: Sun, 28 Nov 2021 21:05:49 -0300 Subject: [PATCH 11/12] Add conditional decorator --- .gitignore | 1 + mpirunner.py | 8 +++++--- tests/integration/test.py | 2 +- tests/performance/connectivity.py | 8 ++++---- tests/performance/generation.py | 4 ++-- utilities/conditional_decorator.py | 7 +++++++ 6 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 utilities/conditional_decorator.py diff --git a/.gitignore b/.gitignore index 1fc7913..22f4212 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tests/integration/__pycache__/ fftma_module/gen/build/ tools/connec/conec2d tools/connec/conec3d +utilities/__pycache__/ diff --git a/mpirunner.py b/mpirunner.py index cd27910..504a772 100755 --- a/mpirunner.py +++ b/mpirunner.py @@ -5,8 +5,11 @@ from tools.generation.config import DotheLoop, get_config import os import sys from tools.Prealization import realization +from utilities.conditional_decorator import * +from memory_profiler import profile CONFIG_FILE_PATH = 'config.ini' if 'CONFIG_FILE_PATH' not in os.environ else os.environ['CONFIG_FILE_PATH'] +IS_TEST = False if 'TEST' not in os.environ else True def main(): comm = MPI.COMM_WORLD @@ -22,8 +25,7 @@ def main(): worker() return - -@profile +@conditional_decorator(profile, IS_TEST) def sequential(): comm = MPI.COMM_WORLD conffile = CONFIG_FILE_PATH @@ -49,7 +51,7 @@ def manager(): return -@profile +@conditional_decorator(profile, IS_TEST) def worker(): comm = MPI.COMM_WORLD rank = comm.Get_rank() diff --git a/tests/integration/test.py b/tests/integration/test.py index 124a115..997a989 100644 --- a/tests/integration/test.py +++ b/tests/integration/test.py @@ -35,7 +35,7 @@ class TestIntegration(unittest.TestCase): def setUpClass(cls): os.chdir('../..') config_file = os.path.abspath("./tests/integration/conf_test.ini") - os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -np 1 python3 mpirunner.py") + os.system(f"CONFIG_FILE_PATH={config_file} mpirun -np 1 python3 mpirunner.py") binary_results = {} for binary in BINARIES: diff --git a/tests/performance/connectivity.py b/tests/performance/connectivity.py index 29110a6..c71634c 100644 --- a/tests/performance/connectivity.py +++ b/tests/performance/connectivity.py @@ -36,9 +36,9 @@ with Benchmarker() as bench: @bench(f"Connectivity 1 core with size {size}") def _(bm): global index_1 - os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={GEN_CONFIG_FILES[index_1]} TEST=True mpirun -oversubscribe -np 1 python3 mpirunner.py") with bm: - os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_1] + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={CONN_CONFIG_FILES[index_1]} TEST=True mpirun -oversubscribe -np 1 python3 mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") @@ -47,9 +47,9 @@ with Benchmarker() as bench: @bench(f"Connectivity 8 core with size {size}") def _(bm): global index_8 - os.system("CONFIG_FILE_PATH="+ GEN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={GEN_CONFIG_FILES[index_8]} TEST=True mpirun -oversubscribe -np 8 python3 mpirunner.py") with bm: - os.system("CONFIG_FILE_PATH="+ CONN_CONFIG_FILES[index_8] + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={CONN_CONFIG_FILES[index_8]} TEST=True mpirun -oversubscribe -np 8 python3 mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") diff --git a/tests/performance/generation.py b/tests/performance/generation.py index 76cfbab..837467d 100644 --- a/tests/performance/generation.py +++ b/tests/performance/generation.py @@ -25,7 +25,7 @@ with Benchmarker() as bench: global index_1 config_file = CONFIG_FILES[index_1] with bm: - os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -oversubscribe -np 1 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={config_file} TEST=True mpirun -oversubscribe -np 1 python3 mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") @@ -36,7 +36,7 @@ with Benchmarker() as bench: global index_8 config_file = CONFIG_FILES[index_8] with bm: - os.system("CONFIG_FILE_PATH="+ config_file + " mpirun -oversubscribe -np 8 python3 -m memory_profiler mpirunner.py") + os.system(f"CONFIG_FILE_PATH={config_file} TEST=True mpirun -oversubscribe -np 8 python3 mpirunner.py") ## teardown os.system("rm -rf ./tests/performance/tmp_gen_output") diff --git a/utilities/conditional_decorator.py b/utilities/conditional_decorator.py new file mode 100644 index 0000000..5e0b3e8 --- /dev/null +++ b/utilities/conditional_decorator.py @@ -0,0 +1,7 @@ +def conditional_decorator(dec, condition): + def decorator(func): + if not condition: + # Return the function unchanged, not decorated. + return func + return dec(func) + return decorator \ No newline at end of file From fffbb8f24df9c5e6ee60a6268ab475ee0ce9a251 Mon Sep 17 00:00:00 2001 From: chortas Date: Mon, 29 Nov 2021 18:32:54 -0300 Subject: [PATCH 12/12] Delete travis file (it requires card now) --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dc63579..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: python -python: - - "3.8" -install: - - make install -script: - - make test \ No newline at end of file