something slowed down MatSetValues

Matthew Knepley knepley at
Wed Jun 10 13:16:50 CDT 2009

You have not preallocated the matrix correctly.


On Wed, Jun 10, 2009 at 1:10 PM, xiaoyin ji <sapphire.jxy at> wrote:

> Hi,
> I've just got a problem with MatSetValues. I have a loop of about 1
> million and 6 MatSetValues call inside. The loop runs very slow( about
> several minutes or more), but if I comment one or two MatSetValues
> then it will finish in seconds. Any hints? Thank you!
> Xiaoyin Ji

What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list