Sam, You can pass a simple C function to PetscPushErrorHandler() that prints the top message and then immediately aborts to get the effect you want. But I agree with Dave you lose a lot of useful information by producing such a simple error message.
Barry > On Mar 16, 2021, at 5:43 PM, Dave May <dave.mayhe...@gmail.com> wrote: > > > > On Tue, 16 Mar 2021 at 19:50, Sam Guo <sam....@cd-adapco.com > <mailto:sam....@cd-adapco.com>> wrote: > Dear PETSc dev team, > When there is an PETSc error, I go following overly verbose error message. > Is it possible to get a simple error message like "Initial vector is zero or > belongs to the deflection space"? > > > When an error occurs and the execution is halted, a verbose and informative > error message is shown. > I would argue this is useful (very useful), and should never ever be > shortened or truncated. > > This error thrown by PETSc gives you a stack trace. You can see where the > error occurred, and the calling code which resulted in the error. In anything > but a trivial code, this information is incredibly useful to isolate and fix > the problem. I also think it's neat that you see the stack without having to > even use a debugger. > > Currently if your code does not produce errors, no message is displayed. > However, when an error occurs, a loud, long and informative message is > displayed - and the code stops. > What is the use case which would cause / require you to change the current > behaviour? > > Thanks, > Dave > > > Thanks, > Sam > > [0]PETSC ERROR: --------------------- Error Message > -------------------------------------------------------------- > [0]PETSC ERROR: Initial vector is zero or belongs to the deflation space > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html > <http://www.mcs.anl.gov/petsc/documentation/faq.html> for trouble shooting. > [0]PETSC ERROR: Petsc Release Version 3.11.3, Jun, 26, 2019 > [0]PETSC ERROR: Unknown Name on a arch-starccmplus_serial_real named > pl2denbg0033pc.net.plm.eds.com <http://pl2denbg0033pc.net.plm.eds.com/> by > cd3ppw Tue Mar 16 16:19:28 2021 > [0]PETSC ERROR: Configure options --with-x=0 --with-fc=0 --with-debugging=0 > --with-blaslapack-dir=/usr/local/jenkins/dev1/mkl/2017.2-cda-001/linux/lib/intel64/../.. > --with-mpi=0 -CFLAGS=-O3 -CXXFLAGS=-O3 --with-clean=1 --force > --with-scalar-type=real > [0]PETSC ERROR: #1 > <https://stash.cd-adapco.com/projects/UPS/repos/star/pull-requests/1> > EPSGetStartVector() line 806 in ../../../slepc/src/eps/interface/epssolve.c > [0]PETSC ERROR: #2 > <https://stash.cd-adapco.com/projects/UPS/repos/star/pull-requests/2> > EPSSolve_KrylovSchur_Default() line 259 in > ../../../slepc/src/eps/impls/krylov/krylovschur/krylovschur.c > [0]PETSC ERROR: #3 > <https://stash.cd-adapco.com/projects/UPS/repos/star/pull-requests/3> > EPSSolve() line 149 in ../../../slepc/src/eps/interface/epssolve.c