[petsc-users] Issue of mg_coarse_ksp not converge

Mark Adams mfadams at lbl.gov
Mon Oct 2 08:34:04 CDT 2017


GAMG will coarsen the problem until it is small and fast to solve with a
direct solver (LU). You can use preonly if you have a perfect
preconditioner.

On Mon, Oct 2, 2017 at 9:08 AM, Matthew Knepley <knepley at gmail.com> wrote:

> On Mon, Oct 2, 2017 at 8:30 AM, Wenbo Zhao <zhaowenbo.npic at gmail.com>
> wrote:
>
>> Matt
>>
>> Because I am not clear about what will happen using 'preonly' for large
>> scale problem.
>>
>
> The size of the problem has nothing to do with 'preonly'. All it means is
> to apply a preconditioner without a Krylov solver.
>
>
>> It seems to use a direct solver from below,
>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/
>> KSP/KSPPREONLY.html
>>
>
> However, I still cannot understand why you would change the default?
>
>   Matt
>
>
>>
>> Thanks!
>> Wenbo
>>
>> On Mon, Oct 2, 2017 at 5:09 PM, Matthew Knepley <knepley at gmail.com>
>> wrote:
>>
>>> On Sun, Oct 1, 2017 at 9:53 PM, Wenbo Zhao <zhaowenbo.npic at gmail.com>
>>> wrote:
>>>
>>>> Matt,
>>>> Thanks for your reply.
>>>> It DOES make no sense for this problem.
>>>> But I am not clear about the 'preonly' option. Which solver is used in
>>>> preonly? I wonder if 'preonly' is suitable for large scale problem such as
>>>> 400,000,000 unknowns.
>>>> So I tried 'gmres' option and found these error messages.
>>>>
>>>
>>> I mean, why are you setting this at all. Just do not set the coarse
>>> solver. The default should work fine.
>>>
>>>   Thanks,
>>>
>>>     Matt
>>>
>>>
>>>> Could you give me some suggestions?
>>>>
>>>> Thanks.
>>>>
>>>> Wenbo
>>>>
>>>>
>>>> On Mon, Oct 2, 2017 at 12:34 AM, Matthew Knepley <knepley at gmail.com>
>>>> wrote:
>>>>
>>>>> On Sun, Oct 1, 2017 at 6:49 AM, Wenbo Zhao <zhaowenbo.npic at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I met some questions when I use PETSC/SLEPC to solve two-group
>>>>>> neutron diffusion equations with finite difference method. The grid is
>>>>>> 3*3*3, when DOF on each points is 2. So the matrix size is 54*54.
>>>>>> It is generalized eigenvalue problem Ax=\lamda Bx, where B is
>>>>>> diagonally dominant matrix but not symmetry.
>>>>>> EPS is set as below,
>>>>>>  ierr = EPSSetProblemType(eps,EPS_GNHEP);CHKERRQ(ierr);¬
>>>>>>  ierr = EPSSetWhichEigenpairs(eps,EPS_LARGEST_REAL);CHKERRQ(ierr);¬
>>>>>>
>>>>>> Krylovschur is used as eps sovler. GAMG is used as PC.
>>>>>> I tried agg_nsmooths and mg_coarse_ksp_type. Only non-smooths and
>>>>>> preonly is OK.
>>>>>>
>>>>>
>>>>> Why are you setting the coarse solver. This makes no sense.
>>>>>
>>>>>    Thanks,
>>>>>
>>>>>     Matt
>>>>>
>>>>>
>>>>>>
>>>>>> Test 1
>>>>>> $ make NCORE=1 runkr_nonsmooth
>>>>>> mpirun -n 1 ./step-41 \
>>>>>>    -st_ksp_type gmres  \
>>>>>>    -st_pc_type gamg -st_pc_gamg_type agg -st_pc_gamg_agg_nsmooths 0 \
>>>>>>    -st_ksp_view  -mata AMAT.dat -matb BMAT.dat \
>>>>>>    -st_mg_coarse_ksp_type preonly   -st_mg_coarse_ksp_monitor  \
>>>>>>    -eps_nev 1 -eps_ncv 10  -eps_monitor  -log_view > log_nonsmooth
>>>>>> 2>&1
>>>>>>
>>>>>> Test 2
>>>>>> $ make NCORE=1 runkr_smooth
>>>>>> mpirun -n 1 ./step-41 \
>>>>>>    -st_ksp_type gmres  \
>>>>>>    -st_pc_type gamg -st_pc_gamg_type agg -st_pc_gamg_agg_nsmooths 1 \
>>>>>>    -st_ksp_view  -mata AMAT.dat -matb BMAT.dat \
>>>>>>    -st_mg_coarse_ksp_type preonly   -st_mg_coarse_ksp_monitor  \
>>>>>>    -eps_nev 1 -eps_ncv 10  -eps_monitor -log_view > log_smooth 2>&1
>>>>>> makefile:43: recipe for target 'runkr_smooth' failed
>>>>>> make: *** [runkr_smooth] Error 91
>>>>>>
>>>>>> Test 3
>>>>>> $ make NCORE=1 runkr_gmres
>>>>>> mpirun -n 1 ./step-41 \
>>>>>>    -st_ksp_type gmres  \
>>>>>>    -st_pc_type gamg -st_pc_gamg_type agg -st_pc_gamg_agg_nsmooths 0 \
>>>>>>    -st_ksp_view  -mata AMAT.dat -matb BMAT.dat \
>>>>>>    -st_mg_coarse_ksp_type gmres  -st_mg_coarse_ksp_monitor
>>>>>> -st_mg_coarse_ksp_rtol 1.0e-6 \
>>>>>>    -eps_nev 1 -eps_ncv 10  -eps_monitor  -log_view > log_gmres 2>&1
>>>>>> makefile:59: recipe for target 'runkr_gmres' failed
>>>>>> make: *** [runkr_gmres] Error 91
>>>>>>
>>>>>> Log files were attched.
>>>>>> The matrix file were also attched as AMAT.dat and BMAT.dat.
>>>>>>
>>>>>> Is it correct? Or something wrong with my code or commad-line?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>> Wenbo
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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/>
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> 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/>
>>>
>>
>>
>
>
> --
> 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/20171002/c6eaabbf/attachment-0001.html>


More information about the petsc-users mailing list