Skip to content

Commit 3ac5df3

Browse files
committed
can add to all workers by calling WorkerManager::getWorker
1 parent 06e9871 commit 3ac5df3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

FWCore/Framework/interface/WorkerManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ namespace edm {
8787
SignallingProductRegistryFiller& preg,
8888
PreallocationConfiguration const* prealloc,
8989
std::shared_ptr<ProcessConfiguration const> processConfiguration,
90-
std::string const& label);
90+
std::string const& label,
91+
bool addToAllWorkers = true);
9192

9293
void resetAll();
9394

FWCore/Framework/src/GlobalSchedule.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace edm {
5353

5454
//side effect keeps this module around
5555
for (auto& wm : workerManagers_) {
56-
wm.addToAllWorkers(wm.getWorker(*modpset, pregistry, &prealloc, processConfiguration, moduleLabel));
56+
(void)wm.getWorker(*modpset, pregistry, &prealloc, processConfiguration, moduleLabel);
5757
}
5858
}
5959
}

FWCore/Framework/src/WorkerManager.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ namespace edm {
4242
SignallingProductRegistryFiller& preg,
4343
PreallocationConfiguration const* prealloc,
4444
std::shared_ptr<ProcessConfiguration const> processConfiguration,
45-
std::string const& label) {
45+
std::string const& label, bool addToAll) {
4646
WorkerParams params(&pset, preg, prealloc, processConfiguration, *actionTable_);
47-
return workerReg_.getWorker(params, label);
47+
auto worker = workerReg_.getWorker(params, label);
48+
if( nullptr != worker and addToAll) {
49+
addToAllWorkers(worker);
50+
}
51+
return worker;
4852
}
4953

5054
void WorkerManager::addToUnscheduledWorkers(ParameterSet& pset,

0 commit comments

Comments
 (0)