[petsc-dev] Telescope usage

Loïc Gouarin loic.gouarin at polytechnique.edu
Tue May 17 11:44:22 CDT 2022


Thanks Dave for your time and this detailed reply.

My implementation is old and should probably be updated.

I will read your email carefully and I come back to you with a better implementation.

Thanks,
Loic

17 mai 2022 16:53:37 Dave May <dave.mayhem23 at gmail.com>:

> Dear Loic,
> 
> I can confirm that PCTELESCOPE works nicely when using KSPSetComputeOperators.
> Here is an example
> 
> petsc-3.17.1/src/ksp/ksp/tutorials $ mpiexec -n 4 ./ex29 -pc_type mg -pc_mg_levels 2 -ksp_view -mg_coarse_pc_type telescope -mg_coarse_pc_telescope_reduction_factor 4 -da_grid_x  65 -da_grid_y 65 -mg_coarse_telescope_pc_type mg -mg_coarse_telescope_pc_mg_levels 2
> 
> There is no special code in ex29.c to make the above options run.
> 
> I must also apologize for sending you down the garden path with COARSEDM. That really isn't what you want to use - I am sorry for the confusion on my part.
> COARSEDM is intended for the case when YOU (or rather your coarse DM) define the sub-communicator, rather than having  PCTELESCOPE define the sub-communicator.
> 
> I believe that PCTELESCOPE should works with DMKSPSetComputeOperators().
> 
> The function you provide to DMKSPSetComputeOperators() is unusual in my opinion.
> Normally the method provided to DMKSPSetComputeOperators() just "assembles" (assembles meaning insert non-zero values for an AIJ or just calls MatAssemblyBegin/End for a matrix-free operator).
> However your method seems to set sizes, set methods and call SetFromOptions. These are typically things which should done when the matrix is created - not when it is being "assembled".
> 
> Maybe this is part of the reason your code isn't playing nicely with telescope.
> I think the code would be cleaner and if you overloaded your DMCreateMatrix() with a method which would return your matrix-free MATSHELL.
> 
> Yes I realize I am not directly helping solve your problem but maybe indirectly I am. Matt?
> 
> Cheers,
> Dave
> 
> 
> On Tue, 17 May 2022 at 13:18, Loic Gouarin <loic.gouarin at polytechnique.edu> wrote:
>> 
>> 
>> Le 17/05/2022 à 12:03, Dave May a écrit :
>> 
>> 
>> On Tue 17. May 2022 at 11:56, Loic Gouarin <loic.gouarin at polytechnique.edu> wrote:
>>> 
>>> Hi Dave,
>>> 
>>> could you explain what you mean by state ?
>>> 
>> 
>> Ah - by state Matt and I mean any auxiliary data stored in the user context passed to KSPSetComputeOperators which is required to define your operator and is distributed. For example, a Vec which is used store coefficients of your PDE.
>> 
>> Yes, I have a context which gives the operators (mult and diagonal) and some other informations to build the matrix free on each multigrid level.
>> 
>> You can find the idea here: https://github.com/gouarin/cafes/blob/master/cafes/problem/stokes.hpp#L49-L91
>> 
>> It's the definition of the operator used inside DMKSPComputeOperators.
>> 
>> Loic
>> 
>> 
>> 
>> 
>>> Thanks,
>>> 
>>> Loic
>>> 
>>> Le 17/05/2022 à 11:50, Dave May a écrit :
>>> Hi Loic,
>>> 
>>> Can you confirm if your problem has stored state which needs to be repartitioned?
>>> 
>>> Thanks,
>>> Dave
>>> 
>>> On Tue 17. May 2022 at 09:07, Loic Gouarin <loic.gouarin at polytechnique.edu> wrote:
>>>>-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20220517/17a6dbc5/attachment.html>


More information about the petsc-dev mailing list