<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 14, 2014 at 2:52 PM, Sharp Stone <span dir="ltr"><<a href="mailto:thronesf@gmail.com" target="_blank">thronesf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thank you for your replies.<div><br></div><div>If I use -<span style="font-family:arial,sans-serif;font-size:16.3636360168457px">fp_trap, </span>I still got the same type of errors as follows.</div><div>







<p>







</p><p>[0]PETSC ERROR: VecValidValues() line 34 in /Users/GPL/local/PETSc/petsc-3.5.2/src/vec/vec/interface/rvector.c Vec entry at local location 0 is not-a-number or infinite at end of function: Parameter number 3</p><p>If use <span style="font-family:arial,sans-serif;font-size:16.3636360168457px">-pc_type lu -ksp_type gmres</span> options, I got the zero pivot error as you suspected... Is there a way that can solve this problem? Thank you very much!</p><p></p></div></div></blockquote><div>You are trying to solve a singular system:</div><div><br></div><div>  <a href="https://www.khanacademy.org/math/precalculus/precalc-matrices/inverting_matrices/v/singular-matrices">https://www.khanacademy.org/math/precalculus/precalc-matrices/inverting_matrices/v/singular-matrices</a></div><div><br></div><div>Its not even clear what a solution would mean. I suggest starting with a problem for which you know the answer.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><p>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</p><p>[0]PETSC ERROR: Zero pivot in LU factorization: <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot</a></p>







<p>[0]PETSC ERROR: Zero pivot row 52 value 0 tolerance 2.22045e-14</p><p>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.</p><p>[0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014 </p><p>[0]PETSC ERROR: ./pStreamer on a arch-darwin-cxx-debug named <a href="http://host206-47.physci.fit.edu" target="_blank">host206-47.physci.fit.edu</a> by GPL Tue Oct 14 15:49:50 2014</p><p>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-clanguage=cxx --download-fblaslapack --download-mpich</p><p>[0]PETSC ERROR: #49 MatPivotCheck_none() line 622 in /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/matimpl.h</p><p>[0]PETSC ERROR: #50 MatPivotCheck() line 641 in /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/matimpl.h</p><p>[0]PETSC ERROR: #51 MatLUFactorNumeric_SeqAIJ_Inode() line 1713 in /Users/GPL/local/PETSc/petsc-3.5.2/src/mat/impls/aij/seq/inode.c</p><p>[0]PETSC ERROR: #52 MatLUFactorNumeric() line 2894 in /Users/GPL/local/PETSc/petsc-3.5.2/src/mat/interface/matrix.c</p><p>[0]PETSC ERROR: #53 PCSetUp_LU() line 152 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/impls/factor/lu/lu.c</p><p>[0]PETSC ERROR: #54 PCSetUp() line 902 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c</p><p>[0]PETSC ERROR: #55 KSPSetUp() line 305 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c</p><p>





















</p><p>[0]PETSC ERROR: #56 KSPSolve() line 417 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 3:18 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
  I am guessing that the local solver is ILU(0) and that the ILU(0) factorization is creating a NaN or Inf due to a zero pivot. What happens if you run with the command line option -fp_trap  ?<br>
<br>
   Also if this is a small problem you can run with -mat_view to have it display the factored matrix.<br>
<span><font color="#888888"><br>
  Barry<br>
</font></span><div><div><br>
On Oct 14, 2014, at 2:07 PM, Sharp Stone <<a href="mailto:thronesf@gmail.com" target="_blank">thronesf@gmail.com</a>> wrote:<br>
<br>
> Dear all,<br>
><br>
> I'm trying to solve a linear system with petsc ksp solver. But after I called the kspsolve routine, I always got the "Vec entry at local location 0 is not-a-number or infinite at end of function" errors below. I checked the matrix and the vectors, and they are all numbers (and zeros). Is this a bug or I miss something? Thank you very much in advance!<br>
><br>
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
><br>
> [0]PETSC ERROR: Floating point exception<br>
><br>
> [0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite at end of function: Parameter number 3<br>
><br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
><br>
> [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014<br>
><br>
> [0]PETSC ERROR: ./pStreamer on a arch-darwin-cxx-debug named <a href="http://host206-47.physci.fit.edu" target="_blank">host206-47.physci.fit.edu</a> by GPL Tue Oct 14 14:58:05 2014<br>
><br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --with-clanguage=cxx --download-fblaslapack --download-mpich<br>
><br>
> [0]PETSC ERROR: #12 VecValidValues() line 34 in /Users/GPL/local/PETSc/petsc-3.5.2/src/vec/vec/interface/rvector.c<br>
><br>
> [0]PETSC ERROR: #13 PCApply() line 442 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c<br>
><br>
> [0]PETSC ERROR: #14 KSP_PCApply() line 230 in /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/kspimpl.h<br>
><br>
> [0]PETSC ERROR: #15 KSPSolve_PREONLY() line 26 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/impls/preonly/preonly.c<br>
><br>
> [0]PETSC ERROR: #16 KSPSolve() line 459 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c<br>
><br>
> [0]PETSC ERROR: #17 PCApply_BJacobi_Singleblock() line 675 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/impls/bjacobi/bjacobi.c<br>
><br>
> [0]PETSC ERROR: #18 PCApply() line 440 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c<br>
><br>
> [0]PETSC ERROR: #19 KSP_PCApply() line 230 in /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/kspimpl.h<br>
><br>
> [0]PETSC ERROR: #20 KSPInitialResidual() line 56 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itres.c<br>
><br>
> [0]PETSC ERROR: #21 KSPSolve_BCGS() line 50 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/impls/bcgs/bcgs.c<br>
><br>
><br>
> [0]PETSC ERROR: #22 KSPSolve() line 459 in /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c<br>
><br>
><br>
> --<br>
> Best regards,<br>
><br>
<br><span class=""><font color="#888888">
</font></span></div></div></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Best regards,</div><div><br></div>Feng</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <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
</div></div>