I am building a large dictionary of C++ analysers/algorithms that I can then continently load in ROOT and call from pyROOT to define my RDF graph.
Nevertheless I am pretty sure some part of the code would deserve to be re-written, for example to have a proper class so that the instantiation only happens once.
With this email, and before I start trying too many random things, I would like to know what would be the recommended good practices to chase inefficient code blocks in RDF (if such thing exist of course).
Hi @clementhelsens ,
assuming that your application is not bound by I/O, we can certainly play a bit with performance optimization.
First of all, make sure that the C++ code is compiled with optimizations and debug symbols. If you compile it with ACLiC, you can explicitly ask for optimizations with +Og. If you compile manually, make sure that the -O2 -g compilation flags are passed.
At that point you can profile you application with perf, e.g. with perf record -F99 ./your_app and then check which functions take time with perf report.
In v6.24 you can also activate verbose RDF logging by adding this line at the beginning of the program:
auto verbosity = ROOT::Experimental::RLogScopedVerbosity(ROOT::Detail::RDF::RDFLogChannel(), ROOT::Experimental::ELogLevel::kInfo);
(the Python equivalent should be the same with . instead of :: as usual).
That will give you precise timings of the RDF event loop and of the time RDF spends just-in-time compiling “stuff” – if the latter is too high, there are tricks to reduce it.
Maybe we can start from these and see how it goes. I can also take a look at your application in case it’s possible to set it up and run it on my system.
Thanks @eguiraud , I will give it a try as soon as possible.
Let me write here the procedure to build a debug version for you but also for my own memory.
git clone https://github.com/HEP-FCC/FCCAnalyses.git
cd FCCAnalyses
source /cvmfs/sw.hsf.org/spackages2/key4hep-stack/2021-06-17/x86_64-centos7-gcc8.3.0-dbg/z6n4fqccr3gazbnycezoio5dyt2gqgho/setup.sh
export PYTHONPATH=$PWD:$PYTHONPATH
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$PWD/install/include/FCCAnalyses:$ROOT_INCLUDE_PATH
export LD_LIBRARY_PATH=`python -m awkward.config --libdir`:$LD_LIBRARY_PATH
mkdir build install
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=RelWithDebInfo
make install
cd ..
sorry @eguiraud , I did not found time to further investigate this. From any lxplus machine log in I can see this cvmfs repo mounted. I guess your workstation is within EP-STF ? if so maybe the system administrator could have a look and mount it? Last week on some machines to mount got stuck and IT had to do it again, maybe same thing is happing for you?
Cheers,
Clement