[petsc-users] Hypre AMS usage

Stefano Zampini stefano.zampini at gmail.com
Mon Sep 9 11:02:24 CDT 2024


I would say the best way is to look at the source code

https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/hypre/hypre.c?ref_type=heads*L2061__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7BSgg7vg$ 
https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/hypre/hypre.c?ref_type=heads*L1239__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7I5s85AM$ 

Il giorno lun 9 set 2024 alle ore 18:50 Matthew Knepley <knepley at gmail.com>
ha scritto:

> On Mon, Sep 9, 2024 at 10:17 AM Karthikeyan Chockalingam - STFC UKRI <
> karthikeyan.chockalingam at stfc.ac.uk> wrote:
>
>> Hi Matt,
>>
>>
>>
>> You mentioned it doesn’t hurt to set the smoothing flags
>>
>>
>>
>>
>> https://urldefense.us/v3/__https://github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L965__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7ymdPBOQ$ 
>> <https://urldefense.us/v3/__https:/github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L965__;Iw!!G_uCfscf7eWS!biuCOXkV-qD-e8iTXiwaD9XJ0EWuqr2PidZJdPqbnFzCshQFo-mclGSvGBOPuGSTkjPvMKnIfJzWos7QShcSitpwyrhL55yOMB-v$>
>>
>> Do you know where I can look for the equivalent PETSc commands? Thank you.
>>
>
> Yes, this is described here:
> https://urldefense.us/v3/__https://petsc.org/main/manualpages/PC/PCHYPRE/__;!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7oW09bmM$ 
> <https://urldefense.us/v3/__https://petsc.org/main/manualpages/PC/PCHYPRE/__;!!G_uCfscf7eWS!dM_jKT_vX0NCVNcY9XOTTUaTSW-TF2CgOkB2UDeZ2ztYXapdmLlSBT4XhV7PknN3ewygGWDbKFEP9e0RfePC$>
> The best way is to run with -help or look at the source.
>
>   Thanks,
>
>      Matt
>
>
>>
>>
>> Kind regards,
>>
>> Karthik.
>>
>>
>>
>> *From: *Matthew Knepley <knepley at gmail.com>
>> *Date: *Friday, 6 September 2024 at 17:57
>> *To: *Chockalingam, Karthikeyan (STFC,DL,HC) <
>> karthikeyan.chockalingam at stfc.ac.uk>
>> *Cc: *petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
>> *Subject: *Re: [petsc-users] Hypre AMS usage
>>
>> On Fri, Sep 6, 2024 at 11:37 AM Karthikeyan Chockalingam - STFC UKRI via
>> petsc-users <petsc-users at mcs.anl.gov> wrote:
>>
>> Hello,
>>
>>
>>
>> I am trying to use the Hypre AMS preconditioner for the first time.
>>
>>
>>
>> I am following the example problem from Hypre
>>
>>
>> https://urldefense.us/v3/__https://github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L954__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf73VDWhpc$ 
>> <https://urldefense.us/v3/__https:/github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L954__;Iw!!G_uCfscf7eWS!biuCOXkV-qD-e8iTXiwaD9XJ0EWuqr2PidZJdPqbnFzCshQFo-mclGSvGBOPuGSTkjPvMKnIfJzWos7QShcSitpwyrhL5ySgA0XM$>
>>
>>
>>
>> I have so far successfully set the discrete gradient operator and vertex
>> co-ordinates,
>>
>>
>>
>> // Set discrete gradient
>>
>>   petscErr = PCHYPRESetDiscreteGradient(pc, par_G);
>>
>>
>>
>>   // Set vertex coordinates
>>
>>   petscErr = PCHYPRESetEdgeConstantVectors(pc, par_xvec, par_yvec,
>> par_zvec);
>>
>>
>>
>> Do I need to set the following smoothing options?
>>
>>
>> https://urldefense.us/v3/__https://github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L965__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7ymdPBOQ$ 
>> <https://urldefense.us/v3/__https:/github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L965__;Iw!!G_uCfscf7eWS!biuCOXkV-qD-e8iTXiwaD9XJ0EWuqr2PidZJdPqbnFzCshQFo-mclGSvGBOPuGSTkjPvMKnIfJzWos7QShcSitpwyrhL55yOMB-v$>
>>
>>
>>
>> It cannot hurt. I would set them to begin with.
>>
>>
>>
>> Also, do I need to convert from MATMPIAIJ to CSR?
>>
>>
>> https://urldefense.us/v3/__https://github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L984__;Iw!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7wD78NAo$ 
>> <https://urldefense.us/v3/__https:/github.com/hypre-space/hypre/blob/3caa81955eb8d1b4e35d9b450e27cf6d07b50f6e/src/examples/ex15.c*L984__;Iw!!G_uCfscf7eWS!biuCOXkV-qD-e8iTXiwaD9XJ0EWuqr2PidZJdPqbnFzCshQFo-mclGSvGBOPuGSTkjPvMKnIfJzWos7QShcSitpwyrhL53Trv1si$>
>>
>>
>>
>> No.
>>
>>
>>
>> What are the other PETSc calls to invoke AMS? Is there an example problem
>> I can look at?
>>
>>
>>
>> I do not know. I don't think we have an example.
>>
>>
>>
>>   Thanks,
>>
>>
>>
>>     Matt
>>
>>
>>
>> Thank you.
>>
>>
>>
>> Karthik.
>>
>>
>>
>> --
>>
>> *Karthik Chockalingam, Ph.D.*
>>
>> Senior Research Software Engineer
>>
>> High Performance Systems Engineering Group
>>
>> Hartree Centre | Science and Technology Facilities Council
>>
>> karthikeyan.chockalingam at stfc.ac.uk
>>
>>
>>
>>  [image: signature_3970890138]
>>
>>
>>
>>
>>
>>
>> --
>>
>> 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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7uDER6bU$ 
>> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dM_jKT_vX0NCVNcY9XOTTUaTSW-TF2CgOkB2UDeZ2ztYXapdmLlSBT4XhV7PknN3ewygGWDbKFEP9ZyhqOzc$>
>>
>
>
> --
> 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://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!b8Tv_XEoRSSehhvrYTELfhg0W08IjaDPGx3gkioYVRlIia4rZz7XLH7GXmXmEbathoNXMMfFaU8hWftak1IUQLf7uDER6bU$ 
> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!dM_jKT_vX0NCVNcY9XOTTUaTSW-TF2CgOkB2UDeZ2ztYXapdmLlSBT4XhV7PknN3ewygGWDbKFEP9ZyhqOzc$>
>


-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240909/343d7e6b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 18270 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240909/343d7e6b/attachment-0001.png>


More information about the petsc-users mailing list