[petsc-users] PETSc Solver: Large iteration count for first solution

Matthew Knepley knepley at gmail.com
Sat Jun 23 09:09:19 CDT 2018


On Sat, Jun 23, 2018 at 4:37 AM Najeeb Ahmad <nahmad16 at ku.edu.tr> wrote:

> Hi,
>
> I am trying to solve a  64008000 x  64008000 system using PETSc. The
> problem I am facing is that I am getting a very large iteration count for
> the first solution (order of thousands). For the subsequent soluitons, the
> iteration count is less. For instance, here is the iteration count for the
> first solution when my code is run on 32 processes.
>
> ...
> 2772 KSP Residual norm 1.198554448053e-07
> 2773 KSP Residual norm 1.190214006391e-07
> 2774 KSP Residual norm 1.181931531360e-07
> 2775 KSP Residual norm 1.173706620648e-07
> 2776 KSP Residual norm 1.165538874733e-07
> 2777 KSP Residual norm 1.157427896857e-07
> 2778 KSP Residual norm 1.149373293013e-07
> 2779 KSP Residual norm 1.141374671925e-07
> 2780 KSP Residual norm 1.133431645025e-07
> Linear solve converged due to CONVERGED_RTOL iterations 2780
>
> For the subsequent solutions, the iteration count is as follows:
> ...
> 116 KSP Residual norm 2.657138978992e-04
> 117 KSP Residual norm 2.767485246885e-04
> 118 KSP Residual norm 2.071574619161e-04
> 119 KSP Residual norm 2.273562103015e-04
> 120 KSP Residual norm 1.693847273193e-04
> 121 KSP Residual norm 1.803833437167e-04
> 122 KSP Residual norm 1.443434809819e-04
> 123 KSP Residual norm 1.390878278231e-04
> 124 KSP Residual norm 1.247521972621e-04
> 125 KSP Residual norm 1.059224678494e-04
> Linear solve converged due to CONVERGED_RTOL iterations 125
>
> The solver setup for my code is as follows:
>
>  ierr = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
>   ierr = KSPSetOperators(ksp,A,A);CHKERRQ(ierr);
>   ierr = KSPSetType(ksp, KSPCG);CHKERRQ(ierr);
>   ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr);
>   ierr = PCSetType(pc, PCJACOBI);
>   ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr);
>   ierr = KSPSetUp(ksp);CHKERRQ(ierr);
>
> and the command line for running the code is:
> mpiexec -n 32 ./main -mat_type mpiaij -ksp_atol 1E-7 -ksp_rtol 1E-7
> -ksp_converged_reason -ksp_monitor
>

What equation are you trying to solve. CG/Jacobi is a scalable solver for
the mass matrix (identity), but
not much else.

  Thanks,

     Matt


> Any help is highly appreciated.
>
>
> --
> *Najeeb Ahmad*
>
>
> *Research and Teaching Assistant*
> *PARallel and MultiCORE Computing Laboratory (ParCoreLab) *
>
> *Computer Science and Engineering*
> *Koç University, Istanbul, Turkey*
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180623/f1bd8de0/attachment.html>


More information about the petsc-users mailing list