[petsc-dev] preallocation checks

Stefano Zampini stefano.zampini at gmail.com
Sat Jan 28 11:50:34 CST 2012


I was able to reproduce the error using
src/ksp/ksp/examples/tutorials/ex2.c using the patch attached.
Please see the error log obtained by executing with -n 10 -m 10 by command
line.
If you uncomment MatGetOwnershipRange, the code will work fine

2012/1/28 Jed Brown <jedbrown at mcs.anl.gov>

> 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.
>



-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120128/e718b604/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: errlog_n10m10
Type: application/octet-stream
Size: 2945 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120128/e718b604/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_ex2
Type: application/octet-stream
Size: 1775 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120128/e718b604/attachment-0001.obj>


More information about the petsc-dev mailing list