gridap / GridapDistributed.jl

Parallel distributed-memory version of Gridap
MIT License
103 stars 15 forks source link

Block assemblers #116

Closed JordiManyer closed 1 year ago

JordiManyer commented 1 year ago

This PR implements block assemblers, which allow to assemble a MultiFieldFESpace block-wise. It is the distributed counterpart of this other PR.

Instead of a sparse monolithic matrix and vectors, this assembler leverages BlockArrays.jl to produce equivalent block-partitioned sparse matrices and vectors. This is meant to ease the development of block preconditioners and solvers.

TODO:

Other pains/doubts about the implementation can be found in this issue.

JordiManyer commented 1 year ago

To temporarily resolve the PRange situation for ghosts, I am now dispatching assembly towards a worst algorithm that does not filter out ghost cols that are not touched. This ensures all ghost columns are present in the final PRange for all blocks.

However, this is a temporary fix to a problem that needs to be solved more elegantly. The solution, we believe, requires splitting the assembly methods _fa_create_from_nz_with_callback into functional blocks, so that we can consolidate ghosts between all blocks before assembling. This will be left until after the release of GridapDistributed v0.3, since some of the low-level functionality will change after that. Until this is fixed, block-assembled matrices will potentially be less efficient (since unnecessary ghosts values will be communicated at each matrix-vector product).

The fix is in function _fa_create_from_nz_temporary_fix, and only works for FullyAssembledRows.

JordiManyer commented 1 year ago

I am closing this, we will be merging after the new release, from the new PR #124