[petsc-users] Function to convert a dense matrix holding the cell connectivity to a MPIADJ for use with MatMeshToCellGraph

Smith, Barry F. bsmith at mcs.anl.gov
Tue Dec 12 19:49:48 CST 2017


   Can you send a code that reproduces the crash so I can debug it?

  Barry


> On Dec 12, 2017, at 2:44 PM, Jordan Wagner <j.wagner at rice.edu> wrote:
> 
> Hi,
> 
> I am trying to use the function MatMeshToCellGraph. I currently have a matrix that holds the cell connectivity of simplex elements. So it is a numCells x 3 matrix where the row corresponds to the cell number and the column is a vertex of that cell. To use this function, it appears I need to get the corresponding adjacency matrix.
> 
> I found the function MatConvert, which I was hoping could be the function I am looking for, but I keep getting a memory error when using it, which I have added at the bottom. Is this the correct function to use to convert my cell connectivity matrix, or do I need to loop through to get the proper offsets (i,j) needed to create the adjacency matrix with MatCreateMPIAdj, as is done in ex11.c?
> 
> Thanks very much for any tips.
> 
> 
> [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: PetscMallocValidate: error detected at PetscSignalHandlerDefault() line 145 in /home/jordan/petsc/src/sys/error/signal.c
> [0]PETSC ERROR: Memory [id=0(16)] at address 0x1b4cb80 is corrupted (probably write past end of array)
> [0]PETSC ERROR: Memory originally allocated in MatConvertFrom_MPIAdj() line 444 in /home/jordan/petsc/src/mat/impls/adj/mpi/mpiadj.c
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Memory corruption: http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind
> [0]PETSC ERROR:
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.8.2, unknown
> [0]PETSC ERROR: ./preprocess.exe on a arch-linux2-c-debug named jordan-nest by jordan Tue Dec 12 14:40:02 2017
> [0]PETSC ERROR: Configure options --with-shared-libraries=1 --download-metis --download-parmetis
> [0]PETSC ERROR: #1 PetscMallocValidate() line 146 in /home/jordan/petsc/src/sys/memory/mtr.c
> [0]PETSC ERROR: #2 PetscSignalHandlerDefault() line 145 in /home/jordan/petsc/src/sys/error/signal.c
> 
> 
> 



More information about the petsc-users mailing list