Skip to content

Commit 500359e

Browse files
committed
Remove code supporting SubProcess and related to module deletion
1 parent c3e881e commit 500359e

15 files changed

+17
-128
lines changed

FWCore/Framework/interface/EDConsumerBase.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
// forward declarations
5757

5858
namespace edm {
59-
class ModuleProcessName;
6059
class ProductResolverIndexHelper;
6160
class ConsumesCollector;
6261
template <Transition Tr>
@@ -116,7 +115,6 @@ namespace edm {
116115
void labelsForToken(EDGetToken iToken, Labels& oLabels) const;
117116

118117
void modulesWhoseProductsAreConsumed(std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modulesAll,
119-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
120118
ProductRegistry const& preg,
121119
std::map<std::string, ModuleDescription const*> const& labelsToDesc,
122120
std::string const& processName) const;

FWCore/Framework/interface/ModuleProcessName.h

Lines changed: 0 additions & 30 deletions
This file was deleted.

FWCore/Framework/interface/PathsAndConsumesOfModules.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "FWCore/ServiceRegistry/interface/PathsAndConsumesOfModulesBase.h"
1616

1717
#include "FWCore/Framework/interface/ESRecordsToProductResolverIndices.h"
18-
#include "FWCore/Framework/interface/ModuleProcessName.h"
1918
#include "FWCore/ServiceRegistry/interface/ServiceRegistryfwd.h"
2019
#include "FWCore/Utilities/interface/BranchType.h"
2120
#include "FWCore/Utilities/interface/Transition.h"
@@ -50,9 +49,6 @@ namespace edm {
5049

5150
void removeModules(std::vector<ModuleDescription const*> const& modules);
5251

53-
std::vector<ModuleProcessName> const& modulesInPreviousProcessesWhoseProductsAreConsumedBy(
54-
unsigned int moduleID) const;
55-
5652
private:
5753
std::vector<std::string> const& doPaths() const override;
5854
std::vector<std::string> const& doEndPaths() const override;
@@ -98,7 +94,6 @@ namespace edm {
9894
std::vector<std::pair<unsigned int, unsigned int>> moduleIDToIndex_;
9995

10096
std::array<std::vector<std::vector<ModuleDescription const*>>, NumBranchTypes> modulesWhoseProductsAreConsumedBy_;
101-
std::vector<std::vector<ModuleProcessName>> modulesInPreviousProcessesWhoseProductsAreConsumedBy_;
10297

10398
std::array<std::vector<std::vector<eventsetup::ComponentDescription const*>>, kNumberOfEventSetupTransitions>
10499
esModulesWhoseProductsAreConsumedBy_;
@@ -117,8 +112,7 @@ namespace edm {
117112
bool eventSetupInfoInitialized_ = false;
118113
};
119114

120-
std::vector<ModuleDescription const*> nonConsumedUnscheduledModules(
121-
edm::PathsAndConsumesOfModulesBase const& iPnC, std::vector<ModuleProcessName>& consumedByChildren);
115+
std::vector<ModuleDescription const*> nonConsumedUnscheduledModules(edm::PathsAndConsumesOfModulesBase const& iPnC);
122116

123117
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const& iPnC, bool iPrintDependencies);
124118
} // namespace edm

FWCore/Framework/interface/Schedule.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,11 @@ namespace edm {
245245
std::vector<ModuleDescription const*>& descriptions,
246246
unsigned int hint) const;
247247

248-
void fillModuleAndConsumesInfo(
249-
std::vector<ModuleDescription const*>& allModuleDescriptions,
250-
std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
251-
std::array<std::vector<std::vector<ModuleDescription const*>>, NumBranchTypes>&
252-
modulesWhoseProductsAreConsumedBy,
253-
std::vector<std::vector<ModuleProcessName>>& modulesInPreviousProcessesWhoseProductsAreConsumedBy,
254-
ProductRegistry const& preg) const;
248+
void fillModuleAndConsumesInfo(std::vector<ModuleDescription const*>& allModuleDescriptions,
249+
std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
250+
std::array<std::vector<std::vector<ModuleDescription const*>>, NumBranchTypes>&
251+
modulesWhoseProductsAreConsumedBy,
252+
ProductRegistry const& preg) const;
255253

256254
void fillESModuleAndConsumesInfo(std::array<std::vector<std::vector<eventsetup::ComponentDescription const*>>,
257255
kNumberOfEventSetupTransitions>& esModulesWhoseProductsAreConsumedBy,

FWCore/Framework/interface/maker/Worker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ namespace edm {
7373
class EventPrincipal;
7474
class EventSetupImpl;
7575
class EarlyDeleteHelper;
76-
class ModuleProcessName;
7776
class ProductResolverIndexHelper;
7877
class ProductResolverIndexAndSkipBit;
7978
class ProductRegistry;
@@ -221,7 +220,6 @@ namespace edm {
221220

222221
virtual void modulesWhoseProductsAreConsumed(
223222
std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
224-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
225223
ProductRegistry const& preg,
226224
std::map<std::string, ModuleDescription const*> const& labelsToDesc) const = 0;
227225

FWCore/Framework/interface/maker/WorkerT.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ WorkerT: Code common to all workers.
2525

2626
namespace edm {
2727

28-
class ModuleProcessName;
2928
class ProductResolverIndexAndSkipBit;
3029
class ThinnedAssociationsHelper;
3130

@@ -130,11 +129,9 @@ namespace edm {
130129

131130
void modulesWhoseProductsAreConsumed(
132131
std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
133-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
134132
ProductRegistry const& preg,
135133
std::map<std::string, ModuleDescription const*> const& labelsToDesc) const override {
136-
module_->modulesWhoseProductsAreConsumed(
137-
modules, modulesInPreviousProcesses, preg, labelsToDesc, module_->moduleDescription().processName());
134+
module_->modulesWhoseProductsAreConsumed(modules, preg, labelsToDesc, module_->moduleDescription().processName());
138135
}
139136

140137
void esModulesWhoseProductsAreConsumed(

FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
namespace edm {
4545
class ModuleCallingContext;
46-
class ModuleProcessName;
4746
class ProductResolverIndexHelper;
4847
class EDConsumerBase;
4948
class PreallocationConfiguration;
@@ -122,7 +121,6 @@ namespace edm {
122121
const EDConsumerBase* consumer() const;
123122

124123
void modulesWhoseProductsAreConsumed(std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
125-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
126124
ProductRegistry const& preg,
127125
std::map<std::string, ModuleDescription const*> const& labelsToDesc,
128126
std::string const& processName) const;

FWCore/Framework/interface/stream/ProducingModuleAdaptorBase.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
namespace edm {
4949
class Event;
5050
class ModuleCallingContext;
51-
class ModuleProcessName;
5251
class ProductResolverIndexHelper;
5352
class EDConsumerBase;
5453
class PreallocationConfiguration;
@@ -114,7 +113,6 @@ namespace edm {
114113
virtual void selectInputProcessBlocks(ProductRegistry const&, ProcessBlockHelperBase const&) = 0;
115114

116115
void modulesWhoseProductsAreConsumed(std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
117-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
118116
ProductRegistry const& preg,
119117
std::map<std::string, ModuleDescription const*> const& labelsToDesc,
120118
std::string const& processName) const;

FWCore/Framework/src/EDConsumerBase.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "FWCore/Framework/interface/ConsumesCollector.h"
2323
#include "FWCore/Framework/interface/ESRecordsToProductResolverIndices.h"
2424
#include "FWCore/Framework/interface/ComponentDescription.h"
25-
#include "FWCore/Framework/interface/ModuleProcessName.h"
2625
#include "FWCore/MessageLogger/interface/MessageLogger.h"
2726
#include "FWCore/ServiceRegistry/interface/ModuleConsumesInfo.h"
2827
#include "FWCore/ServiceRegistry/interface/ModuleConsumesESInfo.h"
@@ -452,19 +451,11 @@ namespace {
452451

453452
void EDConsumerBase::modulesWhoseProductsAreConsumed(
454453
std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modulesAll,
455-
std::vector<ModuleProcessName>& modulesInPreviousProcesses,
456454
ProductRegistry const& preg,
457455
std::map<std::string, ModuleDescription const*> const& labelsToDesc,
458456
std::string const& processName) const {
459457
std::set<std::string> alreadyFound;
460458

461-
auto modulesInPreviousProcessesEmplace = [&modulesInPreviousProcesses](std::string_view module,
462-
std::string_view process) {
463-
auto it = std::lower_bound(
464-
modulesInPreviousProcesses.begin(), modulesInPreviousProcesses.end(), ModuleProcessName(module, process));
465-
modulesInPreviousProcesses.emplace(it, module, process);
466-
};
467-
468459
auto itKind = m_tokenInfo.begin<kKind>();
469460
auto itLabels = m_tokenInfo.begin<kLabels>();
470461
for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
@@ -491,9 +482,6 @@ void EDConsumerBase::modulesWhoseProductsAreConsumed(
491482
alreadyFound,
492483
labelsToDesc,
493484
preg);
494-
} else {
495-
// Product explicitly from different process than the current process, so must refer to an earlier process (unless it ends up "not found")
496-
modulesInPreviousProcessesEmplace(consumedModuleLabel, consumedProcessName);
497485
}
498486
}
499487
} else { // process name was empty
@@ -508,23 +496,9 @@ void EDConsumerBase::modulesWhoseProductsAreConsumed(
508496
alreadyFound,
509497
labelsToDesc,
510498
preg);
511-
} else {
512-
// Product did not match to current process, so must refer to an earlier process (unless it ends up "not found")
513-
// Recall that empty process name means "in the latest process" that can change event-by-event
514-
modulesInPreviousProcessesEmplace(consumedModuleLabel, matches.processName(j));
515499
}
516500
}
517501
}
518-
} else {
519-
// The skipCurrentProcess means the same as empty process name,
520-
// except the current process is skipped. Therefore need to do
521-
// the same matching as above.
522-
auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
523-
for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
524-
if (processName != matches.processName(j)) {
525-
modulesInPreviousProcessesEmplace(matches.moduleLabel(j), matches.processName(j));
526-
}
527-
}
528502
}
529503
}
530504
}

FWCore/Framework/src/EventProcessor.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,19 +623,17 @@ namespace edm {
623623
PathsAndConsumesOfModules pathsAndConsumesOfModules;
624624
pathsAndConsumesOfModules.initialize(schedule_.get(), preg());
625625

626-
std::vector<ModuleProcessName> consumedBySubProcesses;
627-
628626
// Note: all these may throw
629627
checkForModuleDependencyCorrectness(pathsAndConsumesOfModules, printDependencies_);
630628
if (deleteNonConsumedUnscheduledModules_) {
631-
if (auto const unusedModules = nonConsumedUnscheduledModules(pathsAndConsumesOfModules, consumedBySubProcesses);
629+
if (auto const unusedModules = nonConsumedUnscheduledModules(pathsAndConsumesOfModules);
632630
not unusedModules.empty()) {
633631
pathsAndConsumesOfModules.removeModules(unusedModules);
634632

635633
edm::LogInfo("DeleteModules").log([&unusedModules](auto& l) {
636-
l << "Following modules are not in any Path or EndPath, nor is their output consumed by any other module, "
637-
"and "
638-
"therefore they are deleted before beginJob transition.";
634+
l << "The following modules are not in any Path or EndPath, nor is their output consumed by any other "
635+
"module, "
636+
"and therefore they are deleted before the beginJob transition.";
639637
for (auto const& description : unusedModules) {
640638
l << "\n " << description->moduleLabel();
641639
}

0 commit comments

Comments
 (0)