[petsc-users] preallocation of mpiaij matrix

Jed Brown jedbrown at mcs.anl.gov
Wed Jul 31 10:35:12 CDT 2013


Hoang Giang Bui <hgbk2008 at gmail.com> writes:

> Hi
>
> I want to consult the optimized way to allocate the mpiaij matrix for 
> FEM application. Typically, elements in each process contribute to 
> global matrix partially, therefore in each process I can define the 
> number of nonzeros in according row locally but not globally. Is there 
> method in petsc support to allocate matrix based on sparsity pattern 
> (i.e. I provide petsc with row & column I'm going to fill later on in 
> the assembly process) ?

There are a few ways to do it, but you should be providing full
preallocation information, not just for the parts the local process is
contributing.  Consider doing something like this, for example:

http://mail-archive.com/search?l=mid&q=3BEF7FCC-AF4A-461A-B068-9DB01EF94B7A@mcs.anl.gov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130731/596db126/attachment.pgp>


More information about the petsc-users mailing list