<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>  Branch <b style="color: rgb(200, 20, 201); font-family: Menlo; font-size: 14px;" class="">barry/2020-08-29/fortran-stub-converged-reason-view</b> should fix this, soon to be in master.<div class=""><br class=""></div><div class="">  Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 28, 2020, at 6:11 AM, Thibaut Appel <<a href="mailto:t.appel17@imperial.ac.uk" class="">t.appel17@imperial.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 28/08/2020 10:52, Jose E. Roman wrote:<br class=""><blockquote type="cite" class="">Thibaut: the changes that Barry mentioned are already in master. Can you try?<br class=""><br class="">Barry: I think the issue is with the PetscViewer argument. KSPView() has a custom Fortran stub that calls PetscPatchDefaultViewers_Fortran(), but this is missing in KSPConvergedReasonView().<br class=""><br class="">Jose<br class=""></blockquote><br class="">I reconfigured/compiled PETSc from the most recent master branch an hour ago; the following compiles fine:<br class=""><br class="">    CALL KSPSolve(ksp,vec_rhs,vec_sol,ierr)<br class="">    CHKERRA(ierr)<br class=""><br class="">    CALL KSPGetConvergedReason(ksp,ksp_reason,ierr)<br class="">    CHKERRA(ierr)<br class=""><br class="">    CALL KSPConvergedReasonView(ksp,PETSC_VIEWER_STDOUT_WORLD,ierr)<br class="">    CHKERRA(ierr)<br class=""><br class="">but I still get a similar backtrace when KSPConvergedReasonView is called:<br class=""><br class="">Program received signal SIGSEGV, Segmentation fault.<br class="">0x00007ffff511e89c in PetscObjectTypeCompare (obj=0x8, type_name=0x7ffff7580128 "ascii",<br class="">    same=0x7fffffffd7c8) at /home/thibaut/Packages/petsc/src/sys/objects/destroy.c:160<br class="">160      else if (!type_name || !obj->type_name) *same = PETSC_FALSE;<br class="">(gdb) backtrace<br class="">#0  0x00007ffff511e89c in PetscObjectTypeCompare (obj=0x8, type_name=0x7ffff7580128 "ascii",<br class="">    same=0x7fffffffd7c8) at /home/Packages/petsc/src/sys/objects/destroy.c:160<br class="">#1  0x00007ffff66ed4d3 in KSPConvergedReasonView (ksp=0x555555b44860, viewer=0x8)<br class="">    at /home/Packages/petsc/src/ksp/ksp/interface/itfunc.c:455<br class="">#2  0x00007ffff6733fca in kspconvergedreasonview_ (ksp=0x5555559403c0 <__solver_MOD_ksp>,<br class="">    viewer=0x7fffffffda60, __ierr=0x7fffffffda6c)<br class="">    at /home/Packages/petsc/src/ksp/ksp/interface/ftn-auto/itfuncf.c:295<br class="">#3  0x00005555555e165d in solver::solve_linear_problem (vec_rhs=..., vec_sol=...)<br class="">    at mod_solver.F90:1867<br class="">#4  0x00005555556156fe in solver::solve () at mod_solver.F90:164<br class="">#5  0x00005555555bb8f3 in main () at main.F90:67<br class="">#6  0x00005555555bb964 in main (argc=1, argv=0x7fffffffe17d) at main.F90:3<br class="">#7  0x00007ffff46f71e3 in __libc_start_main () from /usr/lib/x86_64-linux-gnu/libc.so.6<br class="">#8  0x000055555555cd5e in _start ()<br class=""><br class="">Thibaut<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">El 27 ago 2020, a las 17:59, Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> escribió:<br class=""><br class=""><br class="">  This is probably due to the final argument being a character string which PETSc has difficulty managing by default for Fortran.<br class=""><br class="">  I just removed the format argument from the call so this problem will gone soon.<br class=""><br class="">  You could just comment out the call for now and put a print statement in instead.<br class=""><br class="">  The problem will be fixed as soon as my merge request gets into master.<br class=""><br class="">  Sorry about this.<br class=""><br class="">  Barry<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Aug 27, 2020, at 10:25 AM, Thibaut Appel <<a href="mailto:t.appel17@imperial.ac.uk" class="">t.appel17@imperial.ac.uk</a>> wrote:<br class=""><br class="">Dear PETSc users,<br class=""><br class="">I found out that (at least in the master branch) that KSPReasonView has been recently deprecated in favor of KSPConvergedReasonView.<br class=""><br class="">After changing my application code, I thought I was using the function correctly:<br class=""><br class="">    CALL KSPGetConvergedReason(ksp,ksp_reason,ierr)<br class="">    CHKERRA(ierr)<br class=""><br class="">    IF (ksp_reason < 0) THEN<br class=""><br class="">      CALL KSPConvergedReasonView(ksp,PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_DEFAULT,ierr)<br class="">      CHKERRA(ierr)<br class=""><br class="">    END IF<br class=""><br class="">but I still get the following backtrace<br class=""><br class="">Program received signal SIGSEGV, Segmentation fault.<br class="">0x00007ffff51dea59 in PetscObjectTypeCompare (obj=0x8,<br class="">    type_name=0x7ffff75b5b88 "ascii", same=0x7fffffffd7b8)<br class="">    at /home/Packages/petsc/src/sys/objects/destroy.c:160<br class="">160      else if (!type_name || !obj->type_name) *same = PETSC_FALSE;<br class="">(gdb) bt<br class="">#0  0x00007ffff51dea59 in PetscObjectTypeCompare (obj=0x8,<br class="">    type_name=0x7ffff75b5b88 "ascii", same=0x7fffffffd7b8)<br class="">    at /home/Packages/petsc/src/sys/objects/destroy.c:160<br class="">#1  0x00007ffff6ba1d83 in KSPConvergedReasonView (ksp=0x555555bb2510, viewer=0x8,<br class="">    format=PETSC_VIEWER_DEFAULT)<br class="">    at /home/Packages/petsc/src/ksp/ksp/interface/itfunc.c:452<br class="">#2  0x00007ffff6beb37a in kspconvergedreasonview_ (<br class="">    ksp=0x55555593f3c0 <__solver_MOD_ksp>, viewer=0x7fffffffda50,<br class="">    format=0x5555558fae48, __ierr=0x7fffffffda6c)<br class="">    at /home/Packages/petsc/src/ksp/ksp/interface/ftn-auto/itfuncf.c:295<br class="">#3  0x00005555555e040d in solver::solve_linear_problem (vec_rhs=..., vec_sol=...)<br class="">    at mod_solver.F90:1872<br class="">#4  0x0000555555614453 in solver::solve () at mod_solver.F90:164<br class="">#5  0x00005555555ba3c6 in main () at main.F90:67<br class="">#6  0x00005555555ba437 in main (argc=1, argv=0x7fffffffe17e) at main.F90:3<br class="">#7  0x00007ffff46fa1e3 in __libc_start_main ()<br class="">   from /usr/lib/x86_64-linux-gnu/libc.so.6<br class="">#8  0x000055555555cd7e in _start ()<br class=""><br class="">as if there was a type mismatch. Could anyone pinpoint what's wrong?<br class=""><br class="">Thank you,<br class=""><br class="">Thibaut<br class=""><br class=""></blockquote></blockquote></blockquote></div></div></blockquote></div><br class=""></div></body></html>