Skip to content

Commit 2cac53f

Browse files
committed
Removed cloning code from RNTuple implementation
Cloning is not an option for RNTuple.
1 parent f6b725e commit 2cac53f

File tree

10 files changed

+16
-644
lines changed

10 files changed

+16
-644
lines changed

FWIO/RNTupleTempInput/src/RNTupleTempSource.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ namespace edm::rntuple_temp {
163163

164164
std::shared_ptr<FileBlock> RNTupleTempSource::readFile_() {
165165
std::shared_ptr<FileBlock> fb = primaryFileSequence_->readFile_();
166-
if (secondaryFileSequence_) {
167-
fb->setNotFastClonable(FileBlock::HasSecondaryFileSequence);
168-
}
169166
return fb;
170167
}
171168

FWIO/RNTupleTempInput/src/RootFile.cc

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ namespace edm::rntuple_temp {
179179
noRunLumiSort_(processingOptions.noRunLumiSort),
180180
noEventSort_(processingOptions.noEventSort),
181181
enforceGUIDInFileName_(fileOptions.enforceGUIDInFileName),
182-
whyNotFastClonable_(0),
183182
hasNewlyDroppedBranch_(),
184183
branchListIndexesUnchanged_(false),
185184
eventAuxCache_(),
@@ -405,11 +404,6 @@ namespace edm::rntuple_temp {
405404
// propagate_const<T> has no reset() function
406405
provenanceReaderMaker_ = std::unique_ptr<MakeProvenanceReader>(makeProvenanceReaderMaker(inputType).release());
407406

408-
// Merge into the hashed registries.
409-
if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
410-
whyNotFastClonable_ += FileBlock::EventsOrLumisSelectedByID;
411-
}
412-
413407
initializeDuplicateChecker(crossFileInfo.indexesIntoFiles, crossFileInfo.currentIndexIntoFile);
414408
indexIntoFileIter_ = indexIntoFileBegin_ = indexIntoFile_.begin(
415409
processingOptions.noRunLumiSort
@@ -528,9 +522,6 @@ namespace edm::rntuple_temp {
528522
}
529523
}
530524

531-
// Determine if this file is fast clonable.
532-
setIfFastClonable(processingOptions.remainingEvents, processingOptions.remainingLumis);
533-
534525
// We are done with our initial reading of EventAuxiliary.
535526
indexIntoFile_.doneFileInitialization();
536527

@@ -630,51 +621,6 @@ namespace edm::rntuple_temp {
630621
}
631622
}
632623

633-
void RootFile::setIfFastClonable(int remainingEvents, int remainingLumis) {
634-
if (fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
635-
//we must avoid copying the old branch which stored the per product per event provenance
636-
whyNotFastClonable_ += FileBlock::FileTooOld;
637-
return;
638-
}
639-
if (!fileFormatVersion().splitProductIDs()) {
640-
whyNotFastClonable_ += FileBlock::FileTooOld;
641-
return;
642-
}
643-
if (processingMode_ != InputSource::RunsLumisAndEvents) {
644-
whyNotFastClonable_ += FileBlock::NotProcessingEvents;
645-
return;
646-
}
647-
// Find entry for first event in file
648-
IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
649-
while (it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
650-
++it;
651-
}
652-
if (it == indexIntoFileEnd_) {
653-
whyNotFastClonable_ += FileBlock::NoEventsInFile;
654-
return;
655-
}
656-
657-
// From here on, record all reasons we can't fast clone.
658-
IndexIntoFile::SortOrder sortOrder =
659-
(noRunLumiSort_ ? IndexIntoFile::entryOrder
660-
: (noEventSort_ ? IndexIntoFile::firstAppearanceOrder : IndexIntoFile::numericalOrder));
661-
if (!indexIntoFile_.iterationWillBeInEntryOrder(sortOrder)) {
662-
whyNotFastClonable_ += (noEventSort_ ? FileBlock::RunOrLumiNotContiguous : FileBlock::EventsToBeSorted);
663-
}
664-
if (skipAnyEvents_) {
665-
whyNotFastClonable_ += FileBlock::InitialEventsSkipped;
666-
}
667-
if (remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
668-
whyNotFastClonable_ += FileBlock::MaxEventsTooSmall;
669-
}
670-
if (remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
671-
whyNotFastClonable_ += FileBlock::MaxLumisTooSmall;
672-
}
673-
if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
674-
whyNotFastClonable_ += FileBlock::DuplicateEventsRemoved;
675-
}
676-
}
677-
678624
std::shared_ptr<FileBlock> RootFile::createFileBlock() {
679625
std::vector<TTree*> processBlockTrees;
680626
std::vector<std::string> processesWithProcessBlockTrees;
@@ -693,7 +639,7 @@ namespace edm::rntuple_temp {
693639
runTree_.metaTree(),
694640
std::move(processBlockTrees),
695641
std::move(processesWithProcessBlockTrees),
696-
whyNotFastClonable(),
642+
0,
697643
hasNewlyDroppedBranch(),
698644
file_,
699645
branchListIndexesUnchanged(),

FWIO/RNTupleTempInput/src/RootFile.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ namespace edm {
153153
RootRNTuple const& lumiTree() const { return lumiTree_; }
154154
RootRNTuple const& runTree() const { return runTree_; }
155155
FileFormatVersion fileFormatVersion() const { return fileFormatVersion_; }
156-
int whyNotFastClonable() const { return whyNotFastClonable_; }
157156
std::array<bool, NumBranchTypes> const& hasNewlyDroppedBranch() const { return hasNewlyDroppedBranch_; }
158157
bool branchListIndexesUnchanged() const { return branchListIndexesUnchanged_; }
159158
bool modifiedIDs() const { return daqProvenanceHelper_.get() != nullptr; }
@@ -214,7 +213,6 @@ namespace edm {
214213
InputType inputType,
215214
StoredProcessBlockHelper const& storedProcessBlockHelper);
216215
bool skipThisEntry();
217-
void setIfFastClonable(int remainingEvents, int remainingLumis);
218216
void validateFile(InputType inputType,
219217
bool usingGoToEvent,
220218
std::vector<ProcessHistoryID>& orderedProcessHistoryIDs);
@@ -288,7 +286,6 @@ namespace edm {
288286
bool noRunLumiSort_;
289287
bool noEventSort_;
290288
bool enforceGUIDInFileName_;
291-
int whyNotFastClonable_;
292289
std::array<bool, NumBranchTypes> hasNewlyDroppedBranch_;
293290
bool branchListIndexesUnchanged_;
294291
EventAuxiliary eventAuxCache_; //Should only be used by fillThisEventAuxiliary()

FWIO/RNTupleTempOutput/interface/RNTupleTempOutputModule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ namespace edm::rntuple_temp {
6666
std::string const& moduleLabel() const { return moduleLabel_; }
6767
unsigned int maxFileSize() const { return maxFileSize_; }
6868
int inputFileCount() const { return inputFileCount_; }
69-
int whyNotFastClonable() const { return whyNotFastClonable_; }
7069

7170
std::string const& currentFileName() const;
7271

@@ -213,7 +212,6 @@ namespace edm::rntuple_temp {
213212
int const splitLevel_;
214213
std::string basketOrder_;
215214
int const treeMaxVirtualSize_;
216-
int whyNotFastClonable_;
217215
DropMetaData dropMetaData_;
218216
std::string const moduleLabel_;
219217
bool initializedFromInput_;

FWIO/RNTupleTempOutput/src/RNTupleTempOutputModule.cc

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ namespace edm::rntuple_temp {
5050
splitLevel_(std::min<int>(pset.getUntrackedParameter<int>("splitLevel") + 1, 99)),
5151
basketOrder_(pset.getUntrackedParameter<std::string>("sortBaskets")),
5252
treeMaxVirtualSize_(pset.getUntrackedParameter<int>("treeMaxVirtualSize")),
53-
whyNotFastClonable_(pset.getUntrackedParameter<bool>("fastCloning") ? FileBlock::CanFastClone
54-
: FileBlock::DisabledInConfigFile),
5553
dropMetaData_(DropNone),
5654
moduleLabel_(pset.getParameter<std::string>("@module_label")),
5755
initializedFromInput_(false),
@@ -88,10 +86,6 @@ namespace edm::rntuple_temp {
8886
<< "Legal values are 'NONE', 'DROPPED', 'PRIOR', and 'ALL'.\n";
8987
}
9088

91-
if (!wantAllEvents()) {
92-
whyNotFastClonable_ += FileBlock::EventSelectionUsed;
93-
}
94-
9589
auto const& specialSplit{pset.getUntrackedParameterSetVector("overrideBranchesSplitLevel")};
9690

9791
specialSplitLevelForBranches_.reserve(specialSplit.size());
@@ -509,10 +503,7 @@ namespace edm::rntuple_temp {
509503
"Used by ROOT when fast copying. Affects performance.");
510504
desc.addUntracked<int>("treeMaxVirtualSize", -1)
511505
->setComment("Size of ROOT TTree TBasket cache. Affects performance.");
512-
desc.addUntracked<bool>("fastCloning", true)
513-
->setComment(
514-
"True: Allow fast copying, if possible.\n"
515-
"False: Disable fast copying.");
506+
desc.addUntracked<bool>("fastCloning", false)->setComment("Not used by RNTuple");
516507
desc.addUntracked("mergeJob", false)
517508
->setComment(
518509
"If set to true and fast copying is disabled, copy input file compression and basket sizes to the output "

0 commit comments

Comments
 (0)