pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2019-08-13T14:17:37+02:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/28Philox tests and clean up2019-08-13T14:17:37+02:00Michael Kuronmkuron@icp.uni-stuttgart.dePhilox tests and clean upTest the Philox against reference data and clean up duplicated code in the code generation. The latter will make it easier to later add a vectorized Philox.Test the Philox against reference data and clean up duplicated code in the code generation. The latter will make it easier to later add a vectorized Philox.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/36Pre-push hook2019-08-20T16:28:40+02:00Stephan SeitzPre-push hookThis prevents me from pushing stuff that either fails in quicktest or flake8.
Has to be copied manually to `.git/hooks` and `python3` has to be adapted to your Python executable.
~~Is there an update in flake8 that `.flake8` is not...This prevents me from pushing stuff that either fails in quicktest or flake8.
Has to be copied manually to `.git/hooks` and `python3` has to be adapted to your Python executable.
~~Is there an update in flake8 that `.flake8` is not recognized automatically anymore and that we need to append C901?~~
Probably, I installed just different linter on my PC at home. flake8 can use different linters.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/131Print actual block contents in Conditional.{__repr__,__str__}2020-01-17T16:55:16+01:00Stephan SeitzPrint actual block contents in Conditional.{__repr__,__str__}https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/357Print small integer powers as divisions/multiplications2023-10-13T08:33:59+02:00Daniel BauerPrint small integer powers as divisions/multiplicationsFixes #72.
After a longer discussion we decided to reintroduce the special logic into the printer after it was removed in 939241f2.
The problem is that it is simply impossible to keep Muls unevaluated in cut_loops.
Neither deep_copy nor...Fixes #72.
After a longer discussion we decided to reintroduce the special logic into the printer after it was removed in 939241f2.
The problem is that it is simply impossible to keep Muls unevaluated in cut_loops.
Neither deep_copy nor func(*args) works.
A logic-free printer simply goes against how SymPy works.
We can have it, but first we must switch to a SymPy free ast datastructure.Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/321Properly detect and enable vectorization on ARM2023-06-07T09:26:30+02:00Michael Kuronmkuron@icp.uni-stuttgart.deProperly detect and enable vectorization on ARM!320 has the side effect of breaking detection of SVE vectorization support and enablement of SVE in the compiler. My patch should properly fix the underlying problem.
py-cpuinfo is supported on ARM64 and can be used to detect Neon and ...!320 has the side effect of breaking detection of SVE vectorization support and enablement of SVE in the compiler. My patch should properly fix the underlying problem.
py-cpuinfo is supported on ARM64 and can be used to detect Neon and SVE. However, there was indeed a bug here -- Neon is identified as `asimd` in /proc/cpuinfo, so we should check for `asimd` instead of `neon`.
While `-march=native` was not supported by [Clang before 15](https://github.com/llvm/llvm-project/commit/955cff803e081640e149fed0742f57ae1b84db7d), `-mcpu=native` is supported by [GCC 6+](https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/AArch64-Options.html) and [Clang 7+](https://github.com/llvm-mirror/clang/commit/86c991513001535af6b82bcb1f7c45ab60d2adf0). Let's use that instead of not adding a flag at all -- otherwise SVE support is not enabled in the compiler even if the hardware supports it.Helen SchottenhammlHelen Schottenhammlhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/334Re-enable test_loop_cutting.py::test_staggered_iteration2023-06-30T08:55:41+02:00Michael Kuronmkuron@icp.uni-stuttgart.deRe-enable test_loop_cutting.py::test_staggered_iterationIt passes on current master, so don't xfail it.It passes on current master, so don't xfail it.Markus 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/162Recursively convert dictionary in DotDict2020-07-10T16:56:17+02:00Stephan SeitzRecursively convert dictionary in DotDictEverybody love `DotDict` because we are lazy. This PR recursively converts all dict into `DotDict` not only top level.
So you can do:
my_super.nested.data.scheme = 42Everybody love `DotDict` because we are lazy. This PR recursively converts all dict into `DotDict` not only top level.
So you can do:
my_super.nested.data.scheme = 42https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/341Refactor gpu indexing2023-09-04T16:53:09+02:00Markus HolzerRefactor gpu indexingTo map an iteration space to GPU Threads indexing classes are used. These indexing classes receive a field and iterations slice to determine the iteration space. This MR refactors the indexing classes to directly receive an iteration spa...To map an iteration space to GPU Threads indexing classes are used. These indexing classes receive a field and iterations slice to determine the iteration space. This MR refactors the indexing classes to directly receive an iteration space. With this, the indexing classes are more general and not dependent on pystencils Fields.
Further improvements/fixes:
- Line indexing works now with iteration slices. This did not work at all before
- Both indexing schemes calculate a correct block and grid size for iteration slices. This means if for example if only every second element is touched (due to a given iteration slice) the number of threads will be half. This removes modulo calculation that was needed before
- Both indexing schemes now support up to 4 dimensionsMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/364Refactor packaging, part I2024-01-15T14:20:27+01:00Frederik HennigRefactor packaging, part IRelates to pycodegen/pystencils#75.
Move all project info to `pyproject.toml`.
Tasks:
- [x] Static Project Info
- [x] Register and run versioneer
- [x] Register Cython extension modules
- [x] Clean up package data files & manifest
...Relates to pycodegen/pystencils#75.
Move all project info to `pyproject.toml`.
Tasks:
- [x] Static Project Info
- [x] Register and run versioneer
- [x] Register Cython extension modules
- [x] Clean up package data files & manifest
- [x] Remove `quicktest` action from `setup.py` and realize quicktests some other way -> introduced `quicktest.py`
Notes:
- The `quicktest` command in `setup.py` uses the `distutils` command interface, but `distutils` is deprecated since Python 3.10. We must find some other way to realize quicktests.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/362Refactor source tree layout2024-01-16T08:50:38+01:00Frederik HennigRefactor source tree layoutRelates to pycodegen/pystencils#75.
- [x] Migrate package to `src` directory
- [x] Migrate tests to `tests` directory and update `pytest` configuration
- [x] Fix various pipelines and CI containers
(`pyproject.toml` migration was mo...Relates to pycodegen/pystencils#75.
- [x] Migrate package to `src` directory
- [x] Migrate tests to `tests` directory and update `pytest` configuration
- [x] Fix various pipelines and CI containers
(`pyproject.toml` migration was moved to pycodegen/pystencils!364)Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/302Regression !3002022-10-10T13:37:53+02:00Markus HolzerRegression !300In !300 all written field sizes are added to the SympyAssignment as unknown parameters. This solves the problem that all field sizes need to be passed as arguments when using NT stores with non-x86 architectures. However, it introduces t...In !300 all written field sizes are added to the SympyAssignment as unknown parameters. This solves the problem that all field sizes need to be passed as arguments when using NT stores with non-x86 architectures. However, it introduces two problems.
1. In all other cases these parameters are not used. Thus waLBerla fails in some cases when compiled with -Wall. Other than that it is not nice either to pass unused parameters.
2. For the GPU code generation problems arose with the usage of `get_parameters` in waLBerla:
https://i10git.cs.fau.de/pycodegen/pystencils/-/blob/master/pystencils/astnodes.py#L244
Overall it seems that the easiest way to fix the problem is to only pass the additional size arguments when needed and in no other cases.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/93Reimplement create_staggered_kernel2020-01-14T15:46:47+01:00Michael Kuronmkuron@icp.uni-stuttgart.deReimplement create_staggered_kernel`create_staggered_kernel` now takes a list of assignments to staggered fields and otherwise behaves like `create_kernel`. I have included a diffusion equation test case in both D2Q5 and D2Q9. Putting vectorial/tensorial quantities on the...`create_staggered_kernel` now takes a list of assignments to staggered fields and otherwise behaves like `create_kernel`. I have included a diffusion equation test case in both D2Q5 and D2Q9. Putting vectorial/tensorial quantities on the staggered points also works.
This merge requests break API compatibility with the previous `create_staggered_kernel`.
Fixes #16. My next step is to implement automatic FV discretization.
Build of dependent projects (pygrandchem, pystencils_walberla) passes as per https://i10git.cs.fau.de/pycodegen/pycodegen/merge_requests/6.
Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/24Remove deprecation warning ('cachedir' parameter has been deprecated)2019-08-08T08:57:45+02:00Stephan SeitzRemove deprecation warning ('cachedir' parameter has been deprecated)Warning was:
```
/localhome/seitz_local/projects/pystencils/pystencils/cache.py:15: DeprecationWarning: The 'cachedir' parameter has been deprecated in
version 0.12 and will be removed in version 0.14.
You provided "cachedir='/local...Warning was:
```
/localhome/seitz_local/projects/pystencils/pystencils/cache.py:15: DeprecationWarning: The 'cachedir' parameter has been deprecated in
version 0.12 and will be removed in version 0.14.
You provided "cachedir='/localhome/seitz_local/.cache/pystencils'", use "location='/localhome/seitz_local/.cache/pystencils'" instead.
disk_cache = Memory(cachedir=cache_dir, verbose=False).cache
```https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/308Remove depricated feature2022-10-25T12:52:06+02:00Markus HolzerRemove depricated featureRemoves deprecated featuresRemoves deprecated featuresMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/55Remove DestructuringBindingsForFieldClass2021-08-19T20:23:23+02:00Stephan SeitzRemove DestructuringBindingsForFieldClassThere is now a superior implementation in pystencils_autodiff.
This is actually a AST Node for wrapper code. pystencils_autodiff has
now a AST printer for framework integration code. So framework AST nodes
are now there and kernel AST n...There is now a superior implementation in pystencils_autodiff.
This is actually a AST Node for wrapper code. pystencils_autodiff has
now a AST printer for framework integration code. So framework AST nodes
are now there and kernel AST nodes remain here.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/84Remove duplicated uint typedef2019-11-06T12:41:39+01:00Michael Kuronmkuron@icp.uni-stuttgart.deRemove duplicated uint typedefRunning the OpenCL test on AMD's ROCm platform results in
```
pystencils_tests/test_opencl.py::test_without_cuda
/usr/lib/python3/dist-packages/pyopencl/cffi_cl.py:1516: CompilerWarning: Built kernel retrieved from cache. Original from...Running the OpenCL test on AMD's ROCm platform results in
```
pystencils_tests/test_opencl.py::test_without_cuda
/usr/lib/python3/dist-packages/pyopencl/cffi_cl.py:1516: CompilerWarning: Built kernel retrieved from cache. Original from-source build had warnings:
Build on <pyopencl.Device 'gfx900' on 'AMD Accelerated Parallel Processing' at 0x34f0f50> succeeded, but said:
In file included from /tmp/comgr-1f94f8/input/CompileCLSource:1:
./pystencils/pystencils/include/opencl_stdint.h:4:27: warning: redefinition of typedef 'uint' is a C11 feature
typedef unsigned int uint;
^
/data/jenkins_workspace/compute-rocm-rel-2.9/out/ubuntu-16.04/16.04/srctf/ocl_lc/drivers/opencl/library/amdgcn/headers/build/lnx64a/B_rel/<stdin>:52:22: note: previous definition is here
typedef unsigned int uint;
```
According to the [specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_C.html#built-in-scalar-data-types), the `uint` type is part of the OpenCL C builtin types (and has been since version 1.0), so this typedef is not needed. In Nvidia's OpenCL stack, it appears to be built into the compiler, while LLVM (and thus AMD) define it in a [header file](https://github.com/llvm/llvm-project/blob/89de0d8dfbb9a6ff1f8b141ed70b563ecc094878/clang/lib/Headers/opencl-c.h#L55).Stephan SeitzStephan Seitzhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/14Remove floor, ceiling for integer symbols2019-08-02T22:26:37+02:00Stephan SeitzRemove floor, ceiling for integer symbols# Original Intent
Allow optimizations by SymPy when we know that a `TypedSymbol` `is_integer` or `is_real`
(e.g. drop rounding functions).
We can deduce some of those properties with Numpy's type system (https://docs.scipy.org/doc...# Original Intent
Allow optimizations by SymPy when we know that a `TypedSymbol` `is_integer` or `is_real`
(e.g. drop rounding functions).
We can deduce some of those properties with Numpy's type system (https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.scalars.html).
We have to be careful since all the `is_*` methods have ternary logic (`True`, `False`, `None`== we don't know).
Field.Access can take advantage of those optimizations by making it a subclass of `TypedSymbol`.
# Extended Changes
By writing a test I realized that it would be handy to compare `AssignmentCollection`s and use the functions `find`, `match`, `subs`, `replace` of SymPy.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/255Remove gmpy workaround2021-06-26T15:43:54+02:00Markus HolzerRemove gmpy workaroundThe gmpy workaroung is not needed anymore because this problem is fixed in smpy with https://github.com/sympy/sympy/pull/13530The gmpy workaroung is not needed anymore because this problem is fixed in smpy with https://github.com/sympy/sympy/pull/13530Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/273Remove interpolator2021-11-17T15:51:55+01:00Markus HolzerRemove interpolatorThe interpolator functionality of pystencils is not used for a long time and it is rather messy.
It will be removed with this MR.The interpolator functionality of pystencils is not used for a long time and it is rather messy.
It will be removed with this MR.Markus HolzerMarkus Holzer