Fix parallel processing for python3 #52
Merged
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.
Fix parallel processing, which causes segmentation faults in python3.
This is caused due to a conflict between how python3 and ROOT handle objects in the memory. The segmentation fault happens when manually deleting a ROOT histogram that was piped from a different thread created by python.
The reason why I previously implementation the manual deletion of histograms, it because in the past I was getting a segmentation fault caused when too many histograms are created and left lingering in the memory. The main way to combat this was to clean the memory by manually deleting unneeded histograms, and closing/reopening the (input) ROOT files to which the histograms were assigned. I suspect it is not as much of a problem anymore in new python and ROOT versions, but we should keep this in mind if segmentation faults happen again. Hopefully switching the plotting routine to RDataFrame will automatically solve this memory issue (see Issue #51), because of different way it handles files, and because we do pipe them anymore via python.