[petsc-users] KSP solver for single process

Karl Rupp rupp at mcs.anl.gov
Tue Aug 6 15:10:38 CDT 2013


Hi Alan,

with Mudpack being a geometric multigrid solver (from your description I 
thought that this is one of the sparse direct solvers like UMFPACK - 
thanks, Matt), the behavior is fairly consistent: Algebraic multigrid 
preconditioners need to reconstruct the coarse grids, while this is 
information is immediately available for geometric multigrid. Thus, if 
you can use geometric multigrid and it works well (which is particularly 
the case for structured grids), use it. Consider the same for multiple 
processes. There is no bullet-proof general recipe, so some 
experimentation is necessary.

Best regards,
Karli


On 08/06/2013 02:56 PM, Alan wrote:
>     Thanks for replies. Here I attached the log_summary for the large
> and small problems. The DoFs for the large problem is 4 times of that
> for the small problem. Few observations are listed here:
> 1, the total number of iterations does not change much from the small
> problem to the large one;
> 2, the time elapsed for KSPSolve() for the large problem is less than 4
> times of that for the small problem;
> 3, the time elapsed for PCSet() for the large problem is more than 10
> times of that for the small problem;
> 4, the time elapsed for PCGAMGProl_AGG for the large problem is more
> than 20 times of that for the small problem;
>     In my code, I have solved the Poisson equation for twice with
> difference RHS; however, the observation above is almost consistent for
> these two times.
>     Do these observation indicate that I should switch my PC from GAMG
> to MG for solving Poisson equation in a single process?
>
> best,
> Alan
>
>> On Tue, Aug 6, 2013 at 2:31 PM, Karl Rupp <rupp at mcs.anl.gov
>> <mailto:rupp at mcs.anl.gov>> wrote:
>>
>>     Hi Alan,
>>
>>     please use -log_summary to get profiling information on the run.
>>     What is
>>     the bottleneck? Is it the number of solver iterations increasing
>>     significantly? If so, consider changing the preconditioner options
>>     (more
>>     levels!). I don't expect a direct solver to be any faster in the 180k
>>     case for a Poisson problem.
>>
>>
>> Mudpack is geometric multigrid:
>> http://www2.cisl.ucar.edu/resources/legacy/mudpack
>> This should be faster.
>>
>>    Matt
>>
>>     Best regards,
>>     Karli
>>
>>
>>     On 08/06/2013 02:22 PM, Alan wrote:
>>     > Dear all,
>>     > I hope you're having a nice day.
>>     > I have a quick question on solving Poisson equation with KSP solvers
>>     > (/src/ksp/ksp/example/tutorial/ex29.c). Currently, I run this
>>     solver with:
>>     > -pc_type gamg -ksp_type cg -pc_gamg_agg_nsmooths 1
>>     -mg_levels_ksp_max_it
>>     > 1 -mg_levels_ksp_type richardson -ksp_rtol 1.0e-7
>>     > It performs very well in parallel computation and scalability is
>>     fine.
>>     > However, if I run it with a single process, the KSP solver is much
>>     > slower than direct ones, i.e. Mudpack. Briefly, the speed difference
>>     > between the KSP solver and the direct solver is negligible on
>>     dealing
>>     > with small problems (i.e.36k DoFs ) but becomes very huge for
>>     moderate
>>     > large problems (i.e. 180k DoFs). Although the direct solver
>>     inherently
>>     > has better performance for moderate large problems in the single
>>     > process, I wonder if any setup or approach can improve the
>>     performance
>>     > of this KSP Poisson solver with the single process? or even make it
>>     > obtain competitive speed (a little bit slower is fine) against
>>     direct
>>     > solvers.
>>     >
>>     > thanks in advance,
>>     > Alan
>>     >
>>
>>
>>
>>
>> --
>> 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
>



More information about the petsc-users mailing list