Skip to content

Conversation

@max-models
Copy link
Member

Small change: set the install branch for struphy to devel in the CI. This can be merged after https://gitlab.mpcdf.mpg.de/struphy/struphy/-/merge_requests/678 has been merged.

yguclu and others added 30 commits April 2, 2025 15:18
Closes pyccel#476:

* Do not restrict the maximum Python version to 3.12 in `pyproject.toml`
* Require `Cython >= 3` to avoid `h5py` installation crash w/ Python 3.13
* Require `sympde == 0.19.2` which supports Python 3.13
* Run unit tests with Python 3.13 too
Currently, Psydac can not be used on Apple M4 computers since the
`PSYDAC_BACKEND_GPYCCEL['flags']` is not set correctly.

This change sets the flag for `Apple MX (etc.)` to `apple-mX`, which should
work so long as the naming scheme stays unchanged.

In addition, the regular expression used to find the GFortran version is now
defined in a raw string instead of a standard Python UTF8 string. This
avoids a `SyntaxWarning: invalid escape sequence`.

---------

Co-authored-by: Yaman Güçlü <[email protected]>
* Use raw strings for docstrings with LaTeX to avoid UTF8 syntax
warnings on escape sequences;
* Use CSC matrices to avoid SciPy sparse solver warning.

We do not address the NumPy warnings which arise in our MPI unit tests
(see pyccel#353).
…yccel#484)

Main changes
--------------
* Rename the method `dot` of the base class `VectorSpace` as `inner`,
and make it an abstract method (which must be implemented by the
subclasses).

* Rename the method `dot` of the base class `Vector` as `inner`. This is
a concrete method which calls `self.space.inner` and does not need to be
overridden by the subclasses.

* Add `inner` methods to the classes `StencilVector`,
`BlockVectorSpace`, and `DenseVectorSpace`. These methods override the
abstract method of the base class as required, and are derived from the
former functions `Stencil.dot`, `BlockVector.dot`, and
`DenseVector.dot`, which have been removed (see next point).

* Remove the property `dtype` and the method `dot` (now `inner`) from
the classes `StencilVector`, `BlockVector`, and `DenseVector`, because
the default methods of the base class already provide a sufficient
implementation.

This fixes pyccel#330.

Necessary additional changes
------------------------------
* Update all linear solvers in `linalg.solvers` with the new method
calls;
* Update all unit tests with the new method calls, in files:
   - `api/tests/test_assembly.py`
   - `feec/tests/test_commuting_projections.py`
   - `feec/tests/test_global_projectors.py`
   - `linalg/tests/test_block.py`
   - `linalg/tests/test_linalg.py`
   - `linalg/tests/test_stencil_interface_matrix.py`
   - `linalg/tests/test_stencil_vector.py`

Unrelated additional changes
-----------------------------
* Rename the class `VectorDot` as `VectorInner` in module
`api.ast.linalg`, although never used in Psydac.
* Speed up 3D unit tests in:
   - `feec/tests/test_commuting_projectors.py`
   - `feec/tests/test_global_projectors.py`
…yccel#493)

Implement `M.dot(u).inner(v)`, or `(M @ u).inner(v)`, without creating a
temporary vector. The result of the dot product is written to a local
work vector stored in the `LinearOperator` object. This work vector is
then used to compute the inner product with the vector `v`. The
subclasses do not need to override this method, unless a more efficient
implementation which avoids writing to the work vector altogether
(reducing memory pressure) is needed.

A unit test is added: function `test_dot_inner` in file
psydac/linalg/tests/test_linalg.py.

Additionally, the helper function `get_StencilVectorSpace` defined in
psydac/linalg/tests/test_linalg.py (only used in the same file and in
test_matrix_free.py) has a new signature and now works in any number of
dimensions.

Fixes pyccel#491.
…t stay because STL doesn't allow for shape 0 arrays. Now we only call the matmul kernel if the shape is not 0, otherwise c[:] = 0.0
@spossann
Copy link
Member

spossann commented Jul 1, 2025

Has been changes in #38

@spossann spossann closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants