I did this
do i=1,10000000
call VecGhostUpdateBegin(p%v_u, INSERT_VALUES, SCATTER_FORWARD, &
ierr); CHKERRQ(ierr)
call VecGhostUpdateEnd (p%v_u, INSERT_VALUES, SCATTER_FORWARD, &
ierr); CHKERRQ(ierr)
call PetscMallocGetCurrentUsage(space, ierr); CHKERRQ(ierr)
if(rank==0) print*,space
enddo
and the value printed is zero, so this means the problem must come from mpi.
Since I am not directly using MPI, what should I look for with valgrind and how
will that help to solve this ?
There is a recent issue related to memory leak
https://github.com/open-mpi/ompi/issues/4567
<https://github.com/open-mpi/ompi/issues/4567>
Thank you
praveen
> On 26-Dec-2017, at 7:33 PM, Jed Brown <[email protected]> wrote:
>
> First check PetscMallocGetCurrentUsage() in the loop to confirm that
> there is no leak of PetscMalloc()'ed memory. That would mean the leak
> comes from elsewhere, maybe MPI.
>
> Then get a stack trace for the leaking memory (e.g., using valgrind
> --tool=massif or a debugger)?