[petsc-users] MATSETVALUES: Fortran problem

Matthew Knepley knepley at gmail.com
Fri Mar 15 09:25:01 CDT 2024


On Fri, Mar 15, 2024 at 9:55 AM Frank Bramkamp <bramkamp at nsc.liu.se> wrote:

> Dear PETSc Team, I am using the latest petsc version 3. 20. 5. I would
> like to create a matrix using MatCreateSeqAIJ To insert values, I use
> MatSetValues. It seems that the Fortran interface/stubs are missing for
> MatsetValues, as the linker does
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
>
> ZjQcmQRYFpfptBannerEnd
>
> Dear PETSc Team,
>
> I am using the latest petsc version 3.20.5.
>
>
> I would like to create a matrix using
> MatCreateSeqAIJ
>
> To insert values, I use MatSetValues.
> It seems that the Fortran interface/stubs are missing for MatsetValues, as the linker does not find any subroutine with that name.
> MatSetValueLocal seems to be fine.
>
>
Here is a Fortran example calling MatSetValues():


https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex1f.F90?ref_type=heads__;!!G_uCfscf7eWS!ag7gfsg4qE_beGvp2_VPt5PyN1bZcFr8xkVlbukEpUnqYHx_awYDepWWZfT-7rtVF5-lHC2GXj1ETtSIaOLc$ 


> Typically I am using a blocked matrix format (BAIJ), which works fine in fortran.
> Soon we want to try PETSC on GPUs, using the format MATAIJCUSPARSE, since there seems not to be a blocked format available in PETSC for GPUs so far.
>
> You can use the blocked input API, like MatSetValuesBlocked(), with all
the storage formats. There is no explicit blocking in the MATAIJCUSPARSE format
because Nvidia handles the optimization differently.

  Thanks,

     Matt

Therefore I first want to try the pointwise format MatCreateSeqAIJ
format on a CPU, before using the GPU format.
>
> I think that CUDA also supports a block format now ?! Maybe that would be also useful to have one day.
>
>
> Greetings, Frank Bramkamp
>
>
>
>
>
>
>
>

-- 
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!ag7gfsg4qE_beGvp2_VPt5PyN1bZcFr8xkVlbukEpUnqYHx_awYDepWWZfT-7rtVF5-lHC2GXj1ETryTqsT3$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ag7gfsg4qE_beGvp2_VPt5PyN1bZcFr8xkVlbukEpUnqYHx_awYDepWWZfT-7rtVF5-lHC2GXj1ETjfW9H4P$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240315/ac6edbca/attachment.html>


More information about the petsc-users mailing list