PETSc iteration does not converge

33 views
Skip to first unread message

yuesu jin

unread,
Aug 14, 2020, 7:54:11 PM8/14/20
to deal.II User Group
Dear all,
  I am working on acoustic wave simulation through PETSc wrapper, it gives the error message:
******************************************************************************
Mesh Info
Dimensions2
No.cells:5144
Number of active cells:5144
Number of degrees of freedom:20833


*********************
Exception on processing:

--------------------------------------------------------
An error occurred in line <148> of file </project/cacds/build/dealii-9.2.0/source/lac/petsc_solver.cc> in function
    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::PreconditionerBase&)
The violated condition was:
    false
Additional information:
Iterative method reported convergence failure in step 65. The residual in the last step was 0.00295038.

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
***************

I also wrote a single thread CG version, which converges well. The preconditioner in the parallel version is blockJacobi but the single thread version I used is SSOR. Does it matter to the convergence? Thank you!
Best regards,
--
Yuesu Jin,
Ph.D student,
University of Houston,
College of Natural Sciences and Mathematics,
Department of Earth and Atmospheric Sciences,
Houston, Texas 77204-5008


Wolfgang Bangerth

unread,
Aug 14, 2020, 11:14:26 PM8/14/20
to dea...@googlegroups.com
On 8/14/20 5:53 PM, yuesu jin wrote:
>
> I also wrote a single thread CG version, which converges well. The
> preconditioner in the parallel version is blockJacobi but the single thread
> version I used is SSOR. Does it matter to the convergence? Thank you!

Yes, in exactly the ways the error message shows: If you are using a different
preconditioner, you should expect different convergence behavior.

Whether you should expect one or the other method to work (or fail) depends on
the properties of the matrix you are trying to solve. I'd also check whether
the residual 0.00295038 is large or small compared to the initial residual.
What is the tolerance you are using in the SolverControl object?

Best
W.

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

yuesu jin

unread,
Aug 14, 2020, 11:20:46 PM8/14/20
to deal.II User Group
Dear Dr. Bangerth,
  I tried a few levels of the tolerance, 1e-3, 1e-4 ,1e-6 and 1e-8. 1e-3 converged because that is in the same level with the solution. Error occurs below 1e-4.  I have tried the Jacobi preconditioner instead of SSOR in the single thread CG version, it converged as well.  
Best regards,
Yuesu   
  

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/91ed065a-a39b-c7ba-978a-704485da3387%40colostate.edu.

Wolfgang Bangerth

unread,
Aug 16, 2020, 8:20:53 PM8/16/20
to dea...@googlegroups.com
On 8/14/20 9:20 PM, yuesu jin wrote:
> I tried a few levels of the tolerance, 1e-3, 1e-4 ,1e-6 and 1e-8. 1e-3
> converged because that is in the same level with the solution. Error occurs
> below 1e-4.  I have tried the Jacobi preconditioner instead of SSOR in the
> single thread CG version, it converged as well.

Is this 1e-4 * system_rhs.l2_norm(), or just 1e-4? If the latter, what is the
size of system_rhs.l2_norm()? You should choose a tolerance that is
proportional to the norm of the right hand side.

yuesu jin

unread,
Aug 16, 2020, 8:48:13 PM8/16/20
to deal.II User Group
Dear Dr.Bangerth,
   I tried both, first I tried 1e-4*system_rhs.l2_norm(), it failed. Then I tried with exact precision limits, from 1e-3 to 1e-8, all of them cannot converge.  If I set the precision level as 1e-4, with or without L2 norm it stopped at step-42 with the residue 0.0113395.
Best regards,
Yuesu 

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.

Wolfgang Bangerth

unread,
Aug 17, 2020, 7:53:14 PM8/17/20
to dea...@googlegroups.com

>    I tried both, first I tried 1e-4*system_rhs.l2_norm(), it failed.

Then either the matrix is not symmetric/positive definite/whatever other
property your iterative solver requires, or your preconditioner is unsuitable.
What have you don to verify that your matrix has the necessary properties?

yuesu jin

unread,
Aug 17, 2020, 8:01:56 PM8/17/20
to deal.II User Group
Dear Dr.Bangerth,
    I did nothing to verify those properties. because the single thread CG solver converged well. I used  different preconditioners in parallel version and single thread version. In the parallel version I used block Jacobi and in the single thread version I used Jacobi. How can I check if the parallel blocked sparse matrix is/ isn't symmetrical and positive definite? 
Best regards,
Yuesu

Wolfgang Bangerth

unread,
Aug 17, 2020, 8:06:33 PM8/17/20
to dea...@googlegroups.com
Think of tests such as this:
* run on 1 processor, multiply a vector w of all 1s from the right, and output
the resulting vector v=Aw on all processors
* run on >1 processors and repeat
Are the vectors the same for both cases? The matrix should be the same
regardless of partitioning, but is it?

* repeat the same with Tvmult (multiplication from the left)

You can probably come up with many similar tests that check properties of the
matrix, comparing between the single-processor and multiple-processor cases.
The point is that you may not know the exact answer, but you know that the two
cases should result in the same output.

yuesu jin

unread,
Aug 17, 2020, 8:08:26 PM8/17/20
to deal.II User Group
OK, I see. I will do it, thank you! I will let you know if I get any result.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages