[petsc-users] dmplex with block size error

Rongliang Chen rongliang.chan at gmail.com
Thu Aug 18 05:05:09 CDT 2016


Hi Matt,

The log of the valgrind is attached. When I run with valgrind, the 
following error message comes up.

-------------------------
[1]PETSC ERROR: --------------------- Error Message 
--------------------------------------------------------------
[1]PETSC ERROR: Arguments are incompatible
[1]PETSC ERROR: Cannot change block size 3670016 to 7
[1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html 
for trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015
[1]PETSC ERROR: ./fsi on a 64bit-debug named rlchen by rlchen Thu Aug 18 
17:59:43 2016
[1]PETSC ERROR: Configure options --download-blacs --download-scalapack 
--download-metis --download-parmetis --download-exodusii 
--download-netcdf --download-hdf5 
--with-mpi-dir=/home/rlchen/soft/Program/mpich2-shared 
--with-debugging=1 --download-fblaslapack --with-64-bit-indices
[1]PETSC ERROR: #1 PetscLayoutSetBlockSize() line 424 in 
/home/rlchen/soft/petsc-3.6.3/src/vec/is/utils/pmap.c
[1]PETSC ERROR: #2 MatSetBlockSize() line 6920 in 
/home/rlchen/soft/petsc-3.6.3/src/mat/interface/matrix.c
[1]PETSC ERROR: #3 MatXAIJSetPreallocation() line 282 in 
/home/rlchen/soft/3D_fluid/FSI/Spmcs-v1.5/Fluid-petsc-3.6/src/application/Fluid/gcreate.c
----------------------

Best regards,
Rongliang

On 08/18/2016 05:52 PM, Matthew Knepley wrote:
> Run with valgrind and send the log.
>
>   Thanks,
>
>      Matt
>
> On Thu, Aug 18, 2016 at 3:59 AM, Rongliang Chen 
> <rongliang.chan at gmail.com <mailto:rongliang.chan at gmail.com>> wrote:
>
>     Dear All,
>
>     I try to use the block matrix (BAIJ) for the dmplex data structure
>     with the option "-dm_mat_type baij" (the block size is 7). The
>     code works fine when np = 1 but the following error comes up when
>     np>1. And the code also works fine for np>1 if I set the block
>     size to be 1. Any suggestions are highly appreciated.
>
>     ----------------------------------------------------
>     [1]PETSC ERROR: PetscMallocValidate: error detected at
>     VecAXPY_Seq() line 89 in
>     /home/rlchen/soft/petsc-3.6.3/src/vec/vec/impls/seq/bvec1.c
>     [1]PETSC ERROR: Memory at address 0x1332571 is corrupted
>     [1]PETSC ERROR: Probably write past beginning or end of array
>     [1]PETSC ERROR: Last intact block allocated in PetscStrallocpy()
>     line 188 in /home/rlchen/soft/petsc-3.6.3/src/sys/utils/str.c
>     [1]PETSC ERROR: --------------------- Error Message
>     --------------------------------------------------------------
>     [1]PETSC ERROR: Memory corruption:
>     http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind
>     <http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind>
>     [1]PETSC ERROR:
>     [1]PETSC ERROR: See
>     http://www.mcs.anl.gov/petsc/documentation/faq.html
>     <http://www.mcs.anl.gov/petsc/documentation/faq.html> for trouble
>     shooting.
>     [1]PETSC ERROR: Petsc Release Version 3.6.3, Dec, 03, 2015
>     [1]PETSC ERROR: ./fsi on a 64bit-debug named rlchen by rlchen Thu
>     Aug 18 16:42:34 2016
>     [1]PETSC ERROR: Configure options --download-blacs
>     --download-scalapack --download-metis --download-parmetis
>     --download-exodusii --download-netcdf --download-hdf5
>     --with-mpi-dir=/home/rlchen/soft/Program/mpich2-shared
>     --with-debugging=1 --download-fblaslapack --with-64-bit-indices
>     [1]PETSC ERROR: #1 PetscMallocValidate() line 136 in
>     /home/rlchen/soft/petsc-3.6.3/src/sys/memory/mtr.c
>     [1]PETSC ERROR: #2 VecAXPY_Seq() line 89 in
>     /home/rlchen/soft/petsc-3.6.3/src/vec/vec/impls/seq/bvec1.c
>     [1]PETSC ERROR: #3 VecAXPY() line 640 in
>     /home/rlchen/soft/petsc-3.6.3/src/vec/vec/interface/rvector.c
>     ---------------------------------------------------
>
>     Best regards,
>     Rongliang
>
>
>
>
> -- 
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160818/0413fa05/attachment-0001.html>
-------------- next part --------------
==13325== Invalid read of size 8
==13325==    at 0x5A3650: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2557)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c970 is 16 bytes before a block of size 22 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4D213E2: PetscStrallocpy (str.c:188)
==13325==    by 0x4D5417A: PetscFunctionListAdd_Private (reg.c:251)
==13325==    by 0x4D69EFC: PetscObjectComposeFunction_Petsc (inherit.c:663)
==13325==    by 0x4D6BA29: PetscObjectComposeFunction_Private (inherit.c:830)
==13325==    by 0x52D75E9: MatCreate_MPIBAIJ (mpibaij.c:3180)
==13325==    by 0x51415CF: MatSetType (matreg.c:94)
==13325==    by 0x59D03E: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2045)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid write of size 8
==13325==    at 0x5A3657: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2557)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c970 is 16 bytes before a block of size 22 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4D213E2: PetscStrallocpy (str.c:188)
==13325==    by 0x4D5417A: PetscFunctionListAdd_Private (reg.c:251)
==13325==    by 0x4D69EFC: PetscObjectComposeFunction_Petsc (inherit.c:663)
==13325==    by 0x4D6BA29: PetscObjectComposeFunction_Private (inherit.c:830)
==13325==    by 0x52D75E9: MatCreate_MPIBAIJ (mpibaij.c:3180)
==13325==    by 0x51415CF: MatSetType (matreg.c:94)
==13325==    by 0x59D03E: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2045)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid read of size 8
==13325==    at 0x5A35FF: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2556)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c160 is 0 bytes after a block of size 2,480 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4111C1: MatCreate (gcreate.c:84)
==13325==    by 0x59CF5D: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2043)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid write of size 8
==13325==    at 0x5A3606: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2556)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c160 is 0 bytes after a block of size 2,480 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4111C1: MatCreate (gcreate.c:84)
==13325==    by 0x59CF5D: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2043)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid read of size 8
==13325==    at 0x4EB3B1A: PetscLayoutSetBlockSize (pmap.c:423)
==13325==    by 0x51194D7: MatSetBlockSize (matrix.c:6920)
==13325==    by 0x4133D4: MatXAIJSetPreallocation (gcreate.c:282)
==13325==    by 0x5A3B3B: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2588)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c226 is 10 bytes before a block of size 80 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4EB0DDA: PetscLayoutCreate (pmap.c:53)
==13325==    by 0x411352: MatCreate (gcreate.c:86)
==13325==    by 0x59CF5D: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2043)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid read of size 8
==13325==    at 0x4EB3B27: PetscLayoutSetBlockSize (pmap.c:423)
==13325==    by 0x51194D7: MatSetBlockSize (matrix.c:6920)
==13325==    by 0x4133D4: MatXAIJSetPreallocation (gcreate.c:282)
==13325==    by 0x5A3B3B: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2588)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c226 is 10 bytes before a block of size 80 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4EB0DDA: PetscLayoutCreate (pmap.c:53)
==13325==    by 0x411352: MatCreate (gcreate.c:86)
==13325==    by 0x59CF5D: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2043)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 
==13325== Invalid read of size 4
==13325==    at 0x4EB3BC9: PetscLayoutSetBlockSize (pmap.c:424)
==13325==    by 0x51194D7: MatSetBlockSize (matrix.c:6920)
==13325==    by 0x4133D4: MatXAIJSetPreallocation (gcreate.c:282)
==13325==    by 0x5A3B3B: SpmcsDMMeshPreallocateOperator (spmcsdmmeshfem.cpp:2588)
==13325==    by 0x59DC4B: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2133)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325==  Address 0x9d6c21e is 18 bytes before a block of size 80 alloc'd
==13325==    at 0x4A0688A: memalign (vg_replace_malloc.c:727)
==13325==    by 0x4CDEE7F: PetscMallocAlign (mal.c:28)
==13325==    by 0x4EB0DDA: PetscLayoutCreate (pmap.c:53)
==13325==    by 0x411352: MatCreate (gcreate.c:86)
==13325==    by 0x59CF5D: DMCreateMatrix_SpmcsDMMesh (spmcsdmmeshfem.cpp:2043)
==13325==    by 0x5919B69: DMCreateMatrix (dm.c:956)
==13325==    by 0x5D48905: SNESSetUpMatrices (snes.c:604)
==13325==    by 0x5DE59B8: SNESSetUp_NEWTONLS (ls.c:307)
==13325==    by 0x5D5F24C: SNESSetUp (snes.c:2659)
==13325==    by 0x48257A: TimeStepperSolve(_p_DM*, void*) (timestepper.cpp:344)
==13325==    by 0x40B47F: main (fluidstructureinteraction.cpp:97)
==13325== 


More information about the petsc-users mailing list