Skip to content

[ntuple] limit number of concurrently loaded cluster groups - #23901

Open
jblomer wants to merge 5 commits into
root-project:masterfrom
jblomer:ntuple-huge-file-read
Open

jblomer wants to merge 5 commits into
root-project:masterfrom
jblomer:ntuple-huge-file-read

Conversation

@jblomer

@jblomer jblomer commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Verified with a small benchmark that this change has the desired effect on memory consumption: jblomer/iotools@f355b8a

@jblomer
jblomer requested review from enirolf, hahnjo and pcanal October 29, 2026 22:21
@jblomer jblomer self-assigned this Oct 29, 2026
@jblomer
jblomer requested a review from silverweed as a code owner October 29, 2026 22:21
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 14h 42m 50s ⏱️
 3 883 tests  3 883 ✅ 0 💤 0 ❌
76 010 runs  76 010 ✅ 0 💤 0 ❌

Results for commit 1575491.

♻️ This comment has been updated with latest results.

@jblomer
jblomer force-pushed the ntuple-huge-file-read branch from e08aafa to f8023ed Compare October 30, 2026 08:44
...in addition to the pinned clusters that induce pinning of their
cluster group.
Move "searching for column index in a given cluster group" and "binary
search for the column index in the clusters of a cluster group" into
their own helper methods.
 - Look first into the cluster group of the current cluster and one
adjacent cluster group before full binary search.
 - Look through pinned cluster groups
 - "Top-level columns" (columns that have one element per entry) can use
   the more efficient entry-wise FindClusterId()
const auto clusterGroupBudget = Internal::RNTupleReadOptionsManip::GetClusterGroupBudget(fOptions);
assert(clusterGroupBudget > 0);
if ((nClusterGroups >= clusterGroupBudget) && (nClusterGroups > fPinnedClusterGroups.size())) {
auto nRemove = std::min(nClusterGroups - fPinnedClusterGroups.size(), nClusterGroups - clusterGroupBudget + 1);

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.

Why the '+1'? I recommend adding a code comment (eg 'Remove at least cluster group if they are not all pinned' (or whatever the correct explanation is :)).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment added.

assert(clusterGroupBudget > 0);
if ((nClusterGroups >= clusterGroupBudget) && (nClusterGroups > fPinnedClusterGroups.size())) {
auto nRemove = std::min(nClusterGroups - fPinnedClusterGroups.size(), nClusterGroups - clusterGroupBudget + 1);
for (auto lru = fClusterGroupAccessSequence.rbegin(); nRemove > 0;) {

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.

I recommend a code comment indicating the semantic reason to use the reverse iteration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jblomer
jblomer force-pushed the ntuple-huge-file-read branch from f8023ed to 1575491 Compare November 2, 2026 12:50
@jblomer
jblomer requested a review from pcanal November 2, 2026 12:51
Limit the number of concurrently loaded cluster group details. The
corresponding read options stays internal for the time being.

This branch has not been deployed

No deployments
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