[petsc-users] performance issue

Xavier Garnaud xavier.garnaud at ladhyx.polytechnique.fr
Sat Mar 10 09:59:51 CST 2012


Dear PETSc team,

I am solving the compressible Navier--Stokes equations in compressible
form, so in order to apply the operator, I

   1. apply BCs on the flow field
   2. compute the flux
   3. take the derivative using finite differences
   4. apply BCs on the derivatives of the flux


In order to apply the linearized operator, I wish to linearize steps 2 and
4 (the other are linear). For this I assemble sparse matrices (MPIAIJ). The
matrices should be block diagonal -- with square or rectangular blocks --
so I preallocate the whole diagonal blocks (but I only use MatSetValues for
nonzero entries). When I do this, the linearized code runs approximately
50% slower (the computation of derivatives takes more that 70% of the time
in the non-linear code), so steps 2 and 4 are much slower for the linear
operator although the number of operations is very similar. Is this be due
to the poor preallocation? Is there a way to improve the performance?

Thank you very much,

Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120310/1eca2d4e/attachment.htm>


More information about the petsc-users mailing list