Skip to content

Commit 5d15428

Browse files
committed
Removed unused Worker related APIs
Worker API no longer build modules on demand.
1 parent b34ea0a commit 5d15428

File tree

4 files changed

+3
-80
lines changed

4 files changed

+3
-80
lines changed

FWCore/Framework/interface/WorkerManager.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ namespace edm {
4242

4343
void addToUnscheduledWorkers(ModuleDescription const& iDescription);
4444

45-
void addToUnscheduledWorkers(ParameterSet& pset,
46-
SignallingProductRegistryFiller& preg,
47-
PreallocationConfiguration const* prealloc,
48-
std::shared_ptr<ProcessConfiguration const> processConfiguration,
49-
std::string label,
50-
std::set<std::string>& unscheduledLabels,
51-
std::vector<std::string>& shouldBeUsedLabels);
52-
5345
template <typename T, typename U>
5446
void processOneOccurrenceAsync(WaitingTaskHolder,
5547
typename T::TransitionInfoType&,
@@ -76,13 +68,6 @@ namespace edm {
7668

7769
ExceptionToActionTable const& actionTable() const { return *actionTable_; }
7870

79-
Worker* getWorker(ParameterSet& pset,
80-
SignallingProductRegistryFiller& preg,
81-
PreallocationConfiguration const* prealloc,
82-
std::shared_ptr<ProcessConfiguration const> processConfiguration,
83-
std::string const& label,
84-
bool addToAllWorkers = true);
85-
8671
template <typename T>
8772
requires requires(T const& x) { x.moduleDescription(); }
8873
Worker* getWorkerForModule(T const& module) {

FWCore/Framework/interface/WorkerRegistry.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace edm {
2020

2121
class Worker;
2222
class ActivityRegistry;
23-
struct WorkerParams;
2423
class ModuleRegistry;
2524
class ModuleTypeResolverMaker;
2625
class ParameterSet;
@@ -46,17 +45,13 @@ namespace edm {
4645
WorkerRegistry(WorkerRegistry const&) = delete; // Disallow copying and moving
4746
WorkerRegistry& operator=(WorkerRegistry const&) = delete; // Disallow copying and moving
4847

49-
/// Retrieve the particular instance of the worker
50-
/** If the worker with that set of parameters does not exist,
51-
create it
52-
@note Workers are owned by this class, do not delete them*/
53-
Worker* getWorker(WorkerParams const& p, std::string const& moduleLabel);
54-
5548
/// Retrieve particular instance of the worker without creating it
5649
/// If one doesn't exist, returns nullptr
5750
Worker const* get(std::string const& moduleLabel) const;
5851

59-
//Creates worker if needed
52+
/** Creates worker if doesn't already exist
53+
* @note Workers are owned by this class, do not delete them
54+
*/
6055
Worker* getWorkerFromExistingModule(std::string const& moduleLabel, ExceptionToActionTable const* actions);
6156

6257
/// Deletes the module of the Worker, but the Worker continues to exist.

FWCore/Framework/src/WorkerManager.cc

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ namespace edm {
3838
}
3939
}
4040

41-
Worker* WorkerManager::getWorker(ParameterSet& pset,
42-
SignallingProductRegistryFiller& preg,
43-
PreallocationConfiguration const* prealloc,
44-
std::shared_ptr<ProcessConfiguration const> processConfiguration,
45-
std::string const& label,
46-
bool addToAll) {
47-
WorkerParams params(&pset, preg, prealloc, processConfiguration, *actionTable_);
48-
auto worker = workerReg_.getWorker(params, label);
49-
if (nullptr != worker and addToAll) {
50-
addToAllWorkers(worker);
51-
}
52-
return worker;
53-
}
54-
5541
Worker* WorkerManager::getWorkerForExistingModule(std::string const& label) {
5642
auto worker = workerReg_.getWorkerFromExistingModule(label, actionTable_);
5743
if (nullptr != worker) {
@@ -69,29 +55,6 @@ namespace edm {
6955
addToAllWorkers(newWorker);
7056
}
7157

72-
void WorkerManager::addToUnscheduledWorkers(ParameterSet& pset,
73-
SignallingProductRegistryFiller& preg,
74-
PreallocationConfiguration const* prealloc,
75-
std::shared_ptr<ProcessConfiguration const> processConfiguration,
76-
std::string label,
77-
std::set<std::string>& unscheduledLabels,
78-
std::vector<std::string>& shouldBeUsedLabels) {
79-
//Need to
80-
// 1) create worker
81-
// 2) if it is a WorkerT<EDProducer>, add it to our list
82-
auto modType = pset.getParameter<std::string>("@module_edm_type");
83-
if (modType == kProducerType || modType == kFilterType) {
84-
Worker* newWorker = getWorker(pset, preg, prealloc, processConfiguration, label);
85-
assert(newWorker->moduleType() == Worker::kProducer || newWorker->moduleType() == Worker::kFilter);
86-
unscheduledLabels.insert(label);
87-
unscheduled_.addWorker(newWorker);
88-
//add to list so it gets reset each new event
89-
addToAllWorkers(newWorker);
90-
} else {
91-
shouldBeUsedLabels.push_back(label);
92-
}
93-
}
94-
9558
void WorkerManager::resetAll() { for_all(allWorkers_, std::bind(&Worker::reset, std::placeholders::_1)); }
9659

9760
void WorkerManager::addToAllWorkers(Worker* w) {

FWCore/Framework/src/WorkerRegistry.cc

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,6 @@ namespace edm {
2222

2323
void WorkerRegistry::clear() { m_workerMap.clear(); }
2424

25-
Worker* WorkerRegistry::getWorker(WorkerParams const& p, std::string const& moduleLabel) {
26-
WorkerMap::iterator workerIt = m_workerMap.find(moduleLabel);
27-
28-
// if the worker is not there, make it
29-
if (workerIt == m_workerMap.end()) {
30-
MakeModuleParams mmp(p.pset_, *p.reg_, p.preallocate_, p.processConfiguration_);
31-
auto modulePtr = modRegistry_->getModule(
32-
mmp, moduleLabel, actReg_->preModuleConstructionSignal_, actReg_->postModuleConstructionSignal_);
33-
auto workerPtr = modulePtr->makeWorker(p.actions_);
34-
35-
workerPtr->setActivityRegistry(actReg_);
36-
37-
// Transfer ownership of worker to the registry
38-
m_workerMap[moduleLabel] =
39-
std::shared_ptr<Worker>(workerPtr.release()); // propagate_const<T> has no reset() function
40-
return m_workerMap[moduleLabel].get();
41-
}
42-
return (workerIt->second.get());
43-
}
44-
4525
Worker const* WorkerRegistry::get(std::string const& moduleLabel) const {
4626
WorkerMap::const_iterator workerIt = m_workerMap.find(moduleLabel);
4727
if (workerIt != m_workerMap.end()) {

0 commit comments

Comments
 (0)