<div dir="ltr">I emphasize that <span style="font-size:12.8px">snes/examples/tutorials/</span>ex1.c works perfectly with the option -snes_type fas.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-02 17:07 GMT+02:00 Karin&NiKo <span dir="ltr"><<a href="mailto:niko.karin@gmail.com" target="_blank">niko.karin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear All,<div><br></div><div>In order to ease the investigation, I reproduced this segfault by running snes/examples/tutorials/ex1f.F with the option -snes_type fas.</div><div>I have the feeling that this is due to the nullity of the context object of FormJacobian (PETSC_NULL_OBJECT in Fortran).</div><div><br></div><div>Best regards,</div><div>Nicolas</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-06-01 16:30 GMT+02:00 Karin&NiKo <span dir="ltr"><<a href="mailto:niko.karin@gmail.com" target="_blank">niko.karin@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Dear PETSc team,<br><br></div>I have interfaced our fortran legacy code with PETSC SNES. I mainly followed the examples you provide. What I conceptually used is : <br><br>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------<br><br> call SNESCreate(PETSC_COMM_WORLD,sn<wbr>es,ierr)<br><br> call SNESSetFromOptions(snes,ierr)<br><br> call SNESSETFunction(snes, pf, nonlinFormFunction, PETSC_NULL_OBJECT, ierr)<br><br> call SNESSetJacobian(snes, mat, mat, nonlinFormJacobian, PETSC_NULL_OBJECT, ierr)<br><br> call SNESSetKSP(snes, myksp, ierr)<br>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------<br><br></div>The code runs fine with -snes_type newtonls or newtontr. But when using -snes_type fas, it complains with the message : <br><br>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------<br>[0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>[0]PETSC ERROR: Corrupt argument: <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html#valgrind</a><br>[0]PETSC ERROR: Fortran callback not set on this object<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/d<wbr>ocumentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.7.2, Jun, 05, 2016 <br>[0]PETSC ERROR: <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> on a arch-linux2-c-debug named dsp0780450 by niko Thu Jun 1 16:18:43 2017<br>[0]PETSC ERROR: Configure options --prefix=/home/niko/dev/codeas<wbr>ter-prerequisites/petsc-3.7.2/<wbr>Install --with-mpi=yes --with-x=yes --download-ml=/home/niko/dev/c<wbr>odeaster-prerequisites/petsc-3<wbr>.7.2/ml-6.2-p3.tar.gz --with-mumps-lib="-L/home/niko<wbr>/dev/codeaster-prerequisites/<wbr>v13/prerequisites/Mumps-502_co<wbr>nsortium_aster1/MPI/lib -lzmumps -ldmumps -lmumps_common -lpord -L/home/niko/dev/codeaster-pre<wbr>requisites/v13/prerequisites/<wbr>Scotch_aster-604_aster6/MPI/<wbr>lib -lesmumps -lptscotch -lptscotcherr -lptscotcherrexit -lscotch -lscotcherr -lscotcherrexit -L/home/niko/dev/codeaster-pre<wbr>requisites/v13/prerequisites/<wbr>Parmetis_aster-403_aster/lib -lparmetis -L/home/niko/dev/codeaster-pre<wbr>requisites/v13/prerequisites/<wbr>Metis_aster-510_aster1/lib -lmetis -L/usr/lib -lscalapack-openmpi -L/usr/lib -lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi -L/usr/lib/x86_64-linux-gnu -lgomp " --with-mumps-include=/home/nik<wbr>o/dev/codeaster-prerequisites/<wbr>v13/prerequisites/Mumps-502_co<wbr>nsortium_aster1/MPI/include --with-scalapack-lib="-L/usr/l<wbr>ib -lscalapack-openmpi" --with-blacs-lib="-L/usr/lib -lblacs-openmpi -lblacsCinit-openmpi -lblacsF77init-openmpi" --with-blas-lib="-L/usr/lib -lopenblas -lcblas" --with-lapack-lib="-L/usr/lib -llapack"<br>[0]PETSC ERROR: #1 PetscObjectGetFortranCallback(<wbr>) line 263 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/sys/<wbr>objects/inherit.c<br>[0]PETSC ERROR: #2 oursnesjacobian() line 105 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>interface/ftn-custom/zsnesf.c<br>[0]PETSC ERROR: #3 SNESComputeJacobian() line 2312 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>interface/snes.c<br>[0]PETSC ERROR: #4 SNESSolve_NEWTONLS() line 228 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>impls/ls/ls.c<br>[0]PETSC ERROR: #5 SNESSolve() line 4008 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>interface/snes.c<br>[0]PETSC ERROR: #6 SNESFASDownSmooth_Private() line 512 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>impls/fas/fas.c<br>[0]PETSC ERROR: #7 SNESFASCycle_Multiplicative() line 816 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>impls/fas/fas.c<br>[0]PETSC ERROR: #8 SNESSolve_FAS() line 987 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>impls/fas/fas.c<br>[0]PETSC ERROR: #9 SNESSolve() line 4008 in /home/niko/dev/codeaster-prere<wbr>quisites/petsc-3.7.2/src/snes/<wbr>interface/snes.c<br>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------<br><br></div>When exploring a little bit with a debugger, it seems that the object snes->vec_rhs which is used is fas.c is a null pointer. <br><br>What is this object vec_rhs and how to set it?<br><br></div>Thank you in advance,<br></div>Nicolas<br><div><div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>