Re: [deal.II] question about the solver in mpi mode

25 views
Skip to first unread message

Wolfgang Bangerth

unread,
Oct 20, 2019, 10:39:28 PM10/20/19
to dea...@googlegroups.com
On 10/3/19 2:06 AM, huyanzhuo wrote:
> |
> |
>
> it works well when i use *ONE PROCESS*, it only need 14~15 iterations to get a
> satisified result.
> but when i use the
> |
>  mpirun -np 2
> |
> i get errors as follows
> |
> ----------------------------------------------------
> Exception on processing:
>
> --------------------------------------------------------
> An error occurred in line <590> of file </usr/include/deal.II/lac/solver_cg.h>
> in function
>   void dealii::SolverCG<VectorType>::solve(const MatrixType&, VectorType&,
> const VectorType&, const PreconditionerType&) [with MatrixType =
> dealii::TrilinosWrappers::SparseMatrix; PreconditionerType =
> dealii::TrilinosWrappers::PreconditionSSOR; VectorType =
> dealii::TrilinosWrappers::MPI::Vector]
> The violated condition was:
>     false
> Additional information:
> Iterative method reported convergence failure in step 4788. The residual in
> the last step was 0.00440582.
>
> This error message can indicate that you have simply not allowed a
> sufficiently large number of iterations for your iterative solver to converge.
> This often happens when you increase the size of your problem. In such cases,
> the last residual will likely still be very small, and you can make the error
> go away by increasing the allowed number of iterations when setting up the
> SolverControl object that determines the maximal number of iterations you allow.
>
> The other situation where this error may occur is when your matrix is not
> invertible (e.g., your matrix has a null-space), or if you try to apply the
> wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or
> not positive definite). In these cases, the residual in the last iteration is
> likely going to be large.
> --------------------------------------------------------
>
> Aborting!
> ----------------------------------------------------
>
>
> ----------------------------------------------------
> Exception on processing:
>
> --------------------------------------------------------
> An error occurred in line <590> of file </usr/include/deal.II/lac/solver_cg.h>
> in function
>   void dealii::SolverCG<VectorType>::solve(const MatrixType&, VectorType&,
> const VectorType&, const PreconditionerType&) [with MatrixType =
> dealii::TrilinosWrappers::SparseMatrix; PreconditionerType =
> dealii::TrilinosWrappers::PreconditionSSOR; VectorType =
> dealii::TrilinosWrappers::MPI::Vector]
> The violated condition was:
>     false
> Additional information:
> Iterative method reported convergence failure in step 4788. The residual in
> the last step was 0.00440582.
>
> This error message can indicate that you have simply not allowed a
> sufficiently large number of iterations for your iterative solver to converge.
> This often happens when you increase the size of your problem. In such cases,
> the last residual will likely still be very small, and you can make the error
> go away by increasing the allowed number of iterations when setting up the
> SolverControl object that determines the maximal number of iterations you allow.
>
> The other situation where this error may occur is when your matrix is not
> invertible (e.g., your matrix has a null-space), or if you try to apply the
> wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or
> not positive definite). In these cases, the residual in the last iteration is
> likely going to be large.
> --------------------------------------------------------
>
> Aborting!
> ----------------------------------------------------
> -------------------------------------------------------
> Primary job  terminated normally, but 1 process returned
> a non-zero exit code.. Per user-direction, the job has been aborted.
> -------------------------------------------------------
> --------------------------------------------------------------------------
> mpirun detected that one or more processes exited with non-zero status, thus
> causing
> the job to be terminated. The first process to do so was:
>
>   Process name: [[53229,1],1]
>   Exit code:    1
>
> |
>
> does anyone has the same problem ?
>
> i change the preconditioner by a TrilinosWrappers::PreconditionAMG one , the
> iteration increase from 15 to 28 in the first computation ,and didn't converge
> in the 2dn computation.

It's hard to tell what is happening without knowing the code. I see two things
worth checking:

* The TrilinosWrappers::PreconditionSSOR class does something different
depending on how many processors you have. In particular, the more processors
you have the closer it gets to a Jacobi preconditioner, which is a worse
preconditioner than the sequential SSOR. If you want to make sure that the
number of processors has no influence on the solution of the linear system,
then you probably want to use a preconditioner that doesn't depend on the
number of processors -- e.g., Jacobi or a version of algebraic multigrid (AMG).

* Have you verified that the linear system is actually the same when you go
from one to two processors? The error message you show suggests that the
matrix may in fact be singular, or in particular not symmetric and positive
definite as it should be for CG to work. Ideally, of course, the matrix ought
to be the same one you have on one processor, but your code may have a bug
that makes that not so. It would be worth verifying that it is.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages