[petsc-users] install petsc with valgrind

Satish Balay balay at mcs.anl.gov
Sun Apr 19 14:29:46 CDT 2015


Ok - petscmpiexec does a bunch of things with valgrind - including
--dsymutil=yes option [and then later deleting *.dSYM files].

I don't know why they --dsymutil=yes is required.. [and rm in ${PETSC_DIR}/${PETSC_ARCH} looks wrong.]

Perhaps you can call valgrind directly [without the --dsymutil=yes option] ..

valgrind -q --tool=memcheck --num-callers=20 --track-origins=yes -n2 ./exe

Satish


-----
  if ( `uname` == 'Darwin') then
    set VALGRIND_OPTIONS="${VALGRIND_OPTIONS} --dsymutil=yes"
  endif
  $qrun -n $np ${VALGRIND_CMD} ${VALGRIND_OPTIONS} $*
  if ( `uname` == 'Darwin') then
    rm -rf *.dSYM
    rm -rf ${PETSC_DIR}/${PETSC_ARCH}/lib/lib*.dSYM
  endif


On Sun, 19 Apr 2015, Satish Balay wrote:

> BTW: can you also send your configure.log [perhaps compress it and attach]
> 
> Satish
> 
> On Sun, 19 Apr 2015, Satish Balay wrote:
> 
> > What do you have for:
> > 
> > ls -l /Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib.dSYM/Contents/Resources/DWARF/libpetsc.3.05.3.dylib
> > 
> > ls -l /Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib.dSYM/Contents/Resources/DWARF/libpetsc.3.05.3.dylib.x86_64
> > 
> > ls -l /Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib
> > 
> > Satish
> > 
> > On Sun, 19 Apr 2015, Sun, Hui wrote:
> > 
> > > I didn't use a root account.
> > > 
> > > ________________________________
> > > From: Matthew Knepley [knepley at gmail.com]
> > > Sent: Sunday, April 19, 2015 8:15 AM
> > > To: Sun, Hui
> > > Cc: petsc-users
> > > Subject: Re: [petsc-users] install petsc with valgrind
> > > 
> > > On Sun, Apr 19, 2015 at 9:56 AM, Sun, Hui <hus003 at ucsd.edu<mailto:hus003 at ucsd.edu>> wrote:
> > > I try to run
> > > -@${PETSC_DIR}/bin/petscmpiexec -valgrind -n 2 ./test -mx 32 -my 32 -mz 32
> > > 
> > > It seems to be working, except that it gives me an error message:
> > > 
> > > --21019-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib"
> > > --21020-- run: /usr/bin/dsymutil "/Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib"
> > > error: No such file or directory - old dSYM file cannot be overwritten:         old: '/Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib.dSYM/Contents/Resources/DWARF/libpetsc.3.05.3.dylib'
> > > 
> > > It sounds like you created this as root or something.
> > > 
> > >   Matt
> > > 
> > >         new:'/Users/hus003/Documents/software/petsc-valgrind/petsc-valgrind-debug/lib/libpetsc.3.05.3.dylib.dSYM/Contents/Resources/DWARF/libpetsc.3.05.3.dylib.x86_64'.
> > > 
> > > Why do I get this message? Do I need to get rid of it?
> > > 
> > > Best,
> > > Hui
> > > 
> > > 
> > > ________________________________________
> > > From: Sun, Hui
> > > Sent: Friday, April 17, 2015 3:37 PM
> > > To: petsc-users
> > > Cc: Matthew Knepley
> > > Subject: RE: [petsc-users] install petsc with valgrind
> > > 
> > > Thank you Satish! It works perfect.
> > > 
> > > Hui
> > > 
> > > 
> > > ________________________________________
> > > From: Satish Balay [balay at mcs.anl.gov<mailto:balay at mcs.anl.gov>]
> > > Sent: Friday, April 17, 2015 3:29 PM
> > > To: Sun, Hui
> > > Cc: Matthew Knepley; petsc-users at mcs.anl.gov<mailto:petsc-users at mcs.anl.gov>
> > > Subject: Re: [petsc-users] install petsc with valgrind
> > > 
> > > 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<mailto:knepley at gmail.com>]
> > > > Sent: Friday, April 17, 2015 3:10 PM
> > > > To: Sun, Hui
> > > > Cc: Barry Smith; petsc-users at mcs.anl.gov<mailto: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><mailto: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><mailto: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><mailto: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><mailto: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><mailto: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><mailto: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><mailto: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><mailto: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><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><mailto: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><mailto: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><mailto: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
> > > >
> > > 
> > > 
> > > 
> > > --
> > > 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