Open rrsettgast opened 3 years ago
It would be nice to better encapsulate our current assembly pattern, which is pretty raw, e.g.
Proposed cleanup Remove all of these functions. We should just be using CRSMatrix objects and creating these objects from CRSMatrix. We can then focus on getting a shallow copy from CRSMatrix to the derived classes of MatrixBase.
For the hypre interface I would push the cleanup even further. The proposed changes are removing the need for the IJ layer. I think we can redesign the interface manipulating directly the low level hypre_ParCSRMatrix
object - which is what we already do in plenty of methods.
This method in mfem
(link) is a good example for what has to change in the current create()
method:
This effort may require a dedicated PR.
Describe the issue The LAI objects have
set/insert/add
interface functions that take values, pointers, and arrayslice. This either requires the interface function to copy the data and move it to the correct memory space, or it requires the caller to manage the memory motion rather than allowing the interface functions to manage the memory motion as part of their responsibility. For example,MatrixBase
contains the following interface functions:These are single point interface functions. They are very inefficient, and require that the interface function copy the data, then move it to the correct memory space. These should be removed.
These are data insertions for a single row. Pointers/arraySlice make this interface hard to manage memory motion.
Dense data insertions. These are not as bad since they should be launched inside a kernel...but they are not
__device__
callable.Proposed cleanup Remove all of these functions. We should just be using
CRSMatrix
objects and creating these objects fromCRSMatrix
. We can then focus on getting a shallow copy fromCRSMatrix
to the derived classes ofMatrixBase
.