diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc53eea36eb16cccb33006b4d6bf4eb669ab2fb8..f3a10cc136e37947d7307b05f38720a37a8af1b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -93,6 +93,39 @@ minimal-conda: tags: - docker +pycodegen-integration: + image: i10git.cs.fau.de:5005/pycodegen/pycodegen/full + stage: test + when: manual + script: + # run lbmpy long test pipeline + - export NUM_CORES=$(nproc --all) + - mkdir -p ~/.config/matplotlib + - echo "backend:template" > ~/.config/matplotlib/matplotlibrc + - pip install git+https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pystencils.git@master#egg=pystencils + - py.test -v -n $NUM_CORES --cov-report html --cov-report term --cov=. + # change path to outside of lbmpy and call pip to set the environment variable right + - cd .. + - pip install -e lbmpy + # fetch pycodegen repository with waLberla as submodule and install waLBerla to run the integration tests + - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@i10git.cs.fau.de/pycodegen/pycodegen.git + - cd pycodegen + - git submodule sync --recursive + - git submodule update --init --recursive + - git submodule foreach git fetch origin # compare the latest master version! + - git submodule foreach git reset --hard origin/master + - ./install_walberla.sh + # build all integration tests + - cd walberla/build/ + - make -j $NUM_CORES CodegenJacobiCPU CodegenJacobiGPU CodegenPoisson MicroBenchmarkGpuLbm LbCodeGenerationExample + - cd apps/benchmarks/UniformGridGPU + - make -j $NUM_CORES + - cd ../UniformGridGenerated + - make -j $NUM_CORES + tags: + - docker + - cuda + - AVX # -------------------- Linter & Documentation -------------------------------------------------------------------------- diff --git a/lbmpy/creationfunctions.py b/lbmpy/creationfunctions.py index dfdd5c4c2c5dbd246d24a112a52089f3c4f4909e..4eca94b03d4db460eda7dfecd5d5e29555c909b8 100644 --- a/lbmpy/creationfunctions.py +++ b/lbmpy/creationfunctions.py @@ -322,20 +322,6 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs): else: collision_rule = lb_method.get_collision_rule(keep_rrs_symbolic=keep_rrs_symbolic) - if params['output'] and params['kernel_type'] == 'stream_pull_collide': - cqc = lb_method.conserved_quantity_computation - output_eqs = cqc.output_equations_from_pdfs(lb_method.pre_collision_pdf_symbols, params['output']) - collision_rule = collision_rule.new_merged(output_eqs) - - if opt_params['simplification'] == 'auto': - simplification = create_simplification_strategy(lb_method, split_inner_loop=split_inner_loop) - else: - simplification = opt_params['simplification'] - collision_rule = simplification(collision_rule) - - if params['fluctuating']: - add_fluctuations_to_collision_rule(collision_rule, **params['fluctuating']) - if params['entropic']: if params['smagorinsky']: raise ValueError("Choose either entropic or smagorinsky") @@ -355,6 +341,20 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs): if 'split_groups' in collision_rule.simplification_hints: collision_rule.simplification_hints['split_groups'][0].append(sp.Symbol("smagorinsky_omega")) + if params['output'] and params['kernel_type'] == 'stream_pull_collide': + cqc = lb_method.conserved_quantity_computation + output_eqs = cqc.output_equations_from_pdfs(lb_method.pre_collision_pdf_symbols, params['output']) + collision_rule = collision_rule.new_merged(output_eqs) + + if opt_params['simplification'] == 'auto': + simplification = create_simplification_strategy(lb_method, split_inner_loop=split_inner_loop) + else: + simplification = opt_params['simplification'] + collision_rule = simplification(collision_rule) + + if params['fluctuating']: + add_fluctuations_to_collision_rule(collision_rule, **params['fluctuating']) + cse_pdfs = False if 'cse_pdfs' not in opt_params else opt_params['cse_pdfs'] cse_global = False if 'cse_global' not in opt_params else opt_params['cse_global'] if cse_pdfs: diff --git a/lbmpy_tests/test_split_optimization.py b/lbmpy_tests/test_split_optimization.py index 821d6868f5dfbddc7e09aeb29a12643729c8133f..89e73133c487b37af3716a956911d7f46af2ae87 100644 --- a/lbmpy_tests/test_split_optimization.py +++ b/lbmpy_tests/test_split_optimization.py @@ -4,6 +4,7 @@ import pytest from lbmpy.creationfunctions import create_lb_ast from lbmpy.scenarios import create_lid_driven_cavity from pystencils.sympyextensions import count_operations_in_ast +from sympy.core.cache import clear_cache def test_split_number_of_operations(): @@ -35,6 +36,7 @@ def test_equivalence(): for compressible in (True, False): for method in ('srt', 'mrt'): for force in ((0, 0, 0), (1e-6, 1e-7, 2e-6)): + clear_cache() common_params = {'domain_size': (20, 30) if stencil.startswith('D2') else (10, 13, 7), 'stencil': stencil, 'method': method,