← Back to team overview

dolfin team mailing list archive

Re: Parallel assembly and SparsityPattern

 

Perhaps it's worth focusing on getting DofMap (with re-working of the mapping) and SparsityPattern sorted out for parallel assembly before worrying too much about the PETSc wrappers. Once you have the SparsityPattern (for each process) it should give you what you need to initialise parallel matrices.

Garth

Gustav Magnus Vikstrøm wrote:
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
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev



Follow ups

References