BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
profiling Directory Reference

Description

Profiling and memory leak tests

Compiled versions of the main macros for profiling, and checking memory leaks with the valgrind utility.

Files

File / directory Description
run_sim_bmn.cxx, run_reco_bmn.cxx, run8_sim_bmn.cxx, run8_reco_bmn.cxx, run_sim_src.cxx, run_reco_src.cxx Compiled (executable) versions of the simulation and reconstruction macros for the BM@N (also Run 8) and SRC setups
BmnDataToRoot.cxx, eventdisplay.cxx Compiled versions of the raw data conversion and the Event Display
Makefile, Makefile_mpdroot, bmnloadlibs.C Build of the executables and loading of the libraries
valgrind_sim.sh, valgrind_reco.sh, valgrind_sim_brief.sh, valgrind_reco_brief.sh Valgrind runs of the simulation and reconstruction (full and brief)
valgrind/*.supp, old_valgrind.supp Valgrind suppression files of the leak search sessions
size Size and content of the ROOT output files

Memory leak tests

Recommended check procedure

  1. Integrate latest changes from macros run_sim_bmn.C into run_sim_bmn.cxx.
  2. Make run_sim_bmn executable. Update Makefile in process.
  3. Review valgrind_sim.sh script (see below).
  4. Run valgrind_sim.sh script and get valgrind log.
  5. Review valgrind log. Search for repeated patterns of calls, collect some of them into new suppress file (must be included into valgrind_sim.sh). See Valgrind : Suppressing errors and Valgrind : Writing suppression files.
  6. If errors from log contain calls for BmnRoot objects, methods etc, check it carefully to detect end correct errors in BmnRoot code.
  7. Repeat from step 4. until you are satisfied with result.
  8. When valgrind log is clean enough, run valgrind_sim.sh script again with deactivated non-bmn suppressions (see below) to check if new suppressions hides some bmn-related cases. Review and process such cases if found.
  9. Repeat from step 1. for run_reco_bmn and other scripts / execs if necessary.

Comments on valgrind_*.sh scripts

First three options are ON all the time, namely:

--leak-check=full
--show-leak-kinds=all
--track-origins=yes

Option num-callers defines how many entries of call stack to display. It is disputable how many callers to include, but in general, greater value will give better error detection rate.

--num-callers=64

Then you have multiple suppression files that come with FairRoot / FairSoft packages and must stay as is. Otherwise immense amount of irrelevant errors will be included in log:

--suppressions=$ROOTSYS/... .supp

Next option gives complete log of errors together with suppressions for each error:

--gen-suppressions=all

It looks like investigating such a log is more efficient in comparison with other ways. Thus, it is advised to keep this option, but it is not strictly required.

Then we have suppression files from last leaks search sessions:

--suppressions=$VMCWORKDIR/macro/profiling/valgrind/bmn_valgrind_2025_06.supp
--suppressions=$VMCWORKDIR/macro/profiling/valgrind/non-bmn_valgrind_2025_06.supp
...

Also it is possible to have suppression file with cases that was reviewed but left as is for future investigation. Normally it is deactivated, but can be used to clarify valgrind log:

--suppressions=$VMCWORKDIR/macro/profiling/valgrind/left-asis_valgrind_2025_06.supp

And, finally, two suppression files from current session:

--suppressions=$VMCWORKDIR/macro/profiling/valgrind/_ready.supp
--suppressions=$VMCWORKDIR/macro/profiling/valgrind/_to_confirm.supp

One of them contains new confirmed suppression templates. Usually it consists of templates which does not include any references to BM@N objects. The other contains new suppression templates that requires additional confirmation. Usually it consists of templates which contains some references to BM@N objects. After successful session these two files will form new bmn_valgrind_<year>_<month>.supp and non-bmn_valgrind_<year>_<month>.supp files which will be added into valgrind_*.sh scripts.

Last option is self-explanatory:

--log-file=$VMCWORKDIR/macro/profiling/valgrind/val_sim.log
Directory dependency graph for profiling:

Directories

 
size
 Size and content of ROOT files

Files

 
BmnDataToRoot.cxx
 
bmnloadlibs.C
 
eventdisplay.cxx
 
run8_reco_bmn.cxx
 
run8_sim_bmn.cxx
 
run_reco_bmn.cxx
 
run_reco_src.cxx
 
run_sim_bmn.cxx
 
run_sim_src.cxx