[petsc-users] PC HYPRE BoomerAMG options for nodal

Barry Smith bsmith at mcs.anl.gov
Tue Feb 14 20:07:51 CST 2017


> On Feb 14, 2017, at 7:57 PM, Bernardo Rocha <bernardomartinsrocha at gmail.com> wrote:
> 
> No particular reason. Let's say it was the first approach I tried in an old code.
> 
> OK, so to get it working I should use the interlaced version for the ordering of my dofs.
> It does not require too much coding on my side.
> 
> Just to know, if I wanted to insist in the non-interlaced, to keep using Hypre/BoomerAMG from PETSc I would need to write some code in PETSc for wrapping this feature (AMGSetDofFunc), right?
> 
> Thanks.
> 
> On Tue, Feb 14, 2017 at 11:48 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   Ahh, thanks for the explanation. What a nutso API: way to general, they should just support interlaced and non-interlaced.
> 
>   Anyways we strongly recommend using the interlaced version; for most calculations it gives much better locality for cache lines and cache. We always use interlaced. Any particular reason you use non-interlaced?

   Yes, you would have to add a call to HYPRE_BoomerAMGSetDofFunc() with the information as you computed. For trying things out the easily way would be to just stick it in an appropriate place in hypre.c 

  Barry




> 
>   Barry
> 
> > On Feb 14, 2017, at 7:17 PM, Bernardo Rocha <bernardomartinsrocha at gmail.com> wrote:
> >
> > Thanks a lot for the reply.
> >
> > ​From my understanding and specifically for my problem I would have to use the AMGSetDofFunc as follows:​
> >
> > ​nsyseq = 3;​
> > for (i=0; i<nsyseq; i++)
> > ​    ​for (k=0; k<​N​; k++)​ // N: number of nodes​
> >     {
> >     ​    ​eqnIndex[i*​N​+k] = i;
> >     }
> > HYPRE_BoomerAMGSetDofFunc(preconditioner, eqnIndex);​
> >
> > For a system of 3 PDEs (e.g. linear elasticity in 3D​) the default behaviour of the nodal coarsening in BoomerAMG, considers an array that is filled with
> >
> > eqnIndex = ​0 1 2 0 1 2 0 1 2....0 1 2
> >
> >  > HYPRE_BoomerAMGSetDofFunc
> >
> >    I could not find an indication of that this is suppose to be setting; it is mentioned in the users manual but I don't know what it means. It looks like it takes an integer array but I don't even know how long that array is.
> >
> >    If you figure out what it means and can add support for it we'll take it as a pull request.
> >
> > ​​OK Barry, I will try to specify the block size of the matrix.
> > But I'm not sure if the block size would be 3 or N (number of nodes).
> > This is my ordering of the displacements: [ux1, ux2, ..., uxN, uy1, uy2,...uyN, uz1, uz2, ..., uzN]
> >
> > > HYPRE_BoomerAMGSetNumFunctions
> >
> >    Set the block size of the matrix; this information is then transferred automatically to hypre.  Note that you can set a block size even for AIJ matrices.
> > ​
> > ​Best regards,
> > Bernardo​
> 
> 



More information about the petsc-users mailing list