Implement multi-processing in fastHadd to merge DQM histograms faster #10469
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(forward port of #10280)
Removed a few small optimizations:
As a result, the code is way more simplier and does not increase the
time it takes to merge.
Implement multi-process merging in fastHadd.
A group of processes are organized in a virtual tree.
Each process has a unique node_id (1 - number_of_proc) and
will start (fork) 2*node_id + {0,1} processes (if new node_id <=
number_of_proc).
Each process will merge all files identified by (file_index % (node_id - 1) == 0),
plus all histograms from his child processes.
IPC is done via pipe()s.
This gives us somewhat good latency. With 7 processes this will
decrease the merging down 11s (see below).
I have tried using threads to merge faster, but this was futile.
Root just has too many global internal states.
And I couldn't serialize root access, since it takes the majority of time.
I've tried fastParallelHadd.py (changing various parameters),
but the lowest time I could get was ~26seconds.
All numbers were done using fastHadd to merge 100 files, summary:
Memory is sum of proportional set size (PSS).
I will make ports to 75 and 76 after and if this is accepted.