[petsc-dev] preallocation checks

Jed Brown jedbrown at mcs.anl.gov
Sat Jan 28 11:18:32 CST 2012


On Sat, Jan 28, 2012 at 10:11, Stefano Zampini <stefano.zampini at gmail.com>wrote:

> ierr = MatCreate(PETSC_COMM_SELF,&mat);CHKERRQ(ierr);
> ierr = MatSetSize(mat,n,m,n,m);CHKERRQ(ierr);
> ierr = MatSetType(mat,MATSEQDENSE);CHKERRQ(ierr);
> -> Then a loop to set values
> ierr = MatAssemblyBegin(mat);CHKERRQ(ierr);
> ierr = MatAssemblyEnd(mat);CHKERRQ(ierr);
>

I couldn't reproduce this with a modified
src/ksp/ksp/examples/tutorials/ex2.c

MatSetUpPreallocation() should be sufficient in other cases.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120128/3bee4073/attachment.html>


More information about the petsc-dev mailing list