Distributed assembly helpers#
Free functions in gko::experimental::distributed that help build
distributed matrices from per-rank matrix_data contributions.
assemble_rows_from_neighbors#
When each rank generates a local matrix_data independently, the
ranks may end up contributing different non-zero values to the same
global row (for example in finite-element assembly with shared
boundary nodes). This helper sums those contributions across ranks so
the result owned by each rank is the globally-assembled view of its
rows, ready to be passed to Matrix::read_distributed.
-
template<typename ValueType, typename LocalIndexType, typename GlobalIndexType>
device_matrix_data<ValueType, GlobalIndexType> gko::experimental::distributed::assemble_rows_from_neighbors( - mpi::communicator comm,
- const device_matrix_data<ValueType, GlobalIndexType> &input,
- ptr_param<const Partition<LocalIndexType, GlobalIndexType>> partition,
Assembles device_matrix_data entries owned by this MPI rank from other ranks and communicates entries located on this MPI rank owned by other ranks to their respective owners. This can be useful e.g. in a finite element code where each rank assembles a local contribution to a global system matrix and the global matrix has to be assembled by summing up the local contributions on rank boundaries. The partition used is only relevant for row ownership.
- Parameters:
comm – the communicator used to assemble the global matrix.
input – the device_matrix_data structure.
partition – the partition used to determine row owndership.
- Returns:
the globally assembled device_matrix_data structure for this MPI rank.