Re: [petsc-users] Memory leak related to MatSetValue

2025-06-09 Thread neil liu
Thanks a lot for your information. Very helpful. Have a good night. On Mon, Jun 9, 2025 at 9:56 PM Barry Smith wrote: > > src/mat/utils/matstash.c > > In MatStashBlockTypeSetUp() > > PetscCallMPI(MPI_Type_create_resized(stype, 0, stash->blocktype_size, > &stash->blocktype)); > > In MatStas

Re: [petsc-users] Memory leak related to MatSetValue

2025-06-09 Thread Junchao Zhang
On Mon, Jun 9, 2025 at 6:47 PM neil liu wrote: > Dear Petsc community, > Recently, I encountered a memory leak while using Valgrind (3.25.1) with > MPI (2 processes, MPICH 4.21.1) to test a PETSc-based code, which is a > variant of the pestc's built-in example. > > *#include * > *static char help

Re: [petsc-users] Memory leak related to MatSetValue

2025-06-09 Thread Barry Smith
src/mat/utils/matstash.c In MatStashBlockTypeSetUp() PetscCallMPI(MPI_Type_create_resized(stype, 0, stash->blocktype_size, &stash->blocktype)); In MatStashScatterDestroy_BTS(MatStash *stash) if (stash->blocktype != MPI_DATATYPE_NULL) PetscCallMPI(MPI_Type_free(&stash->blocktype)); So

[petsc-users] Memory leak related to MatSetValue

2025-06-09 Thread neil liu
Dear Petsc community, Recently, I encountered a memory leak while using Valgrind (3.25.1) with MPI (2 processes, MPICH 4.21.1) to test a PETSc-based code, which is a variant of the pestc's built-in example. *#include * *static char help[] = "Demonstrate PCFIELDSPLIT after MatZeroRowsColumns() insi