Skip to content

Conversation

@spossann
Copy link
Member

No description provided.

yguclu and others added 15 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.
This PR changes the code generation involved in the `discretize`
function to avoid calculating unnecessary derivatives. This allows for
using constant spline (degree 0) discretizations, for which we have to
make a special case in the calculation of ghost regions in
`psydac/linalg/stencil.py`.

Additionally, we add basic unit tests checking discretizations using
zero-degree splines.

This fixes pyccel#489 and fixes pyccel#307.

On this occasion, we also do small changes in the
`.github/workflows/testing.yml` script as some tests had complications
without them.

---------

Co-authored-by: Yaman Güçlü <[email protected]>
Always use the maximum padding between test and trial spaces in
`allocate_matrices` in `DiscreteBilinearForm`. (Earlier this was not
done in the case of scalar spaces.) Fixes pyccel#504.
Pyccel 2.0 was just released, which means some of the kernels in Psydac
need to be updated:

- Remove the `template` decorator (see
pyccel/pyccel#2331)
   * Add `T` as `TypeVar` 
   * Specify `T`, `T[:]`, `T[:,:]`, ... in function arguments.
- Replace `@types` decorators (see
pyccel/pyccel#2329)
- Replace `const` with `Final` (see
pyccel/pyccel#2340)

Further changes:

- Update import path for `epyccel` (fixes pyccel#426)
- Update arguments to `epyccel` (see
pyccel/pyccel#2348):
    * Rename `fflags` to `flags`
    * Replace `accelerators` list with `openmp` bool
- Require Pyccel >= 2.0.1 (fixes pyccel#471)

---------

Co-authored-by: Yaman Güçlü <[email protected]>
Co-authored-by: Elena Moral Sánchez <[email protected]>
Co-authored-by: Emily Bourne <[email protected]>
@spossann spossann merged commit ca72a50 into devel-tiny Jun 30, 2025
18 checks passed
@spossann spossann mentioned this pull request Jul 1, 2025
@max-models max-models deleted the rebase-devel-tiny branch July 7, 2025 09:37
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