[petsc-dev] preallocation checks

Stefano Zampini stefano.zampini at gmail.com
Sat Jan 28 11:57:01 CST 2012


clearly, I ran it with mpirun -n 1

2012/1/28 Stefano Zampini <stefano.zampini at gmail.com>

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



-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120128/00985aa8/attachment.html>


More information about the petsc-dev mailing list