Continued Notes on Profiling

And Still More Notes on Profiling

hd_rawdata_030300_000.evio is in /cache/halld/RunPeriod-2017-01/rawdata/Run030300

to process a specified number of events

-PEVENTS_TO_KEEP=100

to skip some number of events at the beginning of the file:

-PEVENTS_TO_SKIP=10

gprof is not good for multi-threaded programs and also not good for shared libraries. look at callgrind. https://gernotklingler.com/blog/gprof-valgrind-gperftools-evaluation-tools-application-level-cpu-profiling-linux/#fn:3

oprofile was dropped in Fedora 30 in favor of perf. It is there in RHEL 7. https://bugzilla.redhat.com/show_bug.cgi?id=1706064

More Notes on Profiling

Valgrind

Example commands:

  • valgrind –tool=callgrind a.out
  • callgrind_annotate -auto=yes callgrind.out.1485
  • kcachegrind output-file [?]

gprof

gprof is on wikipedia: https://en.wikipedia.org/wiki/Gprof

Example of profiling hd_root:

git clone git@github.com:jeffersonlab/halld_recon
cd halld_recon
cd src
gxenv
git checkout pasteurize_rebased_mmi
scons -u install PROFILE=1 -j16
cp $HALLD_VERSIONS/version_fedora33.xml .
e version_fedora33.xml # edit to use this version of halld_recon
gxenv version_fedora33.xml
hd_root -PPLUGINS=danarest -PEVENTS_TO_KEEP=1000 /data/gluex/rawdata/hd_rawdata_030300_001.evio 
gprof `which hd_root` >& gprof.txt
lw gprof.txt 
 
  • jana, halld_recon, and halld_sim all accept the PROFILE=1 option to scons
  • throwing the -pg switch can have an effect on execution speed according to this.
  • This example gives the “no time accumulated” error.