Skip to content

[df] Rework RNTuple MT scheduling with a split work-stealing approach - #23327

Draft
vepadulano wants to merge 1 commit into
root-project:masterfrom
vepadulano:df-rntuple-imt-work-stealing
Draft

vepadulano wants to merge 1 commit into
root-project:masterfrom
vepadulano:df-rntuple-imt-work-stealing

Conversation

@vepadulano

Copy link
Copy Markdown
Member

Alternative to #22631 , implementing native IMT work-stealing for the RNTuple data source

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 20h 37m 44s ⏱️
 3 881 tests  3 879 ✅ 0 💤 2 ❌
79 924 runs  79 922 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit ece30c1.

♻️ This comment has been updated with latest results.

@hageboeck hageboeck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Here's a first pass with a few suggestions and a few questions.

Comment thread core/imt/inc/ROOT/InternalIMTUtils.hxx
Comment thread core/imt/inc/ROOT/TThreadExecutor.hxx
Comment thread tree/dataframe/inc/ROOT/RNTupleDS.hxx
Comment thread tree/dataframe/inc/ROOT/RNTupleDS.hxx
Comment on lines 946 to +958
if (sampleMap.empty())
return ROOT::RDF::RSampleInfo(
ntupleID, std::make_pair(fCurrentRanges[rangeIdx].fFirstEntry, fCurrentRanges[rangeIdx].fLastEntry), nullptr,
fPrincipalDescriptor.GetNEntries());
return ROOT::RDF::RSampleInfo(ntupleID,
std::make_pair(entryRangeDS.fFirstEntry - entryRangeDS.fEntryOffset,
entryRangeDS.fLastEntry - entryRangeDS.fEntryOffset),
nullptr, fPrincipalDescriptor.GetNEntries());

if (sampleMap.find(ntupleID) == sampleMap.end())
throw std::runtime_error("Full sample identifier '" + ntupleID + "' cannot be found in the available samples.");

return ROOT::RDF::RSampleInfo(
ntupleID, std::make_pair(fCurrentRanges[rangeIdx].fFirstEntry, fCurrentRanges[rangeIdx].fLastEntry),
sampleMap.at(ntupleID), fPrincipalDescriptor.GetNEntries());
return ROOT::RDF::RSampleInfo(ntupleID,
std::make_pair(entryRangeDS.fFirstEntry - entryRangeDS.fEntryOffset,
entryRangeDS.fLastEntry - entryRangeDS.fEntryOffset),
sampleMap.at(ntupleID), fPrincipalDescriptor.GetNEntries());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially not part of this PR, but looking at these lines, could we unify them for better readability? I was wondering if all arguments of the constructor for both cases are identical (they pretty much are), but it wasn't so easy to see.

How about this?

   RSample* sample = nullptr; 
   if (!sampleMap.empty()) {
      if (auto result = sampleMap.find(ntupleID); result != sampleMap.end())
         sample = *result;
      else
         throw std::runtime_error("Full sample identifier '" + ntupleID + "' cannot be found in the available samples.");
   }

   return ROOT::RDF::RSampleInfo(ntupleID,
                                 std::make_pair(entryRangeDS.fFirstEntry - entryRangeDS.fEntryOffset,
                                                entryRangeDS.fLastEntry - entryRangeDS.fEntryOffset),
                                 sample, fPrincipalDescriptor.GetNEntries());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually find the current look much more readable than your proposal.

Comment thread tree/dataframe/src/RNTupleDS.cxx
Comment thread tree/dataframe/src/RNTupleDS.cxx
Comment thread tree/dataframe/src/RNTupleDS.cxx
}
}

auto processFileWithGlobalOffset = [&](std::size_t fileIdx) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to @hageboeck review this. 🙂

Comment thread tree/dataframe/src/RNTupleDS.cxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants