<div dir="ltr">Barry, I do NOT see communication. This is what made me think it was not running on the GPU. I added print statements and found that MatSolverTypeRegister_CUSPARSE IS called but (what it registers) MatGetFactor_seqaijcusparse_cusparse does NOT get called.<div><br></div><div>I have a job waiting on the queue. I'll send ksp_view when it runs. I will try -mg_coarse_mat_solver_type cusparse. That is probably the problem. Maybe I should set the coarse grid solver in a more robust way in GAMG, like use the matrix somehow? I currently use PCSetType(pc, PCLU).</div><div><br></div><div>I can't get an interactive shell now to run DDT, but I can try stepping through from MatGetFactor to see what its doing.</div><div><br></div><div>Thanks,</div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 21, 2019 at 11:14 AM Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Jul 21, 2019, at 8:55 AM, Mark Adams via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
> <br>
> I am running ex56 with -ex56_dm_vec_type cuda -ex56_dm_mat_type aijcusparse and I see no GPU communication in MatSolve (the serial LU coarse grid solver).<br>
<br>
   Do you mean to say, you DO see communication?<br>
<br>
   What does -ksp_view should you? It should show the factor type in the information about the coarse grid solve?<br>
<br>
   You might need something like -mg_coarse_mat_solver_type cusparse  (because it may default to the PETSc one, it may be possible to have it default to the cusparse if it exists and the matrix is of type MATSEQAIJCUSPARSE).<br>
<br>
   The determination of the MatGetFactor() is a bit involved including pasting together strings and string compares and could be finding a CPU factorization.<br>
<br>
   I could run on one MPI_Rank() in the debugger and put a break point in MatGetFactor() and track along to see what it picks and why. You could do this debugging without GAMG first, just -pc_type lu  <br>
<br>
> GAMG does set the coarse grid solver to LU manually like this: ierr = PCSetType(pc2, PCLU);CHKERRQ(ierr);<br>
<br>
  For parallel runs this won't work using the GPU code and only sequential direct solvers, so it must using BJACOBI in that case?<br>
<br>
   Barry<br>
<br>
<br>
<br>
<br>
<br>
> I am thinking the dispatch of the CUDA version of this got dropped somehow. <br>
> <br>
> I see that this is getting called:<br>
> <br>
> PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_CUSPARSE(void)<br>
> {<br>
>   PetscErrorCode ierr;<br>
> <br>
>   PetscFunctionBegin;<br>
>   ierr = MatSolverTypeRegister(MATSOLVERCUSPARSE,MATSEQAIJCUSPARSE,MAT_FACTOR_LU,MatGetFactor_seqaijcusparse_cusparse);CHKERRQ(ierr);<br>
>   ierr = MatSolverTypeRegister(MATSOLVERCUSPARSE,MATSEQAIJCUSPARSE,MAT_FACTOR_CHOLESKY,MatGetFactor_seqaijcusparse_cusparse);CHKERRQ(ierr);<br>
>   ierr = MatSolverTypeRegister(MATSOLVERCUSPARSE,MATSEQAIJCUSPARSE,MAT_FACTOR_ILU,MatGetFactor_seqaijcusparse_cusparse);CHKERRQ(ierr);<br>
>   ierr = MatSolverTypeRegister(MATSOLVERCUSPARSE,MATSEQAIJCUSPARSE,MAT_FACTOR_ICC,MatGetFactor_seqaijcusparse_cusparse);CHKERRQ(ierr);<br>
>   PetscFunctionReturn(0);<br>
> }<br>
> <br>
> but MatGetFactor_seqaijcusparse_cusparse is not getting  called.<br>
> <br>
> GAMG does set the coarse grid solver to LU manually like this: ierr = PCSetType(pc2, PCLU);CHKERRQ(ierr);<br>
> <br>
> Any ideas?<br>
> <br>
> Thanks,<br>
> Mark<br>
> <br>
> <br>
<br>
</blockquote></div>