[Trilinos-Users] SparseMultiVector

Heroux, Mike MHeroux at CSBSJU.EDU
Sat Aug 20 13:34:48 EDT 2016


Both Epetra and Tpetra provide some functionality in this area:

Epetra: https://trilinos.org/docs/dev/packages/epetraext/doc/html/classEpetraExt_1_1MatrixMatrix.html 
Tpetra: https://trilinos.org/docs/dev/packages/tpetra/doc/html/namespaceTpetra_1_1MatrixMatrix.html 

These operations work with the transpose, or non-transpose, of a matrix, so I would suggest storing U by columns so you can easily work with them.

If you want to override the sparse linear operator apply (aka, SpMV), both Epetra and Tpetra have an Operator interface that you can write an adapter for.  

Epetra: https://trilinos.org/docs/dev/packages/epetra/doc/html/classEpetra__Operator.html 
Tpetra: https://trilinos.org/docs/dev/packages/tpetra/doc/html/classTpetra_1_1Operator.html 

There is also a RowMatrix interface, which supports access matrix entries row-by-row.

Epetra: https://trilinos.org/docs/dev/packages/epetra/doc/html/classEpetra__RowMatrix.html 
Tpetra: https://trilinos.org/docs/dev/packages/tpetra/doc/html/classTpetra_1_1RowMatrix.html 

In order to create a dense+sparse multivector, you would need to derive from the standard multivector class and add new attributes, and override some of the methods that were most important for you.


On 8/20/16, 12:00 PM, "Denis Davydov" <davydden at gmail.com> wrote:

    Hi Mike,
    Thank you for the prompt reply. A have a few follow-up questions related to the two options you suggested:
    1.1. Where can I see a list of functions for sparse-sparse matrix operations for Tpetra and Epetra?
    1.2. If I have a sparse matrix M and a sparse multivector U implemented using another sparse-matrix,
    i would need store R = M U in the same sparsity as U, which is of course not exact.
    Is it the default behaviour for sparse-sparse matrix operations when R and U are initialized with the same sparsity pattern?
    1.3. I suppose i would be able to get access to individual columns of the sparse matrix U? 
    2.1. Keeping a dense multivector, but overriding multiplications in such a way that they exploit sparsity
    would probably be even easier for me to adopt. Are there any tutorials or documentation / reports related to
    Inversion of Control which you could recommend to read so that I get a better idea what this is
    and how could I adopt it to sparse-matrix multi-vector operations?
    Thanks in advance,
    > On 20 Aug 2016, at 17:27, Heroux, Mike <MHeroux at CSBSJU.EDU> wrote:
    > Denis,
    > There is nothing in the core capabilities of Trilinos for this kind of operation as far as I know, although there is always new development so someone might chime in with something new.
    > A few comments:
    > - This kind of feature has been discussed many times, but the need has never reached the urgency to make it on our list of things to do.
    > - In iterative solvers, even if the original multivectors start as sparse, subsequent computations fill in the zero values, so for the bulk of Trilinos solvers, sparseness quickly disappears.
    > - In many cases, using the Inversion of Control capabilities of Trilinos (the ability to define your own matrix operations, in particular) can be used to develop customized code that can exploit sparsity in a way that uses special knowledge of your problem.  This might be a good option for your case.  You would still have to keep the dense multivector if you want to use intrinsic Trilinos operations, but you could track the nonzeros using metadata and use only those values when executing your custom kernels.
    > - One other approach: The multivector could be kept as a sparse matrix (CrsMatrix, for example).  If you store it as a sparse matrix, you can do the operations you list as sparse-sparse matrix operations.  Also, as a sparse matrix, there is also better control over load balancing via sparse matrix partitioning tools.
    > I hope this helps.
    > Mike
    > On 8/20/16, 5:09 AM, "Trilinos-Users on behalf of Denis Davydov" <trilinos-users-bounces at trilinos.org on behalf of davydden at gmail.com> wrote:
    >    Dear Trilinos users and developers,
    >    Is there anything under Trilinos umbrella (Tpetra, Thyra, etc) which would 
    >    help using SparseMultiVectors? By “Sparse” i mean that each vector is non-zero on some small set of indices.
    >    I would need usual operations like product with sparse matrices, addition, projection of sparse matrices onto
    >    subspace spanned by the multivectors.
    >    Kind regards,
    >    Denis
    >    _______________________________________________
    >    Trilinos-Users mailing list
    >    Trilinos-Users at trilinos.org
    >    https://trilinos.org/mailman/listinfo/trilinos-users

More information about the Trilinos-Users mailing list