Using valgrind

Ioannis Nompelis nompelis at nobelware.com
Wed Nov 7 23:28:06 UTC 2018


I have used Valgrid. It is _great_ but you need to know what you are doing
in order to (a) not get confused by the times that things fail spectacularly
and in a cascading manner, and (b) to be able to collect the right information.

I have used it in parallel (distributed / separate memory space per process)
applications, which is what I build at work. Basically, you executa Valgrind,
even in parallel, which jails the process in a monitored memory space, and
then injects diagnostics. It is a lot like using a debugger or disassembler.

My adviser's eldest daughter just finished her CS degree at Carnegie Mellon
(possibly the best CS dept. in the country). For their programming assignments,
they had to run them through Valgrid and deliver the output.

Personally, I do not use Valgrid unless I am handed a piece of code that I do
not know what it does and that obviously has problems, like seg-faults or
un-expected behavriou. And even this case is rare. But I am telling you that
it is very useful for such tasks.

Here are the environment modules on my desktop:

opt_gcc_mach29_ompi-1.8.0                              opt_mach4_Vrui  
opt_gcc_mach29_ompi-1.8.0_hdf5-1.8.14                  
opt_gcc_mach29_ompi-1.8.0_parmetis-4.0.3_i32r32        
opt_gcc_mach29_ompi-1.8.0_parmetis-4.0.3_i32r32_HACK   
opt_gcc_mach29_ompi-1.8.0_parmetis-4.0.3_i64r64        
opt_gcc_mach29_ompi-2.0.1                              
opt_gcc_mach29_ompi-2.0.1_hdf5-1.8.14                  
opt_gcc_mach29_ompi-2.0.1_parmetis-4.0.3_i64r64        
opt_gcc_mach29_ompi-2.0.1_petsc-3.6.4                  
opt_gcc_mach29_ompi-2.0.1_valgrind-3.12.0              
opt_gcc_mach29_ompi-2.0.1_valgrind-3.12.0_petsc-3.6.4  
opt_gcc_mach29_Wine                                    
opt_gcc_mach29_Wine64                                  
opt_gcc_valgrid-3.12.0                                 
opt_mach4_pgi-15.10_OpenMPI-1.10.1_hdf5-1.8.14         
opt_mach4_pgi-15.10_OpenMPI-1.10.1_hdf5-1.8.14f2003    
opt_mach4_pgi-15.10_OpenMPI-1.10.1_parmetis-4.0.3      
opt_mach4_pgi-15.10_OpenMPI-1.10.1_parmetis-4.0.3_64   
opt_mach4_pgi-15.10_OpenMPI-1.10.1_petsc-3.6.4 

Notice how I have some software stacks built with Valgrind in them, like
the parallel execution and parallelization libraries (OpenMPI "ompi").

We can talk about it at the meetup.



More information about the Friends mailing list