Skip to content
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

[ntuple] Allow changing compression of sources in RNTupleMerger #15992

Merged

Conversation

silverweed
Copy link
Contributor

This Pull request:

gives RNTupleMerger the capability of changing the source RNTuples' compression while doing the merging. This can also be used to change the compression of a single RNTuple.

Depends on #15954

Changes or fixes:

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@silverweed silverweed self-assigned this Jul 5, 2024
@silverweed silverweed requested a review from jblomer as a code owner July 5, 2024 08:47
@silverweed silverweed changed the title Ntuple merge change compression [ntuple] Allow changing compression of sources in RNTupleMerger Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

Test Results

    13 files      13 suites   2d 20h 13m 2s ⏱️
 2 651 tests  2 651 ✅ 0 💤 0 ❌
32 645 runs  32 645 ✅ 0 💤 0 ❌

Results for commit cc6252e.

♻️ This comment has been updated with latest results.

@silverweed silverweed force-pushed the ntuple_merge_change_compression branch 2 times, most recently from 1d467aa to 46b4236 Compare July 5, 2024 12:47
@silverweed silverweed force-pushed the ntuple_merge_change_compression branch from 5429241 to 3a1ca08 Compare July 8, 2024 15:08
Copy link
Contributor

@enirolf enirolf left a comment

Choose a reason for hiding this comment

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

Thank you! I've added some minor, mostly optical comments

/// If `fCompressionSettings == -1` (the default), the merger will not change the compression
/// of any of its sources (fast merging). Otherwise, all sources will be converted to the specified
/// compression algorithm and level.
int fCompressionSettings = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps use kUnknownCompressionSettings here for consistency.

/// The fSize and fNElements member of the sealedPage parameters are always set. If sealedPage.fBuffer is nullptr,
/// no data will be copied but the returned size information can be used by the caller to allocate a large enough
/// buffer and call LoadSealedPage again.
/// Read the packed and compressed bytes of a page into the memory buffer provided by `sealedPage`. The sealed page
Copy link
Contributor

Choose a reason for hiding this comment

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

Very very nitpicky but if we're adding backticks here, they should probably also be added to the other comments (at least in this file).

sealedPageGroups.reserve(sealedPageGroups.size() + pages.fPageInfos.size());

std::uint64_t pageNo = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest using pageNumber or pageIdx. I don't think we use the ..No naming anywhere else.


const auto colRangeCompressionSettings = clusterDesc.GetColumnRange(columnId).fCompressionSettings;
const bool needsCompressionChange =
options.fCompressionSettings != -1 && colRangeCompressionSettings != options.fCompressionSettings;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
options.fCompressionSettings != -1 && colRangeCompressionSettings != options.fCompressionSettings;
options.fCompressionSettings != kUnknownCompressionSettings && colRangeCompressionSettings != options.fCompressionSettings;

@silverweed silverweed requested a review from enirolf July 9, 2024 06:46
@silverweed silverweed merged commit e9d61c7 into root-project:master Jul 10, 2024
18 checks passed
@silverweed silverweed deleted the ntuple_merge_change_compression branch July 10, 2024 09:04
Copy link
Contributor

@jblomer jblomer left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, one nit and one general comment: with growing complexity of the merger, perhaps it is time to split the main Merge function into more sub routines.

@@ -16,6 +16,7 @@
#ifndef ROOT7_RNTupleMerger
#define ROOT7_RNTupleMerger

#include "Compression.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Move below the include block of <ROOT/RHeader.hxx>

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.

None yet

3 participants