[petsc-users] petsc4py & GPU

Matthew Knepley knepley at gmail.com
Thu Apr 20 10:26:34 CDT 2017


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

> Hi,
>
> Thank you for reply:) Sorry for maybe stupid question in the scope of
> setting petsc(4py) options.
> Should the following calls (somewhere before creating matrix & vectors):
>
> PETSc.Options().setValue("ksp_view", "")
> PETSc.Options().setValue("log_view", "")
>
>
> be enough to enable extended output?
>

I think so, but why not just give them on the command line?

  Thanks,

    Matt


> Best,
> Damian
>
>
> W liście datowanym 20 kwietnia 2017 (14:10:11) napisano:
>
>
> 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
>
>
>
> -------------------------------------------------------
> Damian Kaliszan
>
> Poznan Supercomputing and Networking Center
> HPC and Data Centres Technologies
> ul. Jana Pawła II 10
> 61-139 Poznan
> POLAND
>
> phone (+48 61) 858 5109 <+48%2061%20858%2051%2009>
> e-mail damian at man.poznan.pl
> www - http://www.man.poznan.pl/
> -------------------------------------------------------
>



-- 
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/8c391b11/attachment.html>


More information about the petsc-users mailing list