<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> The reference implementation of LAPACK tries a divide by zero in its setup to see if it can divide by zero and that is happening for you. <div class=""><br class=""></div><div class=""> Hence the PETSc code has</div><div class=""><br class=""></div><div class=""><div class=""> ierr = PetscFPTrapPush(PETSC_FP_TRAP_OFF);CHKERRQ(ierr);</div><div class="">#if !defined(PETSC_USE_COMPLEX)</div><div class=""> PetscStackCallBLAS("LAPACKgesvd",LAPACKgesvd_("N","N",&bn,&bn,R,&bN,realpart,&sdummy,&idummy,&sdummy,&idummy,work,&lwork,&lierr));</div><div class="">#else</div><div class=""> PetscStackCallBLAS("LAPACKgesvd",LAPACKgesvd_("N","N",&bn,&bn,R,&bN,realpart,&sdummy,&idummy,&sdummy,&idummy,work,&lwork,realpart+N,&lierr));</div><div class="">#endif</div><div class=""> if (lierr) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in SVD Lapack routine %d",(int)lierr);</div><div class=""> ierr = PetscFPTrapPop();CHKERRQ(ierr);</div><div class=""><br class=""></div><div class="">which is suppose to turn off the trapping. The code that turns off the trapping is OS dependent, perhaps it does not work for you.</div><div class=""><br class=""></div><div class="">There is a bit better code in the current release than 3.11 I recommend you first upgrade.</div><div class=""><br class=""></div><div class="">What system are you running on?</div><div class=""><br class=""></div><div class="">Barry</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 22, 2020, at 2:12 PM, baikadi pranay <<a href="mailto:pranayreddy865@gmail.com" class="">pranayreddy865@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<br class=""><br class="">I am trying to find the condition number of the A matrix for a linear system I am solving. I have used the following commands.<br class=""><b class="">./a.out -ksp_monitor_singular_value -ksp_type gmres -ksp_gmres_restart 1000 -pc_type none<br class=""></b>However, the execution comes to a halt after a few iterations with the following error.<br class="">[0]PETSC ERROR: ------------------------------------------------------------------------<br class="">[0]PETSC ERROR: Caught signal number 8 FPE: Floating Point Exception,probably divide by zero<br class="">[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br class="">[0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" class="">http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind</a><br class="">[0]PETSC ERROR: or try <a href="http://valgrind.org/" class="">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors<br class="">[0]PETSC ERROR: likely location of problem given in stack below<br class="">[0]PETSC ERROR: --------------------- Stack Frames ------------------------------------<br class="">[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br class="">[0]PETSC ERROR: INSTEAD the line number of the start of the function<br class="">[0]PETSC ERROR: is given.<br class="">[0]PETSC ERROR: [0] LAPACKgesvd line 40 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/gmres/gmreig.c<br class="">[0]PETSC ERROR: [0] KSPComputeExtremeSingularValues_GMRES line 22 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/gmres/gmreig.c<br class="">[0]PETSC ERROR: [0] KSPComputeExtremeSingularValues line 59 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c<br class="">[0]PETSC ERROR: [0] KSPMonitorSingularValue line 130 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/iterativ.c<br class="">[0]PETSC ERROR: [0] KSPMonitor line 1765 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c<br class="">[0]PETSC ERROR: [0] KSPGMRESCycle line 122 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/gmres/gmres.c<br class="">[0]PETSC ERROR: [0] KSPSolve_GMRES line 225 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/impls/gmres/gmres.c<br class="">[0]PETSC ERROR: [0] KSPSolve line 678 /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c<br class="">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[0]PETSC ERROR: Signal received<br class="">[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" class="">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br class="">[0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019 <br class="">[0]PETSC ERROR: ./a.out on a linux-gnu-c-debug named <a href="http://cg17-9.agave.rc.asu.edu/" class="">cg17-9.agave.rc.asu.edu</a> by pbaikadi Thu Oct 22 12:07:11 2020<br class="">[0]PETSC ERROR: Configure options <br class="">[0]PETSC ERROR: #1 User provided function() line 0 in unknown file<br class="">--------------------------------------------------------------------------<br class="">MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD<br class="">with errorcode 59.<br class=""><br class="">NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.<br class="">You may or may not see output from other processes, depending on<br class="">exactly when Open MPI kills them.<br class="">--------------------------------------------------------------------------<br class="">Is the error because the A matrix is singular (causing the max/min to be undefined)? Please let me know.<br class=""><br class="">Thank you,<br class="">Sincerely,<br class="">Pranay.</div><div hspace="streak-pt-mark" style="max-height:1px" class=""><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=acHJhbmF5cmVkZHk4NjVAZ21haWwuY29t&type=zerocontent&guid=33fb9da7-dac7-45e1-b238-96ec42a38e02" class=""><font color="#ffffff" size="1" class="">ᐧ</font></div>
</div></blockquote></div><br class=""></div></div></body></html>