[petsc-users] Using MATAIJ and MATSBAIJ

Zhang, Hong hzhang at mcs.anl.gov
Tue Jun 11 10:29:58 CDT 2019


Ian,
I would suggest start using AIJ format.

I am Ian. I trying to implement a solver which involves a sparse symmetric matrix A multiplied by a dense matrix X. And because of the nature of the problem, the bandwidth of the matrix A would be kind of large.For A*X, I am thinking using reverse Cuthill-Mckee algorithm to reduce the bandwidth.

Are the following approach reasonable, or do you have a better advice?

1. Use MatGetOrdering to get a MATORDERINGRCM ordering, and MatPermute to create a new with it.
SBAIJ may not support some orderings. Matrix ordering for sbaij matrix is limited to symmetric ordering and requires restructuring the matrix.

2. What’s the difference by using MATAIJ and MATBAIJ in terms of the entry insertion and computation and MPI efficiency for a sparse-dense matrix multiplication? Would it be better to use MATSBAIJ in terms of the computational efficiency?
SBAIJ stores upper triangular part of matrix, thus saves approximately half memory of a sparse matrix. However, it requires more data communications for y=A*x in general. in your case, C=A*X is a dense matrix, saving half of storage for sparse A may not be worth trading communication cost and functionalities.

Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190611/1de8d81e/attachment.html>


More information about the petsc-users mailing list