<html><head><title>Re: [petsc-users] petsc4py & GPU</title>
</head>
<body>
<span style=" font-family:'courier new'; font-size: 9pt;">Hi,<br>
<br>
Thank you for reply:) Sorry for maybe stupid question in the scope of setting petsc(4py) options.<br>
Should the following calls (somewhere before creating matrix & vectors):<br>
<br>
PETSc.Options().setValue("ksp_view", "")<br>
PETSc.Options().setValue("log_view", "")<br>
<br>
<br>
<span style=" font-family:'Tahoma'; font-size: 10pt;">be enough to enable extended output?<br>
<br>
Best,<br>
Damian <br>
<br>
<br>
<span style=" font-family:'courier new'; font-size: 9pt;">W liście datowanym 20 kwietnia 2017 (14:10:11) napisano:<br>
<br>
</span></span></span><table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'tahoma'; font-size: 10pt;">On Thu, Apr 20, 2017 at 5:03 AM, Damian Kaliszan <</span><a style=" font-family:'tahoma'; font-size: 10pt;" href="mailto:damian@man.poznan.pl">damian@man.poznan.pl</a><span style=" font-family:'tahoma'; font-size: 10pt;">> wrote:<br>
Hi,<br>
<br>
Currently  I'm  doing a simple Ax=b with KSP method and MPI by loading<br>
in parallel a data from file<br>
<br>
viewer = petsc4py.PETSc.Viewer().createBinary(Afilename, 'r')<br>
A = petsc4py.PETSc.Mat().load(viewer).<br>
<br>
(same for b & x vectors) and then calling a solver<br>
<br>
ksp.solve(b, x)<br>
<br>
I would like to do the same using GPU.<br>
I  changed respectively the above to<br>
viewer = petsc4py.PETSc.Viewer().createBinary(Afilename, 'r')<br>
A = PETSc.Mat().create(comm=comm)<br>
A.setType(PETSc.Mat.Type.MPIAIJCUSPARSE)<br>
A.load(viewer)<br>
...<br>
What else needs to be changed?<br>
Running  the  above and checking nvidia-smi output confirms the python<br>
script and computations are done on CPU, not GPU as I 'd like to...<br>
<br>
1) Make sure the Vec types are also for the GPU<br>
<br>
2) Send the output of<br>
<br>
  -ksp_view -log_view<br>
<br>
  Thanks,<br>
<br>
    Matt<br>
 <br>
Any help would be appreciated.<br>
<br>
Best,<br>
Damian<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</td>
</tr>
</table>
<br><br>
<br>
<br>
<span style=" font-family:'Tahoma'; font-size: 10pt;">-------------------------------------------------------<br>
Damian Kaliszan<br>
<br>
Poznan Supercomputing and Networking Center<br>
HPC and Data Centres Technologies<br>
ul. Jana Pawła II 10<br>
61-139 Poznan<br>
POLAND<br>
<br>
phone (+48 61) 858 5109<br>
e-mail </span><a style=" font-family:'courier new'; font-size: 9pt;" href="mailto:damian@man.poznan.pl">damian@man.poznan.pl</a><br>
<span style=" font-family:'courier new'; font-size: 9pt;">www - </span><a style=" font-family:'courier new'; font-size: 9pt;" href="http://www.man.poznan.pl/">http://www.man.poznan.pl/</a><br>
<span style=" font-family:'courier new'; font-size: 9pt;">------------------------------------------------------- </body></html>