diff --git a/FWCore/Framework/interface/GlobalSchedule.h b/FWCore/Framework/interface/GlobalSchedule.h index caf64f69d226e..cb7bd3660f638 100644 --- a/FWCore/Framework/interface/GlobalSchedule.h +++ b/FWCore/Framework/interface/GlobalSchedule.h @@ -97,6 +97,11 @@ namespace edm { return std::span(workerManagers_) .subspan(numberOfConcurrentLumis_ + numberOfConcurrentRuns_, numberOfConcurrentProcessBlocks_); } + std::span inputProcessBlockManagers() { + return std::span(workerManagers_) + .subspan(numberOfConcurrentLumis_ + numberOfConcurrentRuns_ + numberOfConcurrentProcessBlocks_, + numberOfConcurrentInputProcessBlocks_); + } /// returns the action table ExceptionToActionTable const& actionTable() const { return workerManagers_[0].actionTable(); } @@ -127,6 +132,7 @@ namespace edm { unsigned int numberOfConcurrentLumis_; unsigned int numberOfConcurrentRuns_; static constexpr unsigned int numberOfConcurrentProcessBlocks_ = 1; + static constexpr unsigned int numberOfConcurrentInputProcessBlocks_ = 1; }; template @@ -165,7 +171,11 @@ namespace edm { if constexpr (T::branchType_ == InRun) { managers = runManagers(); } else if constexpr (T::branchType_ == InProcess) { - managers = processBlockManagers(); + if constexpr (T::transition_ == Transition::AccessInputProcessBlock) { + managers = inputProcessBlockManagers(); + } else { + managers = processBlockManagers(); + } } else { managers = lumisManagers(); } diff --git a/FWCore/Framework/src/GlobalSchedule.cc b/FWCore/Framework/src/GlobalSchedule.cc index 6609f15803da4..3bb1114cef74e 100644 --- a/FWCore/Framework/src/GlobalSchedule.cc +++ b/FWCore/Framework/src/GlobalSchedule.cc @@ -36,8 +36,8 @@ namespace edm { processContext_(processContext), numberOfConcurrentLumis_(prealloc.numberOfLuminosityBlocks()), numberOfConcurrentRuns_(prealloc.numberOfRuns()) { - unsigned int nManagers = - prealloc.numberOfLuminosityBlocks() + prealloc.numberOfRuns() + numberOfConcurrentProcessBlocks_; + unsigned int nManagers = prealloc.numberOfLuminosityBlocks() + prealloc.numberOfRuns() + + numberOfConcurrentProcessBlocks_ + numberOfConcurrentInputProcessBlocks_; workerManagers_.reserve(nManagers); for (unsigned int i = 0; i < nManagers; ++i) { workerManagers_.emplace_back(modReg, areg, actions); @@ -46,7 +46,7 @@ namespace edm { //side effect keeps this module around auto mod = modReg->getExistingModule(module->moduleLabel()); assert(mod); - if (mod->wantsProcessBlocks() or mod->wantsInputProcessBlocks()) { + if (mod->wantsProcessBlocks()) { for (auto& wm : processBlockManagers()) { (void)wm.getWorkerForModule(*module); } @@ -61,6 +61,11 @@ namespace edm { (void)wm.getWorkerForModule(*module); } } + if (mod->wantsInputProcessBlocks()) { + for (auto& wm : inputProcessBlockManagers()) { + (void)wm.getWorkerForModule(*module); + } + } } } // GlobalSchedule::GlobalSchedule