[petsc-users] PETSc should not be used to attempt to provide a “parallel linear solver” ??

Jed Brown jedbrown at mcs.anl.gov
Wed Feb 15 06:39:14 CST 2012


On Wed, Feb 15, 2012 at 05:12, Bibrak Qamar <bibrakc at gmail.com> wrote:

> "• PETSc should not be used to attempt to provide a “parallel linear
> solver” in an otherwise sequential
> code. Certainly all parts of a previously sequential code need not be
> parallelized but the matrix
> generation portion must be parallelized to expect any kind of reasonable
> performance. Do not expect
> to generate your matrix sequentially and then “use PETSc” to solve the
> linear system in parallel.
> "
> Please help me understand what is meant by it. What if I read the matrix
> from a file (sequential) and distribute it to other processes and then call
> any linear solver, how is it going to affect the performance of the code?
> because reading or generating the matrix is a one time cost for one
> timestep, or may be that CAUTION is for multiple timesteps?
>

You should work on the assumption that reading the matrix from a file is at
least 100 times more expensive than solving a linear system (more if you're
running on thousands of processors).

If you are going to solve with the same matrix enough times, then it's okay.

Note that if you save the matrix in binary format, you can read in parallel
using MatLoad().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120215/564fde11/attachment.htm>


More information about the petsc-users mailing list