Using valgrind on petsc projects

Satish Balay balay at mcs.anl.gov
Sun May 28 17:52:48 CDT 2006


>>>>
asterix:/home/balay/spetsc/src/snes/examples/tutorials>mpiexec -np 2 valgrind -q --tool=memcheck  ./ex5
Number of Newton iterations = 4
asterix:/home/balay/spetsc/src/snes/examples/tutorials>
>>>>

The above is with MPICH2 and valgrind doesn't find any problems.

So I'll sugest installing another build of PETSc with
--download-mpich=1 and retrying your code with it [you can install
with a different PETSC_ARCH so that what you've curently installed is
still useable]

Mostlikely the issues you've encountered are OpenMPI issues. You could
try reproducing this problem with a simple MPI code.

[Ideally OpenMPI code should be fixed to be valgrind clean..] However
as this one is a minor leak - you you could ignore this issue. There
is a way in valgrind to create a supression file - for known issues
that you'd like to ignore.

Satish

On Sun, 28 May 2006, Berend van Wachem wrote:

> Hi,
> 
> I am using Petsc with Open-Mpi and have started to use valgrind to find a bug.
> One of the things that I see is that there is memory lost in PetscInitialize
> by calling MPI_Init and in DACreate (which I do quite often in my project).
> The amounts of memory lost aren't huge; should I be alarmed?
> 
> To give an example, I have attached the output of valgrind on
> $PETSC_DIR/src/snes/examples/tutorials
> 
> Thanks,
> 
> Berend.
> 
> 




More information about the petsc-users mailing list