[petsc-users] zero pattern of result of matmatmult
Jed Brown
jedbrown at mcs.anl.gov
Tue Sep 17 09:24:11 CDT 2013
Frederik Treue <frtr at fysik.dtu.dk> writes:
> On Tue, 2013-09-17 at 08:15 -0500, Barry Smith wrote:
>> Are you calling MatSetValuesStencil() for each single entry or once per row or block row? Row or block row will be faster than for each entry.
> once per entry - this I should definitely improve. What's the logic
> behind row or block rows being faster? The fewer calls to
> MatSetValuesStencil, the better?
It shares index translation and the call stack.
>>
>> Since you are using MatSetValuesStencil() I assume you are using a DA?
>
> I am, with one DOF per point. Are there better alternatives?
No, what you're doing is fine.
> PS. FYI: My stencil is essentially a standard 2D, 9-point box stencil,
> but the values in all rows are different (due, among other things, to
> the geometric tensor).
That's normal. Is the geometry changing?
> ##########################################################
> # #
> # WARNING!!! #
> # #
> # This code was compiled with a debugging option, #
> # To get timing results run ./configure #
> # using --with-debugging=no, the performance will #
> # be generally two or three times faster. #
> # #
> ##########################################################
We weren't joking.
You should configure an optimized build using a different value of
PETSC_ARCH so that you can easily switch back and forth between the
debug and optimized versions. Everything will get faster, but
especially insertion.
-------------- 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/20130917/bd81b0cf/attachment.pgp>
More information about the petsc-users
mailing list