[petsc-users] performance issue

Jed Brown jedbrown at mcs.anl.gov
Sat Mar 10 11:58:08 CST 2012


On Sat, Mar 10, 2012 at 11:47, Xavier Garnaud <
xavier.garnaud at ladhyx.polytechnique.fr> wrote:

> I assemble 12 matrices (for each dimension : viscous and inviscid fluxes
> (2 matrices for the dependency on the flow field and the stresses), viscous
> stresses, inviscid BCs (x2 as they depend on the flow field and its
> derivative)).
>

Okay, this effectively involves more traversals of memory, so it's expected
to be slower than the nonlinear version that does it all in one shot.


> There is no linear or non-linear solve.
>
> I want an assembled matrix for two reasons. First, it allows me to
> linearize automatically the operators (by using a variation of the variable
> of ~1e-8: as all the matrices correspond to functions local to each
> discretization points, this can be done with as many function evaluations
> as DOFs per discretization point) without doing it "on the fly", and second
> it allows to take the adjoint of the linear operator.
>

Okay, the adjoint is the key reason. I can imagine code being structured so
that this is a good way to apply the adjoint. If that's the case, just go
with it, it's entirely reasonable for an adjoint to cost twice as much as
the forward operator.

Note that you might want to consider assembling one operator that is the
entire action (instead of many separate sparse matrices for different
terms). The single operator should be faster to apply and is what you
generally want to use for preconditioning (if you wanted to use an implicit
time integration method).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120310/0d2e985c/attachment.htm>


More information about the petsc-users mailing list