Skip to content

[TTreeProcessorMT] Use unambiguous syntax when building chains #8741

Merged
eguiraud merged 1 commit intoroot-project:masterfrom
eguiraud:fix-norootextension
Aug 9, 2021
Merged

[TTreeProcessorMT] Use unambiguous syntax when building chains #8741
eguiraud merged 1 commit intoroot-project:masterfrom
eguiraud:fix-norootextension

Conversation

@eguiraud
Copy link
Copy Markdown
Contributor

@eguiraud eguiraud commented Jul 27, 2021

chain->Add("filename/treename") is ambiguous when filename does not
end in .root: in that case TChain interprets its argument
as the full path to the file, with no treename specified.

We now instead use the unambiguous syntax "filename?query#treename"
when building chains in TTreeProcessorMT.

This fixes #8739 (reading files with no .root extension in RDF's
multi-thread event loops).

Companion PR root-project/roottest#758 adds a test.

@eguiraud eguiraud self-assigned this Jul 27, 2021
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@eguiraud eguiraud force-pushed the fix-norootextension branch from 90ef255 to a679199 Compare July 27, 2021 10:30
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

chain->Add("filename/treename") is ambiguous when filename does not
end in `.root`: in that case `TChain` interprets its argument
as the full path to the file, with no treename specified.

We now instead use the unambiguous syntax "filename?query#treename"
when building chains in TTreeProcessorMT.

This fixes root-project#8739 (reading files with no `.root` extension in RDF's
multi-thread event loops).
@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft10.dyndns.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Errors:

  • [2021-07-27T12:46:14.266Z] stderr: error: could not read '.git/rebase-apply/head-name': No such file or directory

Failing tests:

@vepadulano
Copy link
Copy Markdown
Member

I'm a bit confused by this behaviour

root [1] ROOT::RDataFrame(10).Define("x", "rdfentry_").Snapshot<ULong64_t>("entries", "10entries.root", {"x"})
(ROOT::RDF::RResultPtr<ROOT::RDF::RInterface<ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager, void>::RLoopManager> >) @0x55f76d0
root [2] TChain c{"entries"};
root [3] c.Add("10entries.root?query#entries");
root [4] c.Print()
******************************************************************************
*Chain   :entries   : 10entries.root?query                                   *
******************************************************************************
******************************************************************************
*Tree    :entries   : entries                                                *
*Entries :       10 : Total =             977 bytes  File  Size =        469 *
*        :          : Tree compression factor =   1.34                       *
******************************************************************************
*Br    0 :x         : x/l                                                    *
*Entries :       10 : Total  Size=        628 bytes  File Size  =        113 *
*Baskets :        1 : Basket Size=      32000 bytes  Compression=   1.34     *
*............................................................................*
root [5] auto firstfile = static_cast<TFile *>(c.GetListOfFiles()->At(0));
root [6] firstfile->GetTitle()
(const char *) "10entries.root?query"

i.e. the file then stores ?query as part of its name?

@eguiraud
Copy link
Copy Markdown
Contributor Author

eguiraud commented Jul 27, 2021

Yeah that's terrible but it does not really impact this PR, I think?

The chains that we construct with the ?query# syntax here are internal to TTreeProcessorMT and not meant to be inspected by users.

@phsft-bot
Copy link
Copy Markdown

@eguiraud
Copy link
Copy Markdown
Contributor Author

eguiraud commented Aug 9, 2021

@phsft-bot build please

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@eguiraud eguiraud merged commit 1d064df into root-project:master Aug 9, 2021
@eguiraud eguiraud deleted the fix-norootextension branch August 9, 2021 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DF] Cannot read files that don't have a .root extension with IMT on

5 participants