[petsc-users] About KSPConvergedReasonView

Thibaut Appel t.appel17 at imperial.ac.uk
Thu Aug 27 10:25:40 CDT 2020


Dear PETSc users,

I found out that (at least in the master branch) that KSPReasonView has 
been recently deprecated in favor of KSPConvergedReasonView.

After changing my application code, I thought I was using the function 
correctly:

     CALL KSPGetConvergedReason(ksp,ksp_reason,ierr)
     CHKERRA(ierr)

     IF (ksp_reason < 0) THEN

       CALL 
KSPConvergedReasonView(ksp,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_DEFAULT,ierr)
       CHKERRA(ierr)

     END IF

but I still get the following backtrace

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff51dea59 in PetscObjectTypeCompare (obj=0x8,
     type_name=0x7ffff75b5b88 "ascii", same=0x7fffffffd7b8)
     at /home/Packages/petsc/src/sys/objects/destroy.c:160
160      else if (!type_name || !obj->type_name) *same = PETSC_FALSE;
(gdb) bt
#0  0x00007ffff51dea59 in PetscObjectTypeCompare (obj=0x8,
     type_name=0x7ffff75b5b88 "ascii", same=0x7fffffffd7b8)
     at /home/Packages/petsc/src/sys/objects/destroy.c:160
#1  0x00007ffff6ba1d83 in KSPConvergedReasonView (ksp=0x555555bb2510, 
viewer=0x8,
     format=PETSC_VIEWER_DEFAULT)
     at /home/Packages/petsc/src/ksp/ksp/interface/itfunc.c:452
#2  0x00007ffff6beb37a in kspconvergedreasonview_ (
     ksp=0x55555593f3c0 <__solver_MOD_ksp>, viewer=0x7fffffffda50,
     format=0x5555558fae48, __ierr=0x7fffffffda6c)
     at /home/Packages/petsc/src/ksp/ksp/interface/ftn-auto/itfuncf.c:295
#3  0x00005555555e040d in solver::solve_linear_problem (vec_rhs=..., 
vec_sol=...)
     at mod_solver.F90:1872
#4  0x0000555555614453 in solver::solve () at mod_solver.F90:164
#5  0x00005555555ba3c6 in main () at main.F90:67
#6  0x00005555555ba437 in main (argc=1, argv=0x7fffffffe17e) at main.F90:3
#7  0x00007ffff46fa1e3 in __libc_start_main ()
    from /usr/lib/x86_64-linux-gnu/libc.so.6
#8  0x000055555555cd7e in _start ()

as if there was a type mismatch. Could anyone pinpoint what's wrong?

Thank you,

Thibaut



More information about the petsc-users mailing list