ksp follow-up Qs

Matthew Knepley knepley at gmail.com
Fri Sep 11 11:16:47 CDT 2009

2009/9/11 tsjb00 <tsjb00 at hotmail.com>

>  Many thanks for your replies! I have three follow-up questions. I use the
> AIJ format for the matrix, BCGS for KSP and ILU for PC. The matrix changes
> with time.
> Now I put PC and KSP definition in initialization. In each timestep, I
> redefine the matrix and rhs vector, use the KSPSetOperators and KSPSolve.
> When I run the program, I get the following error info, which seems to occur
> right before KSPSetOperators
>  [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Arguments are incompatible!
> [0]PETSC ERROR: Incompatible vector global lengths!
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 3.0.0, Patch 5, Mon Apr 13 09:15:37
> CDT 2009
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages .
> ------------------------------------------------------------------------
> [0]PETSC ERROR: ../src_o_petsc/min3pp on a linux-gnu named pardiff by
> jinbei Fri Sep 11 08:49:22 2009
> [0]PETSC ERROR: Libraries linked from
> /home/jinbei/Soft/petsc-3.0.0-p5/linux-gnu-c-debug/lib
> [0]PETSC ERROR: Configure run at Thu Aug 20 11:36:14 2009
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=ifort
> --download-f-blas-lapack=1 --download-mpich=1 --with-shared=0
> ------------------------------------------------------------------------
> [0]PETSC ERROR: VecCopy() line 1685 in src/vec/vec/interface/vector.c
> [0]PETSC ERROR: KSPInitialResidual() line 60 in
> src/ksp/ksp/interface/itres.c
> [0]PETSC ERROR: KSPSolve_BCGS() line 44 in src/ksp/ksp/impls/bcgs/bcgs.c
> [0]PETSC ERROR: KSPSolve() line 385 in src/ksp/ksp/interface/itfunc.c
> What might cause the problem?

You cannot change the problem size dynamically with KSP, since it allocates
work vectors, etc. to support the computation. If the
size changes, everything will have to be recreated.

> Another question is, the BCGS+ILU combination is kind of slo w. Would you
> please give me some suggestions on how to optimize the solver performance?
> I've tried setting PC level to 1 and reducing maximum iterations, but
> doesn't really work well.

Preconditioning is highly problem dependent. I do not believe in block-box

> The last question is, if I want to use the true residual norm (based on
> original A*x=y) and the norm of solution updates as the criteria of
> convergence, what functions would do? Any example in the package I can refer
> to?


If you want something more sophisticated, you can always use



> Many thanks again and have a nice day!
> ------------------------------
> 与任何您希望的人分享您的回忆。 任何您希望的人。<http://www.microsoft.com/china/windows/windowslive/products/photos-share.aspx?tab=1>

What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090911/4cc0fe91/attachment.htm>

More information about the petsc-users mailing list