[petsc-users] HYPRE AMS - Segmentation Violation with discrete gradient

Nicolas Alejandro Barnafi nicolas.barnafi at unimi.it
Tue Jan 25 07:06:31 CST 2022


I have added -mat_view to see the matrices and perhaps I found the issue. The matrix G (third one) should have as many columns as the other two, and this is indeed not the case:

Mat Object: 1 MPI processes
 type: seqaij
row 0: (0, 3.) 
row 1: (1, 3.) 
row 2: (2, 3.) 
row 3: (3, 3.) 
row 4: (4, 3.) 
row 5: (5, 3.) 
Mat Object: 1 MPI processes
 type: seqaij
row 0: (0, 3.) 
row 1: (1, 3.) 
row 2: (2, 3.) 
row 3: (3, 3.) 
row 4: (4, 3.) 
row 5: (5, 3.) 
Mat Object: 1 MPI processes
 type: seqaij
row 0: (0, -1.) (1, 1.) 
row 1: (0, 1.) (2, -1.) 
row 2: (0, -1.) (4, 1.) 
row 3: (1, -1.) (3, 1.) 
row 4: (1, 1.) (5, -1.) 
row 5: (2, 1.) (3, -1.) 
row 6: (2, 1.) (6, -1.) 
row 7: (3, -1.) (7, 1.) 
row 8: (4, 1.) (5, -1.) 
row 9: (4, -1.) (6, 1.) 
row 10: (5, 1.) (7, -1.) 
row 11: (6, -1.) (7, 1.) 

Thank you for the guidance, hopefully after correcting these issues the problem will be solved. I guess the method somewhere considers maybe the columns of G as a reference for the inner sbspace correction matrix and it ends up creating a mismatch. Perhaps I should let them know, an assert for matrix sizes should be there somehwere. 

Best regards

