← Back to team overview

dolfin team mailing list archive

Parallel assembly and SparsityPattern

 

The PETSc function MatCreateMPIAIJ ( http://www.caspur.it/risorse/softappl/doc/petsc_docs/manualpages/Mat/MatCreateMPIAIJ.html ) takes a number of arguments. Two of the arguments are:

d_nnz: Array containing the number of nonzeros in the various rows of the DIAGONAL portion of the local submatrix o_nnz: Array containing the number of nonzeros in the various rows of the OFF-DIAGONAL portion of the local submatrix

Currently we are using PETSC_NULL for these to values and a guess (currently set to 50) for the number of non-zeroes on all rows. According to the PETSc manual performance can be increased by more than a factor of 50 by setting these parameters accurately.

My question is how to create d_nnz and o_nnz?

For sequential matrices it is done by:
SparsityPattern::numNonZeroPerRow(uint nzrow[])

Maybe we could add methods to SparsityPattern?
SparsityPattern::numNonZeroPerDiagonalRow(uint nzdiagrow[])
SparsityPattern::numNonZeroPerOffDiagonalRow(uint nzoffdiagrow[])

- Magnus


Follow ups