This is really helpful, Jed! 

Thanks,
Manav

> On Oct 29, 2018, at 1:57 PM, Jed Brown <j...@jedbrown.org> wrote:
> 
> Manav Bhatia <bhatiama...@gmail.com> writes:
> 
>> I am experimenting with the threshold parameter. 
>> 
>> As described in the manual:  
>> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGAMGSetThreshold.html
>>  
>> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCGAMGSetThreshold.html>
>> 
>> 
>> “ Conversely reducing the threshold increases the rate of coarsening 
>> (aggressive coarsening) and thereby reduces the complexity of the coarse 
>> grids, and generally results in slower solver converge rates."
>> 
>> 
>> I did some experimentation for my problem: 
>> 
>> 1) -pc_mg_levels 3 -mg_levels_ksp_max_it 3 -pc_gamg_square_graph 1 
>> -pc_gamg_threshold 0   : 22 KSP iterations, 39 seconds
>> 2) -pc_mg_levels 3 -mg_levels_ksp_max_it 3 -pc_gamg_square_graph 1 
>> -pc_gamg_threshold 0.5 : Did not converge in over 1000 KSP iterations
> 
> 0.5 is enormous and likely results in "weird" aggregates.  Try 0.001 to
> 0.05 for example.  You can see the coarsening rate and grid complexity
> in -ksp_view output.
> 
>> According to the manual reducing the threshold value would result in slower 
>> convergence rates. However, I am observing opposite behavior. 
>> 
>> Is this problem specific? Or maybe I am misunderstanding something here. 
>> 
>> Also, I am assuming that the threshold refers to some parameter in the 
>> connectivity graph, which is independent of the entries in the matrix. So, 
>> the value of threshold is independent of the magnitudes of the entries in 
>> the matrix (?). 
> 
> Yeah, the standard strength measure is
> 
>  |a_{ij}| / sqrt(|a_{ii}| |a_{jj}|)
> 
>> I would appreciate some guidance here. 
>> 
>> Regards,
>> Manav
>> 
>>> On Oct 29, 2018, at 1:03 PM, Jed Brown <j...@jedbrown.org> wrote:
>>> 
>>> Manav Bhatia <bhatiama...@gmail.com> writes:
>>> 
>>>> I also observed that the number of KSP iterations increases with an 
>>>> increase in the levels of AMG. Is this true, in general, for all/most 
>>>> applications? 
>>> 
>>> Adding levels replaces a direct solve with a deeper V-cycle.  When MG is
>>> behaving well, this makes little difference because the coarse
>>> approximations are no worse than the approximations made in the first
>>> coarsening (from fine level to first coarsened level).  But there are
>>> many stubborn problems for which it does hurt, as you have seen.

Reply via email to