Il 24/01/22 23:02, Matthew Knepley  <knepley at gmail.com> ha scritto: 
> 
> 
> 
> On Mon, Jan 24, 2022 at 4:42 PM Matthew Knepley <knepley at gmail.com> wrote:
> 
> 
> > 
> > Okay, I can run your example and get an error. I am looking at it. Not sure if it is us or Hypre yet.
> > 
> 
> 
> This is failing inside Hypre. It appears that the A_diag offset array does not match the matrix. Are you giving Hypre
> a rectangular matrix? If so, it appears that the code cannot handle it and accidentally indexes out of the array.
> 
>  Thanks,
> 
>  Matt
>  
> 
> > 
> > 
> >  Thanks,
> > 
> >  Matt
> > 
> > 
> > 
> > On Mon, Jan 24, 2022 at 12:39 PM Nicolas Alejandro Barnafi <nicolas.barnafi at unimi.it> wrote:
> > 
> > > 
> > > Please let me know if you were able to run the example (or anyone else). Thanks for the help. 
> > > Kind regards
> > > 
> > > Il 21/01/22 18:05, "Nicolas Alejandro Barnafi"  <nicolas.barnafi at unimi.it> ha scritto:
> > > > 
> > > > Thank you Matt, I have trimmed down ex10 (a lot) to do as required, and it indeed reproduces the error. 
> > > > You may find it attached and it can be reproduced with 
> > > > ./ex10 -fA Amat -fP Pmat -fG Gmat -ksp_type gmres -pc_type hypre -pc_hypre_type ams
> > > > 
> > > > Thank you!
> > > > 
> > > > Il 21/01/22 16:35, Matthew Knepley  <knepley at gmail.com> ha scritto:
> > > > > 
> > > > > 
> > > > > 
> > > > > On Fri, Jan 21, 2022 at 9:50 AM Nicolas Alejandro Barnafi <nicolas.barnafi at unimi.it> wrote:
> > > > > 
> > > > > 
> > > > > > Dear community, 
> > > > > > 
> > > > > > I'm giving the discrete gradient to a PC object (sub PC of a fieldsplit) but HYPRE internally gives a segmentation violation error. The matrix has been adequately set, as I have added it to the program output for inspection. Has this happened to anyone? 
> > > > > > 
> > > > > 
> > > > > 
> > > > > Is there a chance of sending us something that we can run? Alternatively, can you run
> > > > > 
> > > > >  https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex10.c
> > > > > 
> > > > > loading your matrix and giving options to select Hypre? Then we can do the same thing here with your matrix.
> > > > > 
> > > > >  Thanks,
> > > > > 
> > > > >  Matt
> > > > > 
> > > > > 
> > > > > > 
> > > > > > I have attached the error below together with the discrete gradient, in case you see something I am missing.
> > > > > > 
> > > > > > The code is currently running in serial, so I don't expect communication/partitioning to be an issue (although it could be in the future). 
> > > > > > 
> > > > > > Thanks in advance, 
> > > > > > Nicolas
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > ------------------------------ PETSc output ------------------------------------
> > > > > > 
> > > > > > 
> > > > > > Mat Object: 1 MPI processes
> > > > > >  type: seqaij
> > > > > >  -1.00000e+00 1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  1.00000e+00 0.00000e+00 -1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  -1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 -1.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 -1.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 1.00000e+00 -1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 -1.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 0.00000e+00 -1.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 1.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 1.00000e+00 -1.00000e+00 0.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 -1.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 1.00000e+00 0.00000e+00 -1.00000e+00 
> > > > > >  0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 -1.00000e+00 1.00000e+00 
> > > > > > [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 https://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] jac->setup line 408 /home/ubuntu/petsc/src/ksp/pc/impls/hypre/hypre.c
> > > > > > [0]PETSC ERROR: [0] PCSetUp_HYPRE line 223 /home/ubuntu/petsc/src/ksp/pc/impls/hypre/hypre.c
> > > > > > [0]PETSC ERROR: [0] PCSetUp line 971 /home/ubuntu/petsc/src/ksp/pc/interface/precon.c
> > > > > > [0]PETSC ERROR: [0] KSPSetUp line 319 /home/ubuntu/petsc/src/ksp/ksp/interface/itfunc.c
> > > > > > [0]PETSC ERROR: [0] KSPSolve_Private line 615 /home/ubuntu/petsc/src/ksp/ksp/interface/itfunc.c
> > > > > > [0]PETSC ERROR: [0] KSPSolve line 884 /home/ubuntu/petsc/src/ksp/ksp/interface/itfunc.c
> > > > > > [0]PETSC ERROR: [0] PCApply_FieldSplit line 1241 /home/ubuntu/petsc/src/ksp/pc/impls/fieldsplit/fieldsplit.c
> > > > > > [0]PETSC ERROR: [0] PCApply line 426 /home/ubuntu/petsc/src/ksp/pc/interface/precon.c
> > > > > > [0]PETSC ERROR: [0] KSP_PCApply line 281 /home/ubuntu/petsc/include/petsc/private/kspimpl.h
> > > > > > [0]PETSC ERROR: [0] KSPInitialResidual line 40 /home/ubuntu/petsc/src/ksp/ksp/interface/itres.c
> > > > > > [0]PETSC ERROR: [0] KSPSolve_GMRES line 233 /home/ubuntu/petsc/src/ksp/ksp/impls/gmres/gmres.c
> > > > > > [0]PETSC ERROR: [0] KSPSolve_Private line 615 /home/ubuntu/petsc/src/ksp/ksp/interface/itfunc.c
> > > > > > [0]PETSC ERROR: [0] KSPSolve line 884 /home/ubuntu/petsc/src/ksp/ksp/interface/itfunc.c
> > > > > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> > > > > > [0]PETSC ERROR: Signal received
> > > > > > [0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > > > > [0]PETSC ERROR: Petsc Release Version 3.14.6, unknown 
> > > > > > [0]PETSC ERROR: Unknown Name on a arch-linux-c-debug named ubuntu-ThinkPad-L14-Gen-1 by ubuntu Fri Jan 21 15:37:45 2022
> > > > > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-mpi=1 --download-superlu_dist --download-mumps --download-hypre --with-debugging=1 COPTFLAGS="-O3 -march=native -mtune=native" CXXOPTFLAGS="-O3 -march=native -mtune=native" FOPTFLAGS="-O3 -march=native -mtune=native" --download-scalapack --download-hpddm
> > > > > > [0]PETSC ERROR: #1 User provided function() line 0 in unknown file
> > > > > > [0]PETSC ERROR: Checking the memory for corruption.
> > > > > > application called MPI_Abort(MPI_COMM_WORLD, 50176059) - process 0
> > > > > > [unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=50176059
> > > > > > :
> > > > > > system msg for write_line failure : Bad file descriptor
> > > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > -- 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> > > > > -- Norbert Wiener
> > > > > 
> > > > > https://www.cse.buffalo.edu/~knepley/(http://www.cse.buffalo.edu/~knepley/ )
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > 
> > > > 
> > > 
> > > 
> > 
> > 
> > 
> > -- 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> > -- Norbert Wiener
> > 
> > https://www.cse.buffalo.edu/~knepley/(http://www.cse.buffalo.edu/~knepley/ )
> > 
> > 
> > 
> > 
> 
> 
> 
> -- 
> 
> 
> 
> 
> 
> 
> 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/(http://www.cse.buffalo.edu/~knepley/ )
> 
> 
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220125/7ef9ddaf/attachment-0001.html>


More information about the petsc-users mailing list