[petsc-users] petsc4py & GPU
Damian Kaliszan
damian at man.poznan.pl
Thu Apr 20 05:03:16 CDT 2017
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...
Any help would be appreciated.
Best,
Damian
More information about the petsc-users
mailing list