[petsc-users] petsc4py & GPU

Matthew Knepley knepley at gmail.com
Thu Apr 20 07:10:11 CDT 2017


On Thu, Apr 20, 2017 at 5:03 AM, Damian Kaliszan <damian at man.poznan.pl>
wrote:

> Hi,
>
> Currently  I'm  doing a simple Ax=b with KSP method and MPI by loading
> in parallel a data from file
>
> viewer = petsc4py.PETSc.Viewer().createBinary(Afilename, 'r')
> A = petsc4py.PETSc.Mat().load(viewer).
>
> (same for b & x vectors) and then calling a solver
>
> ksp.solve(b, x)
>
> I would like to do the same using GPU.
> I  changed respectively the above to
> viewer = petsc4py.PETSc.Viewer().createBinary(Afilename, 'r')
> A = PETSc.Mat().create(comm=comm)
> A.setType(PETSc.Mat.Type.MPIAIJCUSPARSE)
> A.load(viewer)
> ...
> What else needs to be changed?
> Running  the  above and checking nvidia-smi output confirms the python
> script and computations are done on CPU, not GPU as I 'd like to...
>

1) Make sure the Vec types are also for the GPU

2) Send the output of

  -ksp_view -log_view

  Thanks,

    Matt


> Any help would be appreciated.
>
> Best,
> Damian
>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170420/1f0aa7b6/attachment.html>


More information about the petsc-users mailing list