[petsc-users] Debugging KSP output error

Dave May dave.mayhem23 at gmail.com
Thu Aug 20 02:29:16 CDT 2015


On 20 August 2015 at 05:28, TAY wee-beng <zonexo at gmail.com> wrote:

> Hi,
>
> I run my code on 1, 2 and 3 procs. KSP is used to solve the Poisson eqn.
>
> Using MatView and VecView, I found that my LHS matrix and RHS vec are the
> same for 1,2 and 3 procs.
>
> However, my pressure (ans) output is the almost the same (due to
> truncation err) for 1,2 procs.
>
> But for 3 procs, the output is the same as for the 1,2 procs for all
> values except:
>
> 1. the last few values for procs 0
>
> 2. the first and last few values for procs 1 and 2.
>
> Shouldn't the output be the same when the LHS matrix and RHS vec are the
> same? How can I debug to find the err?
>
>
It's a bit hard to say much without knowing exactly what solver
configuration you actually ran and without seeing the difference in the
solution you are referring too.

Some preconditioners have different behaviour in serial and parallel. Thus,
the convergence of the solver and the residual history (and thus the
answer) can look slightly different. This difference will become smaller as
you solve the system more accurately.
Do you solve the system accurately? e.g. something like -ksp_rtol 1.0e-10

To avoid the problem mentioned above, try using -pc_type jacobi. This PC is
the same in serial and parallel. Thus, if your A and b are identical  on
1,2,3 procs, then the residuals and solution will also be identical on
1,2,3 procs (upto machine precision).

Thanks,
  Dave



> --
> Thank you
>
> Yours sincerely,
>
> TAY wee-beng
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150820/f5a83421/attachment.html>


More information about the petsc-users mailing list