-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DF] Fix snapshot of array branch with out-of-order size branch #10934
[DF] Fix snapshot of array branch with out-of-order size branch #10934
Conversation
Starting build on |
Starting build on |
Sometimes, when users specify an explicit list of columns to be written out by a Snapshot, they might forget to list the names of branches the store the sizes of array branches (e.g. `sz` for a branch `x` with leaflist `x[sz]/F`). We now explicitly check for this case and provide a (hopefully) helpful error message.
Even when users do not specify them explicitly, we now add size branches required by array branches to the list of branches that will be written out by a Snapshot.
ee61235
to
1b9e9ca
Compare
Starting build on |
@vepadulano @Axel-Naumann with the last commit the situation is now the following: explicit column list passed, a necessary size branch was omitted:
explicit column list passed, a necessary size branch is listed after the branch that needs it:
no explicit column list passed:
|
Build failed on ROOT-ubuntu18.04/nortcxxmod. Failing tests:
And 11 more |
Build failed on ROOT-ubuntu2004/python3. Failing tests:
And 13 more |
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests:
And 49 more |
Build failed on ROOT-debian10-i386/soversion. Failing tests: |
Build failed on mac11/cxx14. Failing tests: |
Build failed on windows10/cxx14. Failing tests: |
Build failed on mac1015/cxx17. Failing tests: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
const auto counterStr = | ||
leaf->GetLeafCount() ? std::string(leaf->GetLeafCount()->GetName()) : std::to_string(leaf->GetLenStatic()); | ||
auto *sizeLeaf = leaf->GetLeafCount(); | ||
const auto sizeLeafName = sizeLeaf ? std::string(sizeLeaf->GetName()) : std::to_string(leaf->GetLenStatic()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, for a leaf [4][4]
, leaf->GetLenStatic()
returns 16. I guess that's good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I...don't know, we don't have test coverage for 2-dimensional arrays in RDF
continue; // not a variable-sized array or the size branch is already there, nothing to do | ||
|
||
// otherwise we must insert the size in colsWithoutAliases _and_ colsWithAliases | ||
colsWithoutAliases.insert(colsWithoutAliases.begin() + i, countLeaf->GetName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means you insert the size column for branch X right before branch X, and then you check that branch X again in the next for loop iteration. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thank you , I guess we can also increment the counter to avoid the redundant work, will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
// make input tree | ||
{ | ||
TFile f(inFile, "recreate"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use in-memory trees or TMemFile for these kind of tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes in principle it makes sense, in practice I don't know if it works e.g. with TTreeProcessorMT (which has to re-open the file in each thread). I noted it down to try and convert all our RDF tests to use TMemFiles whenever possible, but I'd address this separately.
Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
Starting build on |
Co-authored-by: Axel Naumann <Axel.Naumann@cern.ch>
Starting build on |
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests: |
Build failed on ROOT-ubuntu2004/python3. Failing tests: |
This PR fixes #10920 and #6932 (see those for more information).