<div dir="ltr">Apologies, I realized that minutes after I hit the send button. My understanding was that both needed to be user together, but from your email it's clear that's not the case. After testing the solver without the preconditioner, but with EW enabled within SNES, everything's working as expected.<div><br></div><div>Thank you, and sorry for the noise!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 15 oct. 2020 a las 15:10, Jed Brown (<<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Héctor Barreiro Cabrera <<a href="mailto:hecbarcab@gmail.com" target="_blank">hecbarcab@gmail.com</a>> writes:<br>
<br>
> Hello fellow PETSc users,<br>
><br>
> Following up my previous email<br>
> <<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2020-September/042511.html" rel="noreferrer" target="_blank">https://lists.mcs.anl.gov/pipermail/petsc-users/2020-September/042511.html</a>>,<br>
> I managed to feed the entry data to a SeqAICUSPARSE matrix through a CUDA<br>
> kernel using the new MatCUSPARSEGetDeviceMatWrite function (thanks Barry<br>
> Smith and Mark Adams!). However, I am now facing problems when trying to<br>
> use this matrix within a SNES solver with the Eisenstat-Walker method<br>
> enabled.<br>
<br>
Before going further, the error message makes this look like you're using -pc_type eisenstat (a "trick" to reduce the cost of Gauss-Seidel with Krylov) rather than -snes_ksp_ew (the Eisenstat-Walker method for tuning linear solver tolerances within SNES). Is this what you intend?<br>
<br>
> According to PETSc's error log, the preconditioner is failing to invert the<br>
> matrix diagonal. Specifically it says that:<br>
> [0]PETSC ERROR: Arguments are incompatible<br>
> [0]PETSC ERROR: Zero diagonal on row 0<br>
> [0]PETSC ERROR: Configure options PETSC_ARCH=win64_vs2019_release<br>
> --with-cc="win32fe cl" --with-cxx="win32fe cl" --with-clanguage=C++<br>
> --with-fc=0 --with-mpi=0 --with-cuda=1 --with-cudac="win32fe nvcc"<br>
> --with-cuda-dir=~/cuda --download-f2cblaslapack=1 --with-precision=single<br>
> --with-64-bit-indices=0 --with-single-library=1 --with-endian=little<br>
> --with-debugging=0 --with-x=0 --with-windows-graphics=0<br>
> --with-shared-libraries=1 --CUDAOPTFLAGS=-O2<br>
><br>
> The stack trace leads to the diagonal inversion routine:<br>
> [0]PETSC ERROR: #1 MatInvertDiagonal_SeqAIJ() line 1913 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\mat\impls\aij\seq\aij.c<br>
> [0]PETSC ERROR: #2 MatSOR_SeqAIJ() line 1944 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\mat\impls\aij\seq\aij.c<br>
> [0]PETSC ERROR: #3 MatSOR() line 4005 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\mat\INTERF~1\matrix.c<br>
> [0]PETSC ERROR: #4 PCPreSolve_Eisenstat() line 79 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\ksp\pc\impls\eisens\eisen.c<br>
> [0]PETSC ERROR: #5 PCPreSolve() line 1549 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\ksp\pc\INTERF~1\precon.c<br>
> [0]PETSC ERROR: #6 KSPSolve_Private() line 686 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\ksp\ksp\INTERF~1\itfunc.c<br>
> [0]PETSC ERROR: #7 KSPSolve() line 889 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\ksp\ksp\INTERF~1\itfunc.c<br>
> [0]PETSC ERROR: #8 SNESSolve_NEWTONLS() line 225 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\snes\impls\ls\ls.c<br>
> [0]PETSC ERROR: #9 SNESSolve() line 4567 in<br>
> C:\cygwin64\home\HBARRE~1\PETSC-~1\src\snes\INTERF~1\snes.c<br>
><br>
> I am 100% positive that the diagonal does not contain a zero entry, so my<br>
> suspicions are either that this operation is not supported on the GPU at<br>
> all (MatInvertDiagonal_SeqAIJ seems to access host-side memory) or that I<br>
> am missing some setting to make this work on the GPU. Is this correct?<br>
><br>
> Thanks!<br>
><br>
> Cheers,<br>
> Héctor<br>
</blockquote></div>