[petsc-users] install petsc with valgrind

Satish Balay balay at mcs.anl.gov
Fri Apr 17 17:29:31 CDT 2015


Well - its best if the .o files are not deleted..  [then you don't
have to run dsymutil]. One way to do it [if using PETSc makefiles] is:

make test RM=/bin/true

To run dsymutil - I think you need the .o files anyway - and run it as instructed below.

> --66450-- run: /usr/bin/dsymutil "./test"

Satish

On Fri, 17 Apr 2015, Sun, Hui wrote:

> How do I run dsymutil so as to get the line numbers?
> 
> 
> ________________________________
> From: Matthew Knepley [knepley at gmail.com]
> Sent: Friday, April 17, 2015 3:10 PM
> To: Sun, Hui
> Cc: Barry Smith; petsc-users at mcs.anl.gov
> Subject: Re: [petsc-users] install petsc with valgrind
> 
> On Fri, Apr 17, 2015 at 5:09 PM, Sun, Hui <hus003 at ucsd.edu<mailto:hus003 at ucsd.edu>> wrote:
> I'm not sure if I'm doing the right thing. But I have just
> export PATH=$PATH:dir_to_valgind_bin
> 
> And I rerun the command:
> -@${PETSC_DIR}/bin/petscmpiexec -valgrind -n ${NP} ./test -mx ${ND} -my ${ND} -mz ${ND} -ksp_monitor_short -ksp_type fgmres -pc_type asm
> 
> Then it seems to output something, for example:
> ==66450== Invalid write of size 8
> ==66450==    at 0x100055225: Schur_SetMatrix (in ./test)
> ==66450==    by 0x10004F218: StokesSetup (in ./test)
> ==66450==    by 0x1000DC582: main (in ./test)
> ==66450==  Address 0x7fff5f93fb28 is on thread 1's stack
> ==66450==  in frame #0, created by Schur_SetMatrix (???)
> ==66450==
> 
> Yes, this worked, and it shows you have a memory overwrite in your code. You have no line
> numbers because you deleted the *.o files without running dsymutil.
> 
> And before those output, it has the following lines:
> --66450-- run: /usr/bin/dsymutil "./test"
> warning: (x86_64) /Users/hus003/projects/LS_BDRY/test/test.o unable to open object file
> warning: no debug symbols in executable (-arch x86_64)
> --66450-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib"
> --66450-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind-install/lib/libmpicxx.12.dylib"
> --66450-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind-install/lib/libmpifort.12.dylib"
> --66450-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind-install/lib/libmpi.12.dylib"
> --66450-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind-install/lib/libpmpi.12.dylib"
> 
> Does it mean that it's working? But what does these two warnings mean?
> 
> These warnings mean that symbols are missing from those libraries, which is no surprise.
> 
>    matt
> 
> Best,
> Hui
> 
> 
> ________________________________________
> From: Barry Smith [bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>]
> Sent: Friday, April 17, 2015 2:57 PM
> To: Matthew Knepley
> Cc: Sun, Hui; petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] install petsc with valgrind
> 
>   Or make sure valgrind is in your path
> 
> > On Apr 17, 2015, at 4:56 PM, Matthew Knepley <knepley at gmail.com<mailto:knepley at gmail.com>> wrote:
> >
> > As I said, it cannot find valgrind in your path. Remove it or install valgrind.
> >
> >    Matt
> >
> > On Fri, Apr 17, 2015 at 4:55 PM, Sun, Hui <hus003 at ucsd.edu<mailto:hus003 at ucsd.edu>> wrote:
> > Thank you, Matt and Barry. I was trying to run the following:
> > -@${PETSC_DIR}/bin/petscmpiexec -valgrind -n ${NP} ./test -mx ${ND} -my ${ND} -mz ${ND} -ksp_monitor_short -ksp_type fgmres -pc_type asm
> >
> > where NP=2, ND=32
> >
> > And in the makefile I have specified the following:
> > include ${PETSC_DIR}/lib/petsc/conf/variables
> > include ${PETSC_DIR}/lib/petsc/conf/rules
> > include ${PETSC_DIR}/lib/petsc/conf/test
> >
> > Best,
> > Hui
> >
> >
> > ________________________________________
> > From: Barry Smith [bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>]
> > Sent: Friday, April 17, 2015 2:50 PM
> > To: Sun, Hui
> > Cc: petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>
> > Subject: Re: [petsc-users] install petsc with valgrind
> >
> >   Please please please always show WHAT YOU RAN with the error message. Otherwise we just must guess
> >
> >
> > > On Apr 17, 2015, at 3:58 PM, Sun, Hui <hus003 at ucsd.edu<mailto:hus003 at ucsd.edu>> wrote:
> > >
> > > Thank you Barry. I just have it installed. And I was running a code, and got the following error message:
> > >
> > > HYDU_create_process (utils/launch/launch.c:75): execvp error on file valgrind: (No such file or directory)
> > >
> > > ===================================================================================
> > > =   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
> > > =   PID 66059 RUNNING AT math178.ucsd.edu<http://math178.ucsd.edu>
> > > =   EXIT CODE: 255
> > > =   CLEANING UP REMAINING PROCESSES
> > > =   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
> > > ===================================================================================
> > >
> > > What does this mean?
> > >
> > > Best,
> > > Hui
> > >
> > > ________________________________________
> > > From: Barry Smith [bsmith at mcs.anl.gov<mailto:bsmith at mcs.anl.gov>]
> > > Sent: Friday, April 17, 2015 1:08 PM
> > > To: Sun, Hui
> > > Cc: petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>
> > > Subject: Re: [petsc-users] install petsc with valgrind
> > >
> > >   The development copy of PETSc allows using --prefix with MPICH  http://www.mcs.anl.gov/petsc/developers/index.html
> > >
> > >
> > >
> > >> On Apr 17, 2015, at 2:38 PM, Sun, Hui <hus003 at ucsd.edu<mailto:hus003 at ucsd.edu>> wrote:
> > >>
> > >> Hello,
> > >>
> > >> I want to install petsc with valgrind. And I read some documentations, which suggests me to do
> > >> ./configure --download-mpich --with-valgind-dir=…
> > >>
> > >> However, I also want to specify --prefix, but petsc doesn't allow me, because --download-mpich option does not work with --prefix install.
> > >>
> > >> Is there anyway that I can have petsc --prefix, together with valgrind?
> > >>
> > >> Best,
> > >> Hui
> > >
> >
> >
> >
> > --
> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> > -- Norbert Wiener
> 
> 
> 
> --
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 


More information about the petsc-users mailing list