Subject: Re: [OMPI users] OpenMPI and Valgrind
From: Ashley Pittman (ashley_at_[hidden])
Date: 2009-02-12 11:50:07

On 12 Feb 2009, at 15:53, Reuben D. Budiardja wrote:
> Hello,
> I am having problem that if a program is compiled with OpenMPI,
> Valgrind
> doesn't work correctly, i.e: it does not show the memory leak like it
> supposed too. The same test program compiled with regular "gfortran"
> and run
> under Valgrind will show the memory leak.

Not only will Valgrind not show the memory leak but it also won't show
buffer over-runs, as it doesn't understand the allocator it'll assume
all memory handled by the allocator is read/writeable even if it's
redzone or hasn't been allocated.

> I search the list archive and found this post here, which exactly
> described my
> problem:
> but I don't understand if there is resolution to it.

It's worth reading the whole of that thread, in particular

> I am using OpenMPI-1.2.8 with all the default configure option. What
> should I
> do to be able use Valgrind with program compiled by OpenMPI ?

 From memory and reading the above links (i.e. untested advice):
1) Use OpenMPI 1.3 where the default is not to include this.
2) Configure Open MPI 1.2.8 with the --disable-memory-manager option
3) Compile you application without the -lopen-pal otion. In practice
this means running "mpicc --show" and cut-and pasting the underlying
compile line without the -lopen-pal into your application build
procedure. I was able to do this for hello world but I can image it'll
be a real PITA for anything larger.

I'm experimenting with Open MPI and valgrind at this time, if you are
still having problems I may be able to help further.