This file is $CDFSOFT2_DIR/FarmTools/doc/purify.html

Notes before beginning

Logging in

You should be logged on as user purifyu on fcdfsgi2.fnal.gov. We currently only have purify licenses on fcdfsgi2 (IRIX 6.5)

If you are not logged on as purifyu, you may need to do a kinit on the desktop computer where you are and then:

> ssh -l purifyu fcdfsgi2

Then one should do

> setup cdfsoft2 4.6.0
> setup purify v2001a

Building a Purify'd executable

  • Create in the directory of your choice (e.g. ~purifyu/ ) a test release containing the package that produces the executable you wish to run, and cd to the base directory of the test release:
  • > newrel -t 4.6.0 4.6.0
    > cd 4.6.0

  • Build your executable:
  • > addpkg YourPackage
    **replace "YourPackage" with the package you need, e.g. Production
    > gmake LDFLAGS="--backend -T0x25000000" YourPackage.bin
    **replace "YourPackage.bin" with the name of your package. (This command is for larger executables which need to be built in a special manner.)
    > srt_setup -a
    **Purify can get confused between your test release shared libraries and the base release shared libraries. This step forces absolute pathnames to be used in LD_LIBRARY_PATH to avoid this.
    **If your executable is already built, skip down to this step after initial setup.** A complete copy of your executable, plus purify code added in, will be placed in your current working directory. This will be one big executable, so you should move to a directory with lots of space:
    > cd /var/tmp/purifyu
    or
    > cd /cdf/scratch/$USER
    > purify -cache_dir=/var/tmp/purifyu basedir/bin/$BFARCH/exe_filename
    **replace "basedir" with the base directory of your test release, e.g. ~purifyu/4.6.0
    **replace "exe_filename" with the name of your executable, e.g. ProductionExe
  • one more useful option:
    purify -chain_length=20 ....
    
    sets the depth of the call stack, "remembered" by Purify to 20

  • Run the purified executable--it is now in your current directory and can be run like the normal executable:
  • > ./exe_filename.pure your_arguments
    **replace "your_arguments" with the proper arguments for your executable, e.g. ~purifyu/4.6.0/Production/ProductionExe.tcl -i /cdf/scratch/purifyu/jr022da1.0001phys-4evt -o tmp.root. (Even with a small input file, this will take a while to run.)
    The purify user interface screen will pop up after a short pause, with reports being generated at various levels in the call tree. When the job completes, it lists the amount of leaked memory, etc.

    Coral Christensen

    Last modified: Mon Jul 1 10:48:03 CDT 2002