Add N-dimensional and more flexible histogram filling to RDataFrame#7499
Add N-dimensional and more flexible histogram filling to RDataFrame#7499eguiraud merged 8 commits intoroot-project:masterfrom
Conversation
|
Can one of the admins verify this patch? |
|
Hi @bendavid , thank you for the contribution, I will take a look as soon as possible |
|
We need @lmoneta to review the changes in THn and TNDArray |
|
@bendavid about a), a move to C++14 for ROOT6 is foreseen but the timescale is too long to matter for this PR, I'm afraid. |
lmoneta
left a comment
There was a problem hiding this comment.
Looks good to me. I leave to @Axel-Naumann author of the THn classes to give the final approval.
eguiraud
left a comment
There was a problem hiding this comment.
This is great!
- addition of a copy-constructor in THn: good (a move-constructor should also be autogenerated right?)
- generalization of the different
FillParHelper::Execoverloads into a single implementation: good, I actually find it pretty readable considering the inherent complexity of what it is doing. No fold expressions and constexpr if unfortunately, not much we can do about that - addition of a
FillNmethod to RDF: great, certainly useful and it even reuses a lot of the existing infrastructure
As mentioned above, we need @Axel-Naumann to review the THn-related changes. However, I don't know if the "temporary hack" to allow copy-construction of THn's is really temporary, what are the drawbacks?
See below a bunch of minor comments.
Only strictly required change: we need a test for FillN (jitted, non-jitted, single-thread, multi-thread): it should be easy to duplicate and adapt one of the tests we have for Fill.
|
(will start a PR build after merge conflicts are resolved) |
|
The main drawback of the "temporary hack" is that there is some duplication of information and operations now between the size of the vector and separate integer data members in the class which were previously needed to keep track of the size of the arrays. If migrating from bare arrays to For what concerns the readability of the code in C++11, one thing which could help a little bit and might be feasible is if Another concern I had is that this implementation might be a bit slower than the previous individual cases if compiled without optimization (e.g. when jitted). |
|
@bendavid whenever you will have time can you please rebase on master? I will retrigger CI after... |
|
@Axel-Naumann is it ok to switch THn to std::vectors instead of C-style arrays as it's done in this PR? We get compiler-defined constructors out of it. @bendavid can you please rebase on master to fix the conflicts when you have time? |
|
Yes I would like some feedback on the use of std::vector so I can take care of that appropriately together with rebasing. If this strategy is agreed I can also clean up a bit more to avoid the redundant size counters, etc. |
Axel-Naumann
left a comment
There was a problem hiding this comment.
The THn part LGTM! A couple of minor comments, but I'm happy with the change from C-style array to vector.
ClassDef version for all classes with changes base or data members! This should happen before this PR gets merged. Assuming that: ✔️
|
Alright I've rebased and hopefully addressed all of the comments. |
9af8629 to
b07914a
Compare
|
There's something weird going on with clang-format here, where running locally seems to give a different result from the online checks for e.g. void Exec(unsigned int slot, const Xs &...xs)vs void Exec(unsigned int slot, const Xs &... xs) |
|
Thanks Josh, I'll do one last review pass as soon as I have spare cycles. Re: clang-format, probably different versions disagree on some edge cases, you can ignore the CI complaints. |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on mac11.0/cxx17. |
|
Small update to this to make the new Fill method for THnBase also work with integers (ie allowing the normal set of implicit type conversions, rather than excluding narrowing ones). |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on ROOT-ubuntu2004/soversion. |
|
Build failed on ROOT-ubuntu16/nortcxxmod. Failing tests: |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
|
Build failed on ROOT-debian10-i386/cxx14. Warnings:
|
|
Build failed on mac11/cxx17. Failing tests: |
|
Build failed on mac1015/python3. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
Uuuh is Jenkins not picking up the latest roottest? Will take a look tomorrow afternoon. |
|
@phsft-bot build |
|
Starting build on |
|
@Axel-Naumann any idea why jenkins keeps checking out an older commit for roottest? https://lcgapp-services.cern.ch/root-jenkins/job/root-pullrequests-build/132494/consoleFull |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Warnings:
|
|
Build failed on mac1015/python3. Failing tests: |
|
Build failed on windows10/cxx14. Failing tests: |
|
@bendavid the remaining failures are real (ignoring tmva), can you please take a look? |
|
Should be fixed now. The ND histogram test was using a huge number of bins by mistake. |
|
@phsft-bot build |
|
Starting build on |
|
Build failed on windows10/cxx14. Errors:
|
|
Windows failure is unrelated, merging. |
This PR does a few things
Note that this will likely result in slower code being generated in case of compiling/jitting without optimization.
The main issue here was actually that THnT does not have a publicly accessible copy constructor or assignment operator, which are needed for use with RDF. I didn't have the patience to implement this by hand for all the classes in the inheritance chain, so the relevant classes have been migrated from C-style arrays to std::vector such that default copy (and move) constructors and assignment operators can be automatically generated.