diff --git a/apps/benchmarks/FluidParticleCoupling/GeneratedLBM.py b/apps/benchmarks/FluidParticleCoupling/GeneratedLBM.py index e9ecd8375b583c1e40965c5f570183e9a5fdebbc..7992bcdd92bbbbd99cd4a3ad9a948dbcd8eb7e8d 100644 --- a/apps/benchmarks/FluidParticleCoupling/GeneratedLBM.py +++ b/apps/benchmarks/FluidParticleCoupling/GeneratedLBM.py @@ -10,6 +10,7 @@ from lbmpy.stencils import get_stencil with CodeGeneration() as ctx: + omegaVisc = sp.Symbol("omega_visc") omegaBulk = ps.fields("omega_bulk: [3D]", layout='fzyx') omegaMagic = sp.Symbol("omega_magic") @@ -37,8 +38,8 @@ with CodeGeneration() as ctx: #print(methodWithForce.relaxation_rates) #print(methodWithForce.moment_matrix) - collision_rule = create_lb_collision_rule(lb_method=methodWithForce) - generate_lattice_model(ctx, 'GeneratedLBM', collision_rule) + collision_rule = create_lb_collision_rule(lb_method=methodWithForce, optimization={'cse_global': True}) + generate_lattice_model(ctx, 'GeneratedLBM', collision_rule, field_layout='fzyx') diff --git a/apps/benchmarks/FluidParticleCoupling/GeneratedLBMWithForce.py b/apps/benchmarks/FluidParticleCoupling/GeneratedLBMWithForce.py index c63157fdab56e999fbd75fd818f95ddbc3c5a35e..9162d1cfeb55b6f850292ea3ce7fa6edac6c5aef 100644 --- a/apps/benchmarks/FluidParticleCoupling/GeneratedLBMWithForce.py +++ b/apps/benchmarks/FluidParticleCoupling/GeneratedLBMWithForce.py @@ -41,5 +41,5 @@ with CodeGeneration() as ctx: #print(methodWithForce.relaxation_rates) #print(methodWithForce.moment_matrix) - collision_rule = create_lb_collision_rule(lb_method=methodWithForce) - generate_lattice_model(ctx, 'GeneratedLBMWithForce', collision_rule) + collision_rule = create_lb_collision_rule(lb_method=methodWithForce, optimization={'cse_global': True}) + generate_lattice_model(ctx, 'GeneratedLBMWithForce', collision_rule, field_layout='fzyx') diff --git a/python/pystencils_walberla/codegen.py b/python/pystencils_walberla/codegen.py index d73b502c570f23d049224588fc66dc9e6e4024f6..7b94dc95548468a217d4ddcfb73b4f9aa072d32b 100644 --- a/python/pystencils_walberla/codegen.py +++ b/python/pystencils_walberla/codegen.py @@ -1,3 +1,4 @@ +import warnings from collections import OrderedDict, defaultdict from itertools import product from typing import Dict, Optional, Sequence, Tuple @@ -331,8 +332,9 @@ def get_vectorize_instruction_set(generation_context): if generation_context.optimize_for_localhost: supported_instruction_sets = get_supported_instruction_sets() if supported_instruction_sets: - return get_supported_instruction_sets()[-1] + return supported_instruction_sets[-1] else: # if cpuinfo package is not installed + warnings.warn("Could not obtain supported vectorization instruction sets - defaulting to sse") return 'sse' else: return None diff --git a/tests/lbm/codegen/FieldLayoutAndVectorizationTest.py b/tests/lbm/codegen/FieldLayoutAndVectorizationTest.py index 1bd424e793e86e4fbf8d5151c5d55038fd15fba8..5e43eee556cbb985a524201565bc4a0abfd1b73b 100644 --- a/tests/lbm/codegen/FieldLayoutAndVectorizationTest.py +++ b/tests/lbm/codegen/FieldLayoutAndVectorizationTest.py @@ -22,3 +22,4 @@ with CodeGeneration() as ctx: for conf in configurations: generate_lattice_model(ctx, 'FieldLayoutAndVectorizationTest_'+conf.name+'_LatticeModel', collision_rule, field_layout=conf.field_layout, refinement_scaling=None, cpu_vectorize_info=conf.vectorization_dict) + diff --git a/tests/lbm/codegen/FluctuatingMRT.py b/tests/lbm/codegen/FluctuatingMRT.py index f6b0074f27e6dee6e38c4828eb3161146e67de98..a5ffa9bafb0c998bec3908f88d89ce0c463519b5 100644 --- a/tests/lbm/codegen/FluctuatingMRT.py +++ b/tests/lbm/codegen/FluctuatingMRT.py @@ -9,7 +9,7 @@ from lbmpy_walberla import generate_lattice_model with CodeGeneration() as ctx: omega_shear = sp.symbols("omega_shear") temperature = sp.symbols("temperature") - force_field, vel_field = ps.fields("force(3), velocity(3): [3D]", layout='fzyx') + force_field, vel_field = ps.fields("force(3), velocity(3): [3D]", layout='zyxf') def rr_getter(moment_group): is_shear = [is_shear_moment(m, 3) for m in moment_group] diff --git a/tests/lbm/codegen/LbCodeGenerationExample.py b/tests/lbm/codegen/LbCodeGenerationExample.py index 67aed714ee565b149adc0aacd0f5f07c8eb5e054..259a9787e017e9d44d0150aa3816f646403bcb0f 100644 --- a/tests/lbm/codegen/LbCodeGenerationExample.py +++ b/tests/lbm/codegen/LbCodeGenerationExample.py @@ -7,7 +7,7 @@ from lbmpy_walberla import RefinementScaling, generate_boundary, generate_lattic with CodeGeneration() as ctx: omega, omega_free = sp.symbols("omega, omega_free") - force_field, vel_field, omega_out = ps.fields("force(3), velocity(3), omega_out: [3D]", layout='fzyx') + force_field, vel_field, omega_out = ps.fields("force(3), velocity(3), omega_out: [3D]", layout='zyxf') # the collision rule of the LB method where the some advanced features collision_rule = create_lb_collision_rule(