<div dir="ltr"><div class="gmail_extra">This is failing on a test for a data cache being NULL. It is not. It is in the reset routine, which might not be used by many people. This code is pretty stable as far as I know, but maybe someone changed something in here. This is probably a false positive -- you could just comment out that line ("<span style="font-size:12.8px">this should not happen, cleaned up in <span class="" id=":bn1.1" tabindex="-1">SetUp</span></span>") in <span class="" id=":bn1.2" tabindex="-1">gamg</span>.c:38</div><div class="gmail_extra"><br></div><div class="gmail_extra">This data is freed in a few places with something like:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span class="" id=":bn1.3" tabindex="-1">ierr</span> = <span class="" id=":bn1.4" tabindex="-1">PetscFree</span>(<span class="" id=":bn1.5" tabindex="-1">pc</span>_<span class="" id=":bn1.6" tabindex="-1">gamg</span>->data);<wbr><span class="" id=":bn1.7" tabindex="-1">CHKERRQ</span>(<span class="" id=":bn1.8" tabindex="-1">ierr</span>);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">But, not set to NULL.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Perhaps <span class="" id=":bn1.9" tabindex="-1">PetscFree</span> should be called with the address of the pointer so that it can NULL it or explicitly zeroed out.</div><div class="gmail_extra"><br></div><div class="gmail_extra">PETSc: what is the proper way to do this?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Mark</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 7, 2017 at 4:51 PM, Denis <span class="" id=":bn1.11" tabindex="-1">Davydov</span> <span dir="ltr"><<a href="mailto:davydden@gmail.com" target="_blank"><span class="" id=":bn1.12" tabindex="-1">davydden</span>@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br>
<br>
I rerun calculations (unit tests) which used to work with slightly older versions of PETSc/SLEPc (a year ago, or so) and<br>
see the  "KSPSolve has not converged” error for shift and invert transformation with gamg preconditioner (below).<br>
Shifted matrix is SPD, could have bad condition number but it worked before.<br>
<br>
Judging from a pre-last line in the log below, something is wrong with GAMG or its interaction with SLEPc.<br>
<br>
Regards,<br>
Denis.<br>
<br>
[0]PETSC ERROR: Configure options --prefix=/Users/davydden/spack<wbr>/opt/spack/darwin-sierra-x86_<wbr>64/clang-8.0.0-apple/petsc-3.<wbr>7.5-e35uxj5pf7ndtedbnzvq7dot5o<wbr>ie3psc --with-ssl=0 --with-x=0 --download-c2html=0 --download-sowing=0 --download-hwloc=0 --with-mpi=1 --with-mpi-dir=/Users/davydden<wbr>/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/openmpi-2.0.2-oos4cxprn2<wbr>bislzhc3rbc3lo4dadginw --with-precision=double --with-scalar-type=real --with-shared-libraries=1 --with-debugging=0 --with-64-bit-indices=0 --with-blas-lapack-lib=/Users/<wbr>davydden/spack/opt/spack/darwi<wbr>n-sierra-x86_64/clang-8.0.0-<wbr>apple/openblas-0.2.19-xg7etkjy<wbr>o7xjnvuojsdc2xoixesxoerh/lib/<wbr>libopenblas.dylib --with-metis=1 --with-metis-dir=/Users/davydd<wbr>en/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/metis-5.1.0-c2muo3b6k5ae<wbr>a2743g34s35u2ve23yxq --with-boost=0 --with-hdf5=1 --with-hdf5-dir=/Users/davydde<wbr>n/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/hdf5-1.10.0-patch1-kwkdk<wbr>p5mo4olqpkitojab3xg3xhl6gfz --with-hypre=1 --with-hypre-dir=/Users/davydd<wbr>en/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/hypre-2.11.1-dprfz6t4t24<wbr>wesj74dcfdtajwm5n5qzu --with-parmetis=1 --with-parmetis-dir=/Users/dav<wbr>ydden/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/parmetis-4.0.3-tm5dd6fqn<wbr>bw6hiepajhkvmqk42xrrgos --with-mumps=1 --with-mumps-dir=/Users/davydd<wbr>en/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/mumps-5.0.2-4pwiz7bplhnm<wbr>k2lfvg746u4pq4z5wuc3 --with-scalapack=1 --with-scalapack-dir=/Users/da<wbr>vydden/spack/opt/spack/darwin-<wbr>sierra-x86_64/clang-8.0.0-<wbr>apple/netlib-scalapack-2.0.2-g<wbr>u4tjf4bjvtia3ohzjqbickedmywqsl<wbr>k --with-superlu_dist-include=/U<wbr>sers/davydden/spack/opt/spack/<wbr>darwin-sierra-x86_64/clang-8.<wbr>0.0-apple/superlu-dist-5.1.1-h<wbr>ut4gapp5v6qzvjlqahattdvr3tyyno<wbr>y/include --with-superlu_dist-lib=/Users<wbr>/davydden/spack/opt/spack/<wbr>darwin-sierra-x86_64/clang-8.<wbr>0.0-apple/superlu-dist-5.1.1-h<wbr>ut4gapp5v6qzvjlqahattdvr3tyyno<wbr>y/lib/libsuperlu_dist.a --with-superlu_dist=1<br>
[0]PETSC ERROR: #1 KSPSolve() line 847 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-zUUkMX/petsc-3.7.5/src/ksp/<wbr>ksp/interface/itfunc.c<br>
[0]PETSC ERROR: #2 PCGAMGOptProlongator_AGG() line 1227 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-zUUkMX/petsc-3.7.5/src/ksp/<wbr>pc/impls/gamg/agg.c<br>
[0]PETSC ERROR: #3 PCSetUp_GAMG() line 581 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-zUUkMX/petsc-3.7.5/src/ksp/<wbr>pc/impls/gamg/gamg.c<br>
[0]PETSC ERROR: #4 PCSetUp() line 968 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-zUUkMX/petsc-3.7.5/src/ksp/<wbr>pc/interface/precon.c<br>
[0]PETSC ERROR: #5 KSPSetUp() line 390 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-zUUkMX/petsc-3.7.5/src/ksp/<wbr>ksp/interface/itfunc.c<br>
[0]PETSC ERROR: #6 STSetUp_Sinvert() line 153 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-5WvuFP/slepc-3.7.3/src/sys/<wbr>classes/st/impls/sinvert/sinve<wbr>rt.c<br>
[0]PETSC ERROR: #7 STSetUp() line 301 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-5WvuFP/slepc-3.7.3/src/sys/<wbr>classes/st/interface/stsolve.c<br>
[0]PETSC ERROR: #8 EPSSetUp() line 205 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-5WvuFP/slepc-3.7.3/src/eps/<wbr>interface/epssetup.c<br>
[0]PETSC ERROR: #9 EPSSolve() line 89 in /private/var/folders/5k/sqpp24<wbr>tx3ylds4fgm13pfht00000gn/T/<wbr>davydden/spack-stage/spack-sta<wbr>ge-5WvuFP/slepc-3.7.3/src/eps/<wbr>interface/epssolve.c<br>
***[0]PCReset_GAMG this should not happen, cleaned up in SetUp<br>
ERROR: Uncaught exception in MPI_InitFinalize on proc 0. Skipping MPI_Finalize() to avoid a deadlock.<br>
<br>
<br>
<br>
</blockquote></div><br></div></div>