Skip to content

[ntuple] add support for on-demand loading of page lists - #23524

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

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

Conversation

@jblomer

@jblomer jblomer commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Key feature for huge-file support: don't necessarily load all page list (and thus cluster group details) upfront but allow for them to be loaded on demand.

Follow-up changes to limit the memory footprint of cluster metadata:

  • Add "pinned cluster details" for pinned clusters
  • Optimize FindClusterId() such that in common cases we don't need to do a full binary search but
    • we search in the current cluster group and in one adjacent one (next or previous) plus in the pinned ones
    • For "top-level columns", we use the entry-based FindClusterId(), which points us directly to the right cluster group
  • Drop the least recently used cluster details when cluster details for a new cluster group are loaded. Aim at keeping at most two cluster groups (plus pinned ones) in memory.

@jblomer jblomer self-assigned this Sep 28, 2026
@jblomer
jblomer marked this pull request as draft September 28, 2026 12:24
@jblomer
jblomer force-pushed the ntuple-huge-file-read branch 2 times, most recently from 65532f7 to 63316a1 Compare September 28, 2026 15:15
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 2h 14m 23s ⏱️
 3 885 tests  3 885 ✅ 0 💤 0 ❌
83 202 runs  83 202 ✅ 0 💤 0 ❌

Results for commit b66cf23.

♻️ This comment has been updated with latest results.

@jblomer
jblomer force-pushed the ntuple-huge-file-read branch 2 times, most recently from c8d354d to b39589c Compare September 29, 2026 21:24

@hahnjo hahnjo 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.

Some comments inline. I'm wondering about the descriptor guards (which get quite a bit more complicated): when do we need them? A page source should be accessed by at most one thread at a time, no?

Comment thread tree/ntuple/test/ntuple_merger.cxx Outdated
Comment thread tree/ntuple/src/RPageStorage.cxx Outdated
Comment thread tree/ntuple/inc/ROOT/RPageStorage.hxx Outdated
Comment thread tree/ntuple/inc/ROOT/RPageStorage.hxx Outdated
Comment thread tree/ntuple/inc/ROOT/RPageStorage.hxx Outdated
Comment thread tree/ntuple/src/RPageStorage.cxx Outdated
Comment thread tree/ntuple/src/RPageStorage.cxx
@jblomer

jblomer commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Some comments inline. I'm wondering about the descriptor guards (which get quite a bit more complicated): when do we need them? A page source should be accessed by at most one thread at a time, no?

The cluster prefetch accesses it in parallel. I think it's worthy seeing if we can collect all the locators to prefetch in the main thread, which indeed would allow for removing the locks altogether. I don't think it would fundamentally change this PR, however. I'd consider the additions to the lock guards mostly mechanical.

@jblomer
jblomer force-pushed the ntuple-huge-file-read branch 8 times, most recently from e28913e to 372e990 Compare October 4, 2026 11:38
@jblomer
jblomer marked this pull request as ready for review October 4, 2026 11:42
@jblomer
jblomer requested a review from dpiparo as a code owner October 4, 2026 11:42
@jblomer
jblomer requested a review from hahnjo October 4, 2026 11:42
@jblomer
jblomer force-pushed the ntuple-huge-file-read branch 3 times, most recently from f602672 to 55d62e1 Compare October 7, 2026 12:02
@jblomer
jblomer force-pushed the ntuple-huge-file-read branch 2 times, most recently from 91c5bf3 to ec1718a Compare October 17, 2026 20:31
@jblomer
jblomer requested a review from pcanal October 17, 2026 20:31

@hahnjo hahnjo 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.

Looks good from my side

Comment thread tree/ntuple/inc/ROOT/RPageStorage.hxx Outdated
Comment thread tree/ntuple/inc/ROOT/RPageStorage.hxx Outdated
Comment thread tree/ntuple/src/RPageStorage.cxx Outdated

@hahnjo hahnjo 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.

(didn't click the right button, see #23524 (review))

Factor out loading a page list (and thus populating cluster group
details) into a separate method, to be reused later.
... by ensuring cluster details are available when cluster descriptors
are requested.
To be called after attach in cases where it is clear upfront that the
full information of the cluster details is needed.
With on-demand loading of page lists, the connection to storage (file
handle, DAOS container, etc.) can be used concurrently, by the page list
loading and by the prefetcher. Hence requires locking.
@jblomer
jblomer force-pushed the ntuple-huge-file-read branch from ec1718a to b66cf23 Compare October 19, 2026 20:15

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.

3 participants