Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend to_dense for parallel use cases #3354

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

schnellerhase
Copy link
Contributor

The (debug) functionality to_dense of the CSR matrix is extended to support the usage in parallel scenarios.

Before it returned the local-local block of the matrix (which in sequential is the whole matrix), i.e. the interaction between local rows and local cols.

In parallel runs, this drops quite a lot of information, especially we loose all interactions across processes. This is now changed, to to_dense returning the full/global dense rows that are owned by the process. This means the previous behavior is still reproducible by filtering for the columns of choice, but if needed the full parallel block is now available in a dense format.

This will be needed to allow for a PR regarding the transfer operators of a multigrid implementation - see here for an example of this use case.

@schnellerhase schnellerhase changed the title to_dense extended for parallel use cases Extend to_dense for parallel use cases Aug 19, 2024
cpp/test/matrix.cpp Outdated Show resolved Hide resolved
@schnellerhase
Copy link
Contributor Author

Need to include this in another PR, so I'll squash

Previously only the diagonal (local-to-local) interaction block of the CSR matrix was outputted,
this is extended to the complete locally owned row structure, allowing for paralell debugging.

When run in sequential the behavior of `to_dense` is not altered

Extend  test case for parallel to dense usage

Adapt  export

Adapt test

Apply suggestion
@chrisrichardson chrisrichardson added this pull request to the merge queue Aug 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Aug 27, 2024
auto-merge was automatically disabled August 28, 2024 08:21

Head branch was pushed to by a user without write access

@garth-wells garth-wells added this pull request to the merge queue Sep 6, 2024
Merged via the queue into FEniCS:main with commit bf2aa96 Sep 6, 2024
14 of 15 checks passed
schnellerhase added a commit to schnellerhase/dolfinx that referenced this pull request Sep 11, 2024
* Add parallel support to `to_dense`

Previously only the diagonal (local-to-local) interaction block of the CSR matrix was outputted,
this is extended to the complete locally owned row structure, allowing for paralell debugging.

When run in sequential the behavior of `to_dense` is not altered

Extend  test case for parallel to dense usage

Adapt  export

Adapt test

Apply suggestion

* Switch to array instead of vector

* Make use of new insert function

---------

Co-authored-by: Chris Richardson <chris@bpi.cam.ac.uk>
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.

4 participants