pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2022-07-02T16:37:48+02:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/297Compatibility with latest RISCV64 and ARM CI image2022-07-02T16:37:48+02:00Michael Kuronmkuron@icp.uni-stuttgart.deCompatibility with latest RISCV64 and ARM CI imageFollow-up to 1022af9835d84740bec3fb5c8136f19a21d78595 after upgrading to the latest compilers. ARM SVE also appears stable on latest Clang without weird workarounds now.
Depends on https://i10git.cs.fau.de/pycodegen/pycodegen/-/merge_re...Follow-up to 1022af9835d84740bec3fb5c8136f19a21d78595 after upgrading to the latest compilers. ARM SVE also appears stable on latest Clang without weird workarounds now.
Depends on https://i10git.cs.fau.de/pycodegen/pycodegen/-/merge_requests/15Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/296Gpu block size2022-07-01T12:12:41+02:00Markus HolzerGpu block sizeIf the Assignments act on 2D fields but 3 GPU indexing parameters are provided, an error occurs. With this MR the third parameter is fixed to 1If the Assignments act on 2D fields but 3 GPU indexing parameters are provided, an error occurs. With this MR the third parameter is fixed to 1Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/295Revision32022-05-23T17:28:23+02:00Markus HolzerRevision3More revisions due to !292More revisions due to !292Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/294Revision22022-05-23T14:33:55+02:00Markus HolzerRevision2More revisions for !292More revisions for !292Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/293Revisions2022-05-25T10:19:33+02:00Markus HolzerRevisionsRevisions for !292Revisions for !292Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/292Rebase of pystencils Type System2022-12-06T10:23:14+01:00Markus HolzerRebase of pystencils Type SystemFixes #20
Complex numbers are not supported anymoreFixes #20
Complex numbers are not supported anymoreRelease 1.0Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/291Fix test_alignment_of_different_layouts on architectures with 128-bit vectors2022-04-28T09:46:38+02:00Michael Kuronmkuron@icp.uni-stuttgart.deFix test_alignment_of_different_layouts on architectures with 128-bit vectorsThis test previously failed on ARM Neon (and probably also on SSE) because the test checks for 256-bit alignment, but only requests `alignment=True`, which is the maximum required by the hardware (i.e. to `align=32` on AVX, but only `ali...This test previously failed on ARM Neon (and probably also on SSE) because the test checks for 256-bit alignment, but only requests `alignment=True`, which is the maximum required by the hardware (i.e. to `align=32` on AVX, but only `align=16` on SSE/Neon).Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/290Bug fix simplification2022-03-28T10:40:33+02:00Markus HolzerBug fix simplificationMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/289SymPy1.102022-03-21T19:42:55+01:00Markus HolzerSymPy1.10With Sympy 1.10 two small problems have entered pystencils. This MR fixes the problems.
Fixes #59With Sympy 1.10 two small problems have entered pystencils. This MR fixes the problems.
Fixes #59Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/288Fix: AssignmentCollection's `new_filtered` now also finds dependencies in mai...2022-03-25T09:14:17+01:00Frederik HennigFix: AssignmentCollection's `new_filtered` now also finds dependencies in main assignmentsFixes a bug where `AssignmentCollection.new_filtered` would not catch symbol dependencies on LHS symbols of main assignments.Fixes a bug where `AssignmentCollection.new_filtered` would not catch symbol dependencies on LHS symbols of main assignments.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/287Fix: sharedmethodcache didn't preserve docstrings2022-03-25T09:11:34+01:00Frederik HennigFix: sharedmethodcache didn't preserve docstringsAdded the `@wraps` decorator to the recently introduced `sharedmethodcache` to have it preserve docstrings.Added the `@wraps` decorator to the recently introduced `sharedmethodcache` to have it preserve docstrings.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/286Added simplify_by_equality2022-03-16T10:20:12+01:00Frederik HennigAdded simplify_by_equalityAdded a simplification function to simplify expressions using a given equality $`a = b + c`$, by replacing occurences of e.g. $`b + c`$ by $`a`$, or $`a - b`$ by $`c`$.Added a simplification function to simplify expressions using a given equality $`a = b + c`$, by replacing occurences of e.g. $`b + c`$ by $`a`$, or $`a - b`$ by $`c`$.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/285sharedmethodcache2022-03-16T10:20:00+01:00Frederik HennigsharedmethodcacheAdded a per-instance method cache decorator, which can be shared among multiple methods with the same signature.
`sharedmethodcache` allows memoization similarily to `functools.cache`, but for instance methods of classes. The cache dict...Added a per-instance method cache decorator, which can be shared among multiple methods with the same signature.
`sharedmethodcache` allows memoization similarily to `functools.cache`, but for instance methods of classes. The cache dictionary is added as a member to the method's owning instance. Further, multiple methods with the same signature (up to kwargs) may use the same cache dict by specifying the same `cache_id`. This makes sense for methods that produce the same results on identical inputs, but by different computational paths.
This decorator is currently employed in pycodegen/lbmpy!113 by [abstract_equilibrium.py](https://i10git.cs.fau.de/da15siwa/lbmpy/-/blob/zero_centered_storage/lbmpy/equilibrium/abstract_equilibrium.py), but surely, more use cases will follow.
Example:
```
class Fib:
def __init__(self):
self.fib_rec_called = 0
self.fib_iter_called = 0
@sharedmethodcache("fib_cache")
def fib_rec(self, n):
self.fib_rec_called += 1
return 1 if n <= 1 else self.fib_rec(n-1) + self.fib_rec(n-2)
@sharedmethodcache("fib_cache")
def fib_iter(self, n):
self.fib_iter_called += 1
f1, f2 = 0, 1
for i in range(n):
f2 = f1 + f2
f1 = f2 - f1
return f2
>>> fib = Fib()
>>> fib.fib_rec(13)
377
>>> fib.fib_cache
{(1,): 1,
(0,): 1,
(2,): 2,
(3,): 3,
(4,): 5,
(5,): 8,
(6,): 13,
(7,): 21,
(8,): 34,
(9,): 55,
(10,): 89,
(11,): 144,
(12,): 233,
(13,): 377}
>>> fib.fib_rec_called
14
>>> fib.fib_iter(11)
144
>>> fib.fib_iter_called
0
```https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/284Fvm testcase with fluctuations and reactions2022-01-10T15:10:04+01:00itischlerFvm testcase with fluctuations and reactionsAdded a fluctuation testcase and a reaction testcase to the FVM.
Fixes #36Added a fluctuation testcase and a reaction testcase to the FVM.
Fixes #36Michael Kuronmkuron@icp.uni-stuttgart.deMichael Kuronmkuron@icp.uni-stuttgart.dehttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/282Fix RoundOff problems2021-12-21T11:12:54+01:00Markus HolzerFix RoundOff problemsWhen printing Rationals with pystencils at the moment the number of digits which will be printed is only 15. This is not enough for DP and thus Error is introduced in the printed code...
The reason for this is the following line:
`str(e...When printing Rationals with pystencils at the moment the number of digits which will be printed is only 15. This is not enough for DP and thus Error is introduced in the printed code...
The reason for this is the following line:
`str(expr.evalf().num)`
Here it is important to know what is happening. First of all the Rational is evaluated with Sympy with 15 digits, because SymPy defaults to 15 digits when using `evalf`:
https://docs.sympy.org/latest/modules/evalf.html
but the story continues: `.num` is not a SymPy function !!!!
This comes from `mpmath` so the Rational is converted to an `sp.Float` and then to a `mpmath.ctx_mp_python.mpf`. And yet again `mpmath` provides also a notion of precision. This could be set with `mpmath.mp.dps = 30` for example. However, why should this be done in that way here anyway?
In this MR the `.num` function is removed and all `evalf` functions in `pystencils` are set to `evalf(17)`.
Note here that the `SymPy` printer on the other hand knows very well which precision it needs to provide. Thus when using a float inside the Assignment SymPy prints this correctly.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/281Adapt CI to updated riscv64 dockerfile2021-12-04T10:30:38+01:00Michael Kuronmkuron@icp.uni-stuttgart.deAdapt CI to updated riscv64 dockerfilehttps://i10git.cs.fau.de/pycodegen/pycodegen/-/commit/99a77506972607cc315bacbd63dfcaa4b8112cda updated Clang from 13-dev to 13.0.0, switched from Debian sid to Ubuntu 21.10, and updated from version 7 to [version 10](https://github.com/s...https://i10git.cs.fau.de/pycodegen/pycodegen/-/commit/99a77506972607cc315bacbd63dfcaa4b8112cda updated Clang from 13-dev to 13.0.0, switched from Debian sid to Ubuntu 21.10, and updated from version 7 to [version 10](https://github.com/sifive/qemu/tree/rvv-1.0-upstream-v10) of the RVV QEMU patch. Now the vector extension is no longer marked as experimental (`x-`).Michael Kuronmkuron@icp.uni-stuttgart.deMichael Kuronmkuron@icp.uni-stuttgart.dehttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/280Fixed test for sliced iteration with buffer to use dynamic field sizes2021-11-28T16:19:50+01:00Frederik HennigFixed test for sliced iteration with buffer to use dynamic field sizesOtherwise the test did not fail as it should when float-division is used in indexing.Otherwise the test did not fail as it should when float-division is used in indexing.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/279Removed kerncraft2021-11-25T12:34:57+01:00Markus HolzerRemoved kerncraftKerncraft was not validated in pystencils and is at the moment not further maintained. Thus we remove it for now from pystencils.
Fixes #44Kerncraft was not validated in pystencils and is at the moment not further maintained. Thus we remove it for now from pystencils.
Fixes #44Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/278Removed OpenCL2021-11-22T21:22:54+01:00Markus HolzerRemoved OpenCLThis MR removes OpenCL from pystencilsThis MR removes OpenCL from pystencilsMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/277create_staggered_kernel: ignore inapplicable CreateKernelConfig defaults2021-11-25T12:39:39+01:00Michael Kuronmkuron@icp.uni-stuttgart.decreate_staggered_kernel: ignore inapplicable CreateKernelConfig defaultsI think this was a regression introduced in !261.I think this was a regression introduced in !261.Markus HolzerMarkus Holzer