[petsc-users] A question on the PETSc options for non-uniform grid

Jed Brown jedbrown at mcs.anl.gov
Sun Mar 31 15:16:47 CDT 2013


"Zhenglun (Alan) Wei" <zhenglun.wei at gmail.com> writes:

> Dear All,
> I hope you're having a nice day.
> Based on ksp ex45, a 3D Poisson solver with non-uniform grid is coded.
> The PETSc options I used is:
> /mpiexec -np 32 ./ex45 -pc_type gamg -ksp_type cg -pc_gamg_type agg
> -pc_gamg_agg_nsmooths 1 -mg_levels_ksp_max_it 1 -mg_levels_ksp_type
> richardson -ksp_rtol 1.0e-7/
> There are some problems:
> 1, if the mesh is very coarse with very small amount of the grid, the
> code runs well;
> 2, if the mesh is fine, an error message comes up saying 'un-symmetric
> graph'. It suggests me to use '-pc_gamg_sym_graph true' or
> '-pc_gamg_thredhold 0.0'.

How are you implementing boundary conditions?

> a) if '-pc_gamg_sym_graph true' is used, the code runs but blows up very
> quickly with crazy norm;
> b) if '-pc_gamg_thredhold 0.0' is used, the code stops on the KSPSolve()
> forever;
> 3, because of the 'un-symmetric graph' error, it reminds me that the
> matrix may not be symmetric, which indicates that '-ksp_type cg' may not
> be a good option. Therefore, I changed it to '-ksp_type gmres'. It makes
> the code run with 'moderate fine' mesh. However, it stops at KSPSolve()
> also with fine mesh.
> a) does there any other '-ksp_type' fit better for this case?
> b) does multigrid preconditioner work well for gmres?

All of the above should work. Can you reproduce with our version of
ex45.c, or can you send your version with the full error messages you
are seeing (or other symptoms, like deadlock?) and instructions to
reproduce?


More information about the petsc-users mailing list