[petsc-users] Hypre runtime switch CPU/GPU

Mark Adams mfadams at lbl.gov
Thu Oct 7 06:09:35 CDT 2021


I'm not sure, but I suspect that Hypre does not support runtime switching
and our model is that you can switch at runtime. This leads to an
inconsistency.

If we remove -mat_type hypre then your issue would go away but 1) we would
have to add it back if hypre supports runtime switching in the future, and
break everyone's input decks, and 2) it would be inconsistent with the
PETSc model.

I could see throwing an error if you do not use -mat_type hypre and are
configured for GPUs.

Mark

On Wed, Oct 6, 2021 at 3:31 PM Milan Pelletier via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear PETSc users,
>
> Is there a way to switch a runtime setting for PETSc+Hypre to run on CPU,
> even when it has been compiled to allow for GPU support?
> I looks like setting the matrix and vector types to respectively "seqaij"
> and "seq" results in GPU computation when Hypre is used as a
> preconditioner. I thought GPU would be used only when mat_type is set to
> "hypre", following the examples provided with the last release.
>
> Thanks for the help,
> Best regards,
>
> Milan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211007/246689a2/attachment.html>


More information about the petsc-users mailing list