[petsc-users] Growing memory use with VecGhostUpdate

Praveen C cpraveen at gmail.com
Tue Dec 26 06:05:00 CST 2017


Dear all

I have a fortran CFD code, 3d, unstructured grid.

I run the following code

   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)
   enddo

and monitor memory usage using “top”. I find that the memory used by the processes increases continuously.

The vector p%v_u was created like this

      call VecCreateGhostBlockWithArray(PETSC_COMM_WORLD, nvar, nvar*g%nvl, &
                                        PETSC_DECIDE, g%nvg, g%vghost, &
                                        s%u(1,1), p%v_u, ierr); CHKERRQ(ierr)

where I use a preallocated array s%u(nvar, g%nvl + g%nvg).

I have observed this memory issue on Linux with Petsc 3.8.3 and Openmpi 3.0.0, gcc-7.2.1, gfortran-7.2.1

On my macbook using clang and gfortran, I do not see this growing memory issue.

Can you suggest some way to debug this problem ?

Thank you
praveen


More information about the petsc-users mailing list