Re: [petsc-dev] Broken example ?
I can reproduce (on a laptop, OS X 10.9) Running in the debugger (and looking at a related error when running the second suggested command line option in ex55.c), a possible source of the problem is with the way the IS's are being set up. The direct cause of the segfault on my machine is that, in PCFieldSplitSetDefaults, jac->head is a null pointer. It seems to be unrelated to hypre (based on the fact that the same behavior is observed changing to -fieldsplit_0_pc_type lu). Pasted below: 1) LLDB running the first recommended settings 2) Error from these settings 3) Error from the second set of recommended options ======================================================= 1) $ lldb ./ex55 (lldb) target create "./ex55" Current executable set to './ex55' (x86_64). (lldb) r -ksp_type fgmres -pc_type fieldsplit -pc_fieldsplit_detect_saddle_point -pc_fieldsplit_type schur -pc_fieldsplit_schur_precondition self -fieldsplit_1_ksp_type fgmres -fieldsplit_1_pc_type lsc -snes_vi_monitor -ksp_monitor_true_residual -fieldsplit_ksp_monitor -fieldsplit_0_pc_type hypre -da_grid_x 65 -da_grid_y 65 -snes_atol 1.e-11 -ksp_rtol 1.e-8 Process 84592 launched: './ex55' (x86_64) 0 SNES VI Function norm 6.221605446769e-05 Active lower constraints 1928/2241 upper constraints 302/397 Percent of total 0.131953 Percent of bounded 0.175937 Process 84592 stopped * thread #1: tid = 0x8c484, 0x0000000101196734 libpetsc.3.05.dylib`PCFieldSplitSetDefaults(pc=0x0000000104351a60) + 6868 at fieldsplit.c:411, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48) frame #0: 0x0000000101196734 libpetsc.3.05.dylib`PCFieldSplitSetDefaults(pc=0x0000000104351a60) + 6868 at fieldsplit.c:411 408 ierr = MatFindZeroDiagonals(pc->mat,&zerodiags);CHKERRQ(ierr); 409 ierr = ISComplement(zerodiags,nmin,nmax,&rest);CHKERRQ(ierr); 410 if (jac->reset) { -> 411 jac->head->is = rest; 412 jac->head->next->is = zerodiags; 413 } else { 414 ierr = PCFieldSplitSetIS(pc,"0",rest);CHKERRQ(ierr); (lldb) ======================================================= 2) $ ./ex55 -ksp_type fgmres -pc_type fieldsplit -pc_fieldsplit_detect_saddle_point -pc_fieldsplit_type schur -pc_fieldsplit_schur_precondition self -fieldsplit_1_ksp_type fgmres -fieldsplit_1_pc_type lsc -snes_vi_monitor -ksp_monitor_true_residual -fieldsplit_ksp_monitor -fieldsplit_0_pc_type hypre -da_grid_x 65 -da_grid_y 65 -snes_atol 1.e-11 -ksp_rtol 1.e-8 0 SNES VI Function norm 6.221605446769e-05 Active lower constraints 1928/2241 upper constraints 302/397 Percent of total 0.131953 Percent of bounded 0.175937 [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind [0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors [0]PETSC ERROR: likely location of problem given in stack below [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] PCFieldSplitSetDefaults line 321 /Users/patrick/program/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: [0] PCSetUp_FieldSplit line 484 /Users/patrick/program/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: [0] KSPSetUp line 220 /Users/patrick/program/petsc/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: [0] SNESSolve_VINEWTONRSLS line 346 /Users/patrick/program/petsc/src/snes/impls/vi/rs/virs.c [0]PETSC ERROR: [0] SNESSolve line 3696 /Users/patrick/program/petsc/src/snes/interface/snes.c [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Signal received [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1118-g64daeef GIT Date: 2014-12-11 04:32:01 -0600 [0]PETSC ERROR: ./ex55 on a arch-darwin-double-debug named Patricks-MacBook-Pro-3.local by patrick Tue Dec 16 11:19:48 2014 [0]PETSC ERROR: Configure options PETSC_DIR=/Users/patrick/program/petsc PETSC_ARCH=arch-darwin-double-debug --download-mpich --download-fblaslapack --with-cc=clang --with-cxx=clang++ --with-fc=gfortran-mp-4.9 --with-debugging=1 --with-precision=double --download-mumps --download-scalapack --download-metis --download-parmetis --download-spai --download-hypre --download-viennacl --with-opencl [0]PETSC ERROR: #1 User provided function() line 0 in unknown file application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0 ======================================================= 3) $ ./ex55 -ksp_type fgmres -pc_type mg -mg_levels_ksp_type fgmres -mg_levels_pc_type fieldsplit -mg_levels_pc_fieldsplit_detect_saddle_point -mg_levels_pc_fieldsplit_type schur -mg_levels_pc_fieldsplit_factorization_type full -mg_levels_pc_fieldsplit_schur_precondition user -mg_levels_fieldsplit_1_ksp_type gmres -mg_levels_fieldsplit_1_pc_type none -mg_levels_fieldsplit_0_ksp_type preonly -mg_levels_fieldsplit_0_pc_type sor -mg_levels_fieldsplit_0_pc_sor_forward -snes_vi_monitor -ksp_monitor_true_residual -pc_mg_levels 5 -pc_mg_galerkin -mg_levels_ksp_monitor -mg_levels_fieldsplit_ksp_monitor -mg_levels_ksp_max_it 2 -mg_levels_fieldsplit_ksp_max_it 5 -snes_atol 1.e-11 -mg_coarse_ksp_type preonly -mg_coarse_pc_type svd -da_grid_x 65 -da_grid_y 65 -ksp_rtol 1.e-8 ............. SNESVI solver converged at t = 0.0000 in 8 iterations 0 SNES VI Function norm 6.499999997699e+01 Active lower constraints 12663/12663 upper constraints 0/0 Percent of total 0.74929 Percent of bounded 0.999053 [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Invalid argument [0]PETSC ERROR: Wrong type of object: Parameter # 2 [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Development GIT revision: v3.5.2-1118-g64daeef GIT Date: 2014-12-11 04:32:01 -0600 [0]PETSC ERROR: ./ex55 on a arch-darwin-double-debug named Patricks-MacBook-Pro-3.local by patrick Tue Dec 16 11:21:47 2014 [0]PETSC ERROR: Configure options PETSC_DIR=/Users/patrick/program/petsc PETSC_ARCH=arch-darwin-double-debug --download-mpich --download-fblaslapack --with-cc=clang --with-cxx=clang++ --with-fc=gfortran-mp-4.9 --with-debugging=1 --with-precision=double --download-mumps --download-scalapack --download-metis --download-parmetis --download-spai --download-hypre --download-viennacl --with-opencl [0]PETSC ERROR: #1 MatGetSubMatrix() line 7482 in /Users/patrick/program/petsc/src/mat/interface/matrix.c [0]PETSC ERROR: #2 PCSetUp_FieldSplit() line 552 in /Users/patrick/program/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: #3 PCSetUp() line 902 in /Users/patrick/program/petsc/src/ksp/pc/interface/precon.c [0]PETSC ERROR: #4 KSPSetUp() line 306 in /Users/patrick/program/petsc/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #5 PCSetUp_MG() line 758 in /Users/patrick/program/petsc/src/ksp/pc/impls/mg/mg.c [0]PETSC ERROR: #6 PCSetUp() line 902 in /Users/patrick/program/petsc/src/ksp/pc/interface/precon.c [0]PETSC ERROR: #7 KSPSetUp() line 306 in /Users/patrick/program/petsc/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #8 SNESSolve_VINEWTONRSLS() line 506 in /Users/patrick/program/petsc/src/snes/impls/vi/rs/virs.c [0]PETSC ERROR: #9 SNESSolve() line 3743 in /Users/patrick/program/petsc/src/snes/interface/snes.c [0]PETSC ERROR: #10 main() line 108 in /Users/patrick/program/petsc/src/snes/examples/tutorials/ex55.c [0]PETSC ERROR: ----------------End of Error Message -------send entire error message to [email protected] application called MPI_Abort(MPI_COMM_WORLD, 62) - process 0 [unset]: aborting job: application called MPI_Abort(MPI_COMM_WORLD, 62) - process 0 On 16/12/14 05:22 AM, Pierre Jolivet wrote:
When trying to run snes/examples/tutorials/ex55 with the command line given in the source code, i.e. $ ./ex55 -ksp_type fgmres -pc_type fieldsplit -pc_fieldsplit_detect_saddle_point -pc_fieldsplit_type schur -pc_fieldsplit_schur_precondition self -fieldsplit_1_ksp_type fgmres -fieldsplit_1_pc_type lsc -snes_vi_monitor -ksp_monitor_true_residual -fieldsplit_ksp_monitor -fieldsplit_0_pc_type hypre -da_grid_x 65 -da_grid_y 65 -snes_atol 1.e-11 -ksp_rtol 1.e-8 I end up with a crash with these lines in the log: [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------ [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available, [0]PETSC ERROR: INSTEAD the line number of the start of the function [0]PETSC ERROR: is given. [0]PETSC ERROR: [0] PCFieldSplitSetDefaults line 321petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: [0] PCSetUp_FieldSplit line 484 petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c [0]PETSC ERROR: [0] KSPSetUp line 220 petsc/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: [0] SNESSolve_VINEWTONRSLS line 346 petsc/src/snes/impls/vi/rs/virs.c [0]PETSC ERROR: [0] SNESSolve line 3696 petsc/src/snes/interface/snes.c
This is happening on two computers (a MBP and a Linux, on the master branch), both have —download-hypre, am I the only one having this error ? Please let me know if so, I’ll send you both configure.log if need be.
Thank you, Pierre
participants (1)
-
Patrick Sanan