Changes for compatibility with pystencils 2.0
-
Review changes -
-
Download -
Patches
-
Plain diff
Patch lbmpy for compatibility with pystencils 2.0:
- Adapt code paths and naming to work with both pystencils 1.3.7 and 2.0 where possible
- Introduce (temporary) duplicate code paths where necessary
- Disable features and tests that are not yet available with pystencils 2.0
- Improve and adapt the testsuite, CI config, and packaging along the way
Changes
Compatibility Code Paths
Introduce a module lbmpy._compat
that facilitates compatibility between the divergent APIs of pystencils 1.3 and 2.0.
Mask out code paths using the IS_PYSTENCILS_2
flag where necessary.
API and Internal Changes
-
Lookup Tables: The
lbmpy.custom_code_nodes
module will be replaced by a newlbmpy.lookup_tables
, utilizing the novel capability of pystencils 2.0 to treat SymPy tuples as arrays - Boundary Conditions: Introduce explicit type casts at various points as pystencils 2.0 does not allow implicit type conversions
- Fluctuating LB: Adapted to novel API of symbolic random number generators
Testing & CI
- Introduce nox to orchestrate environments and testing
- Adapt CI to use nox sessions where applicable
- Remove
minimal_conda
andubuntu
CI tasks- Since the
pycodegen/ubuntu
docker image is based on a CUDA image, and using a virtual environment for Python, theubuntu
task effectively does the same as the Nox+CUDA task
- Since the
- Introduce nox session and CI task to test against pystencils/v2.0-dev
Unavailable Features
The following features will be temporarily unavailable until the underlying systems are either reintroduced in pystencils 2.0, or they can be reimplemented on top of 2.0's novel APIs:
- Loop Splitting (not supported by 2.0 yet)
- In-kernel-boundaries (depend on conditional branches, which have no representation in the 2.0 frontend yet)
- PSM Update Rule with Conditionals (same, depends on conditional branches)
- Oldroyd-B (uses staggered fields, which cannot be handled by the 2.0 backend yet)
- Allen-Cahn contact angle computation (needs conditionals)
Status
-
Fix field duplication in create_lb_update_rule
: Remove the workaround once field duplication is fixed in pystencils -
Data types in boundary handling: LatticeBoltzmannBoundaryHandling
does not allow to specify a data type and always usesfloat64
. This leads to type errors when combined with LB fields withfloat32
dtype. -
Mixed precision: Need to explicitly insert casts at field reads/writes when computing and storing PDFs in different float formats -
Test failures with fluctuating LB and sparse LB: Fixed with pystencils!481 (merged) and pystencils!482 (merged), respectively
Edited by Frederik Hennig
Merge request reports
Compare and
- version 37a6ad078c
- version 36eacaefe9
- version 3592c1f02c
- version 340fc0b52a
- version 33a8d50d5c
- version 3268339921
- version 3100e82268
- version 305bb9486f
- version 29102c3287
- version 288c0dc06d
- version 273058e2e0
- version 26676bc8a3
- version 259bfd88f9
- version 246ea1c7b1
- version 235672e4f3
- version 2265ec24f6
- version 216faa380d
- version 20f07d42b7
- version 19a2a08c23
- version 18e1d24200
- version 17332924e9
- version 16337734d3
- version 1590dd7ef7
- version 14fc55949d
- version 137d1a1de8
- version 124371098b
- version 11b77720ed
- version 10902584c2
- version 9c1c40069
- version 83962799b
- version 77f6f3a57
- version 61c721028
- version 5a31551ca
- version 4a2cf1e3e
- version 32b7af25e
- version 232d0f124
- version 191688bb2
- master (base)
- latest versionf13cfc8d43 commits,
- version 37a6ad078c42 commits,
- version 36eacaefe940 commits,
- version 3592c1f02c39 commits,
- version 340fc0b52a38 commits,
- version 33a8d50d5c37 commits,
- version 326833992136 commits,
- version 3100e8226835 commits,
- version 305bb9486f33 commits,
- version 29102c328732 commits,
- version 288c0dc06d31 commits,
- version 273058e2e030 commits,
- version 26676bc8a329 commits,
- version 259bfd88f928 commits,
- version 246ea1c7b127 commits,
- version 235672e4f326 commits,
- version 2265ec24f625 commits,
- version 216faa380d24 commits,
- version 20f07d42b723 commits,
- version 19a2a08c2322 commits,
- version 18e1d2420020 commits,
- version 17332924e919 commits,
- version 16337734d318 commits,
- version 1590dd7ef717 commits,
- version 14fc55949d15 commits,
- version 137d1a1de814 commits,
- version 124371098b13 commits,
- version 11b77720ed12 commits,
- version 10902584c211 commits,
- version 9c1c400699 commits,
- version 83962799b8 commits,
- version 77f6f3a577 commits,
- version 61c7210286 commits,
- version 5a31551ca5 commits,
- version 4a2cf1e3e4 commits,
- version 32b7af25e3 commits,
- version 232d0f1242 commits,
- version 191688bb21 commit,
Compare changes
- Side-by-side
- Inline
Files
41Loading