Open pgranger23 opened 2 months ago
About your comment Check that the use of the #pragma omp commands are never an issue, even when not compiling with multi-processing
Usually what we do is wrap pragma around preprocessor
#ifdef MULTITHREAD
#pragma omp parallel for
#endif
All multithreading flags etc. are ste here https://github.com/mach3-software/MaCh3/blob/82d1fec9ab8db6597053d78eb7b383dd29b30400/CMakeLists.txt#L196
Not that I expect a large change in RAM based on the changes I can see - but it would be good to check that the RAM usage has not significantly expanded in the new approach. In the short/mid term, the RAM usage is still somewhat important for pushing as many chains onto as few nodes as possible.
Summary
Proposed optimization of the
fillArray
code. As the used data structure relies on Structure of Arrays (SoA), it is more efficient to apply all the operations, one after the other, to all the events at the same time rather than looping on the events to apply those operations. Also avoids the need to make string comparisons on each event loop.Interface changes
virtual double* ReturnKinematicParameter(std::string KinematicParamter, int iSample) = 0;
function is required for all the experiments in order to return a pointer to the relevant array to use as Kinematic Parameter. Note that this requires the KineMaticParameters to be of typedouble
.fillArray_MP
andfillArray
functions have been merged. I think it is better for future maintenance to have a single function to deal with and not 2 alternative versions.Performance improvements
The following performance improvements have been witnessed with these changes. The relevant points to compare here are the red and blue ones. These performances have been obtained on the DUNE FD sample, with the GCC compiler and the use of![profiling](https://github.com/mach3-software/MaCh3/assets/28440737/d7b452e7-8390-4b08-b8d9-57ad766cf72e)
--march=native
compiler flag.Things to verify
Here are the items that should be verified before the possible approval of this PR:
#pragma omp
commands are never an issue, even when not compiling with multi-processing