diff --git a/EventFilter/Utilities/interface/EvFDaqDirector.h b/EventFilter/Utilities/interface/EvFDaqDirector.h index c0661170fe292..4f3bfc27cb1bb 100644 --- a/EventFilter/Utilities/interface/EvFDaqDirector.h +++ b/EventFilter/Utilities/interface/EvFDaqDirector.h @@ -34,7 +34,6 @@ class GlobalContext; class StreamID; namespace edm { - class PathsAndConsumesOfModulesBase; class ProcessContext; } // namespace edm diff --git a/EventFilter/Utilities/interface/FastMonitoringService.h b/EventFilter/Utilities/interface/FastMonitoringService.h index e8ae97b80b87f..1c6cc57443cb3 100644 --- a/EventFilter/Utilities/interface/FastMonitoringService.h +++ b/EventFilter/Utilities/interface/FastMonitoringService.h @@ -13,8 +13,6 @@ #include -#include "EventFilter/Utilities/interface/FastMonitoringService.h" - #include #include #include @@ -181,7 +179,7 @@ namespace evf { void preallocate(edm::service::SystemBounds const&); void jobFailure(); - void preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const& pc); + void preBeginJob(edm::ProcessContext const& pc); void preModuleBeginJob(edm::ModuleDescription const&); void postBeginJob(); diff --git a/EventFilter/Utilities/src/FastMonitoringService.cc b/EventFilter/Utilities/src/FastMonitoringService.cc index b7a85b3b1e1a4..9539b61b0f16e 100644 --- a/EventFilter/Utilities/src/FastMonitoringService.cc +++ b/EventFilter/Utilities/src/FastMonitoringService.cc @@ -15,7 +15,6 @@ #include "FWCore/Utilities/interface/UnixSignalHandlers.h" #include "FWCore/ServiceRegistry/interface/ModuleCallingContext.h" -#include "FWCore/ServiceRegistry/interface/PathsAndConsumesOfModulesBase.h" #include "DataFormats/Provenance/interface/ModuleDescription.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" @@ -318,7 +317,7 @@ namespace evf { //start concurrency tracking } - void FastMonitoringService::preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const& pc) { + void FastMonitoringService::preBeginJob(edm::ProcessContext const& pc) { // FIND RUN DIRECTORY // The run dir should be set via the configuration of EvFDaqDirector if (tbbConcurrencyTracker_) diff --git a/FWCore/Framework/interface/GlobalSchedule.h b/FWCore/Framework/interface/GlobalSchedule.h index bb5f0d36a45a6..ebb2b8cf2cc25 100644 --- a/FWCore/Framework/interface/GlobalSchedule.h +++ b/FWCore/Framework/interface/GlobalSchedule.h @@ -77,7 +77,6 @@ namespace edm { void beginJob(ProductRegistry const&, eventsetup::ESRecordsToProductResolverIndices const&, ProcessBlockHelperBase const&, - PathsAndConsumesOfModulesBase const&, ProcessContext const&); void endJob(ExceptionCollector& collector); diff --git a/FWCore/Framework/interface/Schedule.h b/FWCore/Framework/interface/Schedule.h index b88ff01739688..a63ff8521f79e 100644 --- a/FWCore/Framework/interface/Schedule.h +++ b/FWCore/Framework/interface/Schedule.h @@ -173,7 +173,6 @@ namespace edm { void beginJob(ProductRegistry const&, eventsetup::ESRecordsToProductResolverIndices const&, ProcessBlockHelperBase const&, - PathsAndConsumesOfModulesBase const&, ProcessContext const&); void endJob(ExceptionCollector& collector); void sendFwkSummaryToMessageLogger() const; diff --git a/FWCore/Framework/src/EventProcessor.cc b/FWCore/Framework/src/EventProcessor.cc index caedf824f2131..32ed0273e36df 100644 --- a/FWCore/Framework/src/EventProcessor.cc +++ b/FWCore/Framework/src/EventProcessor.cc @@ -738,8 +738,7 @@ namespace edm { // after they all complete. std::exception_ptr firstException; CMS_SA_ALLOW try { - schedule_->beginJob( - *preg_, esRecordsToProductResolverIndices, *processBlockHelper_, pathsAndConsumesOfModules, processContext_); + schedule_->beginJob(*preg_, esRecordsToProductResolverIndices, *processBlockHelper_, processContext_); } catch (...) { firstException = std::current_exception(); } diff --git a/FWCore/Framework/src/GlobalSchedule.cc b/FWCore/Framework/src/GlobalSchedule.cc index db4f61fde210e..13b7ca52c6a1a 100644 --- a/FWCore/Framework/src/GlobalSchedule.cc +++ b/FWCore/Framework/src/GlobalSchedule.cc @@ -98,7 +98,6 @@ namespace edm { void GlobalSchedule::beginJob(ProductRegistry const& iRegistry, eventsetup::ESRecordsToProductResolverIndices const& iESIndices, ProcessBlockHelperBase const& processBlockHelperBase, - PathsAndConsumesOfModulesBase const& pathsAndConsumesOfModules, ProcessContext const& processContext) { GlobalContext globalContext(GlobalContext::Transition::kBeginJob, processContext_); unsigned int const managerIndex = @@ -107,9 +106,7 @@ namespace edm { std::exception_ptr exceptionPtr; CMS_SA_ALLOW try { try { - convertException::wrap([this, &pathsAndConsumesOfModules, &processContext]() { - actReg_->preBeginJobSignal_(pathsAndConsumesOfModules, processContext); - }); + convertException::wrap([this, &processContext]() { actReg_->preBeginJobSignal_(processContext); }); } catch (cms::Exception& ex) { exceptionContext(ex, globalContext, "Handling pre signal, likely in a service function"); throw; diff --git a/FWCore/Framework/src/Schedule.cc b/FWCore/Framework/src/Schedule.cc index a442455db3f4d..323fb6eb60b88 100644 --- a/FWCore/Framework/src/Schedule.cc +++ b/FWCore/Framework/src/Schedule.cc @@ -1192,9 +1192,8 @@ namespace edm { void Schedule::beginJob(ProductRegistry const& iRegistry, eventsetup::ESRecordsToProductResolverIndices const& iESIndices, ProcessBlockHelperBase const& processBlockHelperBase, - PathsAndConsumesOfModulesBase const& pathsAndConsumesOfModules, ProcessContext const& processContext) { - globalSchedule_->beginJob(iRegistry, iESIndices, processBlockHelperBase, pathsAndConsumesOfModules, processContext); + globalSchedule_->beginJob(iRegistry, iESIndices, processBlockHelperBase, processContext); } void Schedule::beginStream(unsigned int streamID) { diff --git a/FWCore/Framework/src/SubProcess.cc b/FWCore/Framework/src/SubProcess.cc index 6428d06714038..fde5a6952399c 100644 --- a/FWCore/Framework/src/SubProcess.cc +++ b/FWCore/Framework/src/SubProcess.cc @@ -333,8 +333,7 @@ namespace edm { std::exception_ptr firstException; CMS_SA_ALLOW try { - schedule_->beginJob( - *preg_, esp_->recordsToResolverIndices(), *processBlockHelper_, *pathsAndConsumesOfModules_, processContext_); + schedule_->beginJob(*preg_, esp_->recordsToResolverIndices(), *processBlockHelper_, processContext_); } catch (...) { firstException = std::current_exception(); } diff --git a/FWCore/Integration/plugins/PathsAndConsumesOfModulesTestService.cc b/FWCore/Integration/plugins/PathsAndConsumesOfModulesTestService.cc index ccf231d0fef68..ce572eb561032 100644 --- a/FWCore/Integration/plugins/PathsAndConsumesOfModulesTestService.cc +++ b/FWCore/Integration/plugins/PathsAndConsumesOfModulesTestService.cc @@ -14,7 +14,8 @@ namespace edmtest { public: PathsAndConsumesOfModulesTestService(edm::ParameterSet const& pset, edm::ActivityRegistry& iRegistry) : modulesConsumes_(pset.getParameter("modulesAndConsumes")) { - iRegistry.watchPreBeginJob(this, &PathsAndConsumesOfModulesTestService::preBeginJob); + iRegistry.watchLookupInitializationComplete(this, + &PathsAndConsumesOfModulesTestService::lookupInitializationComplete); } static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -29,7 +30,8 @@ namespace edmtest { descriptions.setComment("This service is intended to be used in framework tests."); } - void preBeginJob(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, edm::ProcessContext const&) const { + void lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, + edm::ProcessContext const&) const { auto const& allModules = pathsAndConsumes.allModules(); for (auto const& moduleToCheck : modulesConsumes_) { auto found = diff --git a/FWCore/Integration/plugins/TestServiceOne.cc b/FWCore/Integration/plugins/TestServiceOne.cc index b2b17f9bc02da..c48f98e6d84ae 100644 --- a/FWCore/Integration/plugins/TestServiceOne.cc +++ b/FWCore/Integration/plugins/TestServiceOne.cc @@ -142,7 +142,7 @@ namespace edmtest { descriptions.add("TestServiceOne", desc); } - void TestServiceOne::preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&) { + void TestServiceOne::preBeginJob(edm::ProcessContext const&) { ++nPreBeginJob_; if (verbose_) { edm::LogAbsolute out("TestServiceOne"); diff --git a/FWCore/Integration/plugins/TestServiceOne.h b/FWCore/Integration/plugins/TestServiceOne.h index 170c17f159288..57d1e35d8fff2 100644 --- a/FWCore/Integration/plugins/TestServiceOne.h +++ b/FWCore/Integration/plugins/TestServiceOne.h @@ -29,7 +29,7 @@ namespace edmtest { static void fillDescriptions(edm::ConfigurationDescriptions&); - void preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); + void preBeginJob(edm::ProcessContext const&); void postBeginJob(); void preEndJob(); void postEndJob(); diff --git a/FWCore/PrescaleService/interface/PrescaleService.h b/FWCore/PrescaleService/interface/PrescaleService.h index a07e81aff0a59..bc19f08dd30b8 100644 --- a/FWCore/PrescaleService/interface/PrescaleService.h +++ b/FWCore/PrescaleService/interface/PrescaleService.h @@ -12,7 +12,6 @@ namespace edm { class ActivityRegistry; class ConfigurationDescriptions; - class PathsAndConsumesOfModulesBase; class ProcessContext; namespace service { @@ -46,7 +45,7 @@ namespace edm { // // private member functions // - void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); + void preBeginJob(ProcessContext const&); void postBeginJob(); // diff --git a/FWCore/PrescaleService/src/PrescaleService.cc b/FWCore/PrescaleService/src/PrescaleService.cc index e74a15fcc8b94..566e15be9803f 100644 --- a/FWCore/PrescaleService/src/PrescaleService.cc +++ b/FWCore/PrescaleService/src/PrescaleService.cc @@ -57,7 +57,7 @@ namespace edm { // member functions - void PrescaleService::preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const& processContext) { + void PrescaleService::preBeginJob(ProcessContext const& processContext) { if (!processParameterSetID_.isValid()) { processParameterSetID_ = processContext.parameterSetID(); } diff --git a/FWCore/ServiceRegistry/interface/ActivityRegistry.h b/FWCore/ServiceRegistry/interface/ActivityRegistry.h index 525fc8b435f53..1be0dbba91925 100644 --- a/FWCore/ServiceRegistry/interface/ActivityRegistry.h +++ b/FWCore/ServiceRegistry/interface/ActivityRegistry.h @@ -171,12 +171,12 @@ namespace edm { } AR_WATCH_USING_METHOD_2(watchEventSetupConfiguration) - typedef signalslot::Signal PreBeginJob; + typedef signalslot::Signal PreBeginJob; ///signal is emitted before all modules have gotten their beginJob called PreBeginJob preBeginJobSignal_; ///convenience function for attaching to signal void watchPreBeginJob(PreBeginJob::slot_type const& iSlot) { preBeginJobSignal_.connect(iSlot); } - AR_WATCH_USING_METHOD_2(watchPreBeginJob) + AR_WATCH_USING_METHOD_1(watchPreBeginJob) typedef signalslot::Signal PostBeginJob; ///signal is emitted after all modules have gotten their beginJob called diff --git a/FWCore/Services/plugins/CheckTransitions.cc b/FWCore/Services/plugins/CheckTransitions.cc index 80a38e2f1d66c..18b95570eb9d5 100644 --- a/FWCore/Services/plugins/CheckTransitions.cc +++ b/FWCore/Services/plugins/CheckTransitions.cc @@ -50,7 +50,6 @@ namespace edm { void preallocate(service::SystemBounds const&); - void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); void postEndJob(); void preOpenFile(std::string const&); diff --git a/FWCore/Services/plugins/CondorStatusUpdater.cc b/FWCore/Services/plugins/CondorStatusUpdater.cc index 5f1afddd412e4..7c70b4ab8f8f2 100644 --- a/FWCore/Services/plugins/CondorStatusUpdater.cc +++ b/FWCore/Services/plugins/CondorStatusUpdater.cc @@ -59,7 +59,7 @@ namespace edm { void eventPost(StreamContext const &iContext); void lumiPost(GlobalContext const &); void runPost(GlobalContext const &); - void beginPre(PathsAndConsumesOfModulesBase const &, ProcessContext const &processContext); + void beginPre(ProcessContext const &processContext); void beginPost(); void endPost(); void filePost(std::string const &); @@ -150,7 +150,7 @@ void CondorStatusService::filePost(std::string const & /*lfn*/) { update(); } -void CondorStatusService::beginPre(PathsAndConsumesOfModulesBase const &, ProcessContext const &processContext) { +void CondorStatusService::beginPre(ProcessContext const &processContext) { secondUpdate(); if (!m_processParameterSetID.isValid()) { m_processParameterSetID = processContext.parameterSetID(); diff --git a/FWCore/Services/plugins/DependencyGraph.cc b/FWCore/Services/plugins/DependencyGraph.cc index 5c626c1dc1df5..50af8437da996 100644 --- a/FWCore/Services/plugins/DependencyGraph.cc +++ b/FWCore/Services/plugins/DependencyGraph.cc @@ -58,8 +58,7 @@ class DependencyGraph { static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); void preSourceConstruction(ModuleDescription const &); - void preBeginJob(PathsAndConsumesOfModulesBase const &, ProcessContext const &); - void postBeginJob(); + void lookupInitializationComplete(PathsAndConsumesOfModulesBase const &, ProcessContext const &); private: bool highlighted(std::string const &module) { return (m_highlightModules.find(module) != m_highlightModules.end()); } @@ -171,8 +170,7 @@ DependencyGraph::DependencyGraph(ParameterSet const &config, ActivityRegistry &r m_showPathDependencies(config.getUntrackedParameter("showPathDependencies")), m_initialized(false) { registry.watchPreSourceConstruction(this, &DependencyGraph::preSourceConstruction); - registry.watchPreBeginJob(this, &DependencyGraph::preBeginJob); - registry.watchPostBeginJob(this, &DependencyGraph::postBeginJob); + registry.watchLookupInitializationComplete(this, &DependencyGraph::lookupInitializationComplete); } // adaptor to use range-based for loops with boost::graph edges(...) and vertices(...) functions @@ -204,8 +202,8 @@ void DependencyGraph::preSourceConstruction(ModuleDescription const &module) { attributes["fillcolor"] = highlighted(module.moduleLabel()) ? "lightgreen" : "white"; } -void DependencyGraph::preBeginJob(PathsAndConsumesOfModulesBase const &pathsAndConsumes, - ProcessContext const &context) { +void DependencyGraph::lookupInitializationComplete(PathsAndConsumesOfModulesBase const &pathsAndConsumes, + ProcessContext const &context) { // if the Service is not in the main Process do not do anything if (context.isSubProcess() and not m_initialized) { edm::LogError("DependencyGraph") << "You have requested an instance of the DependencyGraph Service in the \"" @@ -398,11 +396,6 @@ void DependencyGraph::preBeginJob(PathsAndConsumesOfModulesBase const &pathsAndC previous = module; } } -} - -void DependencyGraph::postBeginJob() { - if (not m_initialized) - return; // remove the nodes corresponding to the modules that have been removed from the process for (int i = boost::num_vertices(m_graph) - 1; i > 1; --i) { diff --git a/FWCore/Services/plugins/Timing.cc b/FWCore/Services/plugins/Timing.cc index 74dcb5df0cd9f..dab8c7ead8175 100644 --- a/FWCore/Services/plugins/Timing.cc +++ b/FWCore/Services/plugins/Timing.cc @@ -59,7 +59,7 @@ namespace edm { double getTotalCPU() const override; private: - void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); + void preBeginJob(ProcessContext const&); void beginProcessing(); void postEndJob(); @@ -438,7 +438,7 @@ namespace edm { descriptions.setComment("This service reports the time it takes to run each module in a job."); } - void Timing::preBeginJob(PathsAndConsumesOfModulesBase const& pathsAndConsumes, ProcessContext const& pc) { + void Timing::preBeginJob(ProcessContext const& pc) { if (pc.isSubProcess()) { ++nSubProcesses_; } else { diff --git a/FWCore/Services/plugins/Tracer.cc b/FWCore/Services/plugins/Tracer.cc index 8cf86722cc77a..736f1eb8f3506 100644 --- a/FWCore/Services/plugins/Tracer.cc +++ b/FWCore/Services/plugins/Tracer.cc @@ -67,7 +67,7 @@ namespace edm { void preallocate(service::SystemBounds const&); - void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); + void preBeginJob(ProcessContext const&); void postBeginJob(); void preEndJob(); void postEndJob(); @@ -546,7 +546,7 @@ void Tracer::preallocate(service::SystemBounds const& bounds) { << bounds.maxNumberOfStreams() << " streams"; } -void Tracer::preBeginJob(PathsAndConsumesOfModulesBase const& pathsAndConsumes, ProcessContext const& pc) { +void Tracer::preBeginJob(ProcessContext const& pc) { LogAbsolute out("Tracer"); out << TimeStamper(printTimestamps_) << indention_ << " starting: begin job"; } diff --git a/FWCore/Services/plugins/tracer_setupFile.cc b/FWCore/Services/plugins/tracer_setupFile.cc index 2221489942b2a..fe84e704633a3 100644 --- a/FWCore/Services/plugins/tracer_setupFile.cc +++ b/FWCore/Services/plugins/tracer_setupFile.cc @@ -404,7 +404,7 @@ namespace edm::service::tracer { moduleCtrDtrPtr, sourceCtrPtr, beginTime, - beginTracer](auto&, auto&) mutable { + beginTracer](auto&) mutable { { std::ostringstream oss; moduleIdToLabel(oss, *moduleLabelsPtr, 'M', "EDModule ID", "Module label"); diff --git a/FWCore/TestProcessor/src/TestProcessor.cc b/FWCore/TestProcessor/src/TestProcessor.cc index 0114d09af4a0c..2ddfaa5d0ce01 100644 --- a/FWCore/TestProcessor/src/TestProcessor.cc +++ b/FWCore/TestProcessor/src/TestProcessor.cc @@ -23,7 +23,6 @@ #include "FWCore/Framework/interface/ProcessBlockPrincipal.h" #include "FWCore/Framework/interface/ExceptionActions.h" #include "FWCore/Framework/interface/HistoryAppender.h" -#include "FWCore/Framework/interface/PathsAndConsumesOfModules.h" #include "FWCore/Framework/interface/RunPrincipal.h" #include "FWCore/Framework/interface/ESRecordsToProductResolverIndices.h" #include "FWCore/Framework/interface/EventSetupsController.h" @@ -429,19 +428,11 @@ namespace edm { preallocations_.numberOfThreads()); actReg_->preallocateSignal_(bounds); schedule_->convertCurrentProcessAlias(processConfiguration_->processName()); - PathsAndConsumesOfModules pathsAndConsumesOfModules; - - //The code assumes only modules make data in the current process - // Since the test os also allowed to do so, it can lead to problems. - //pathsAndConsumesOfModules.initialize(schedule_.get(), preg_); espController_->finishConfiguration(); actReg_->eventSetupConfigurationSignal_(esp_->recordsToResolverIndices(), processContext_); - //NOTE: this may throw - //checkForModuleDependencyCorrectness(pathsAndConsumesOfModules, false); - schedule_->beginJob( - *preg_, esp_->recordsToResolverIndices(), *processBlockHelper_, pathsAndConsumesOfModules, processContext_); + schedule_->beginJob(*preg_, esp_->recordsToResolverIndices(), *processBlockHelper_, processContext_); for (unsigned int i = 0; i < preallocations_.numberOfStreams(); ++i) { schedule_->beginStream(i); diff --git a/HLTrigger/Timer/interface/ProcessCallGraph.h b/HLTrigger/Timer/interface/ProcessCallGraph.h index f272a539e67c2..bc1f7ab77a636 100644 --- a/HLTrigger/Timer/interface/ProcessCallGraph.h +++ b/HLTrigger/Timer/interface/ProcessCallGraph.h @@ -125,8 +125,8 @@ class ProcessCallGraph { // to be called from preSourceConstruction(...) void preSourceConstruction(edm::ModuleDescription const &); - // to be called from preBeginJob(...) - void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &); + // to be called from lookupInitializationComplete(...) + void lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &); // number of modules stored in the call graph unsigned int size() const; diff --git a/HLTrigger/Timer/plugins/FastTimerService.cc b/HLTrigger/Timer/plugins/FastTimerService.cc index 339069acdbbd7..b1d934f004cda 100644 --- a/HLTrigger/Timer/plugins/FastTimerService.cc +++ b/HLTrigger/Timer/plugins/FastTimerService.cc @@ -822,8 +822,7 @@ FastTimerService::FastTimerService(const edm::ParameterSet& config, edm::Activit // register EDM call backs registry.watchPreallocate(this, &FastTimerService::preallocate); - registry.watchPreBeginJob(this, &FastTimerService::preBeginJob); - registry.watchPostBeginJob(this, &FastTimerService::postBeginJob); + registry.watchLookupInitializationComplete(this, &FastTimerService::lookupInitializationComplete); registry.watchPostEndJob(this, &FastTimerService::postEndJob); registry.watchPreGlobalBeginRun(this, &FastTimerService::preGlobalBeginRun); //registry.watchPostGlobalBeginRun( this, & FastTimerService::postGlobalBeginRun ); @@ -990,12 +989,9 @@ void FastTimerService::preSourceConstruction(edm::ModuleDescription const& modul callgraph_.preSourceConstruction(module); } -void FastTimerService::preBeginJob(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, - edm::ProcessContext const& context) { - callgraph_.preBeginJob(pathsAndConsumes, context); -} - -void FastTimerService::postBeginJob() { +void FastTimerService::lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, + edm::ProcessContext const& context) { + callgraph_.lookupInitializationComplete(pathsAndConsumes, context); unsigned int modules = callgraph_.size(); // module highlights diff --git a/HLTrigger/Timer/plugins/FastTimerService.h b/HLTrigger/Timer/plugins/FastTimerService.h index a9cf9fe4dfadc..02b5adc1f80de 100644 --- a/HLTrigger/Timer/plugins/FastTimerService.h +++ b/HLTrigger/Timer/plugins/FastTimerService.h @@ -65,8 +65,7 @@ class FastTimerService : public tbb::task_scheduler_observer { void preallocate(edm::service::SystemBounds const&); - void preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); - void postBeginJob(); + void lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); void postEndJob(); diff --git a/HLTrigger/Timer/src/ProcessCallGraph.cc b/HLTrigger/Timer/src/ProcessCallGraph.cc index 2a522e10d226a..f6924bf56e6c9 100644 --- a/HLTrigger/Timer/src/ProcessCallGraph.cc +++ b/HLTrigger/Timer/src/ProcessCallGraph.cc @@ -58,8 +58,8 @@ void ProcessCallGraph::preSourceConstruction(edm::ModuleDescription const& modul // FIXME // - check that all module ids are valid (e.g. subprocesses are not being added in // the wrong order) -void ProcessCallGraph::preBeginJob(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, - edm::ProcessContext const& context) { +void ProcessCallGraph::lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, + edm::ProcessContext const& context) { unsigned int pid = registerProcess(context); // check that the Source has already been added diff --git a/HeterogeneousCore/CUDAServices/plugins/NVProfilerService.cc b/HeterogeneousCore/CUDAServices/plugins/NVProfilerService.cc index ad06622484836..d18f290f57ac2 100644 --- a/HeterogeneousCore/CUDAServices/plugins/NVProfilerService.cc +++ b/HeterogeneousCore/CUDAServices/plugins/NVProfilerService.cc @@ -125,9 +125,11 @@ class NVProfilerService { void preallocate(edm::service::SystemBounds const&); // these signal pair are NOT guaranteed to be called by the same thread - void preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); + void preBeginJob(edm::ProcessContext const&); void postBeginJob(); + void lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); + // there is no preEndJob() signal void postEndJob(); @@ -325,6 +327,8 @@ NVProfilerService::NVProfilerService(edm::ParameterSet const& config, edm::Activ registry.watchPreBeginJob(this, &NVProfilerService::preBeginJob); registry.watchPostBeginJob(this, &NVProfilerService::postBeginJob); + registry.watchLookupInitializationComplete(this, &NVProfilerService::lookupInitializationComplete); + // there is no preEndJob() signal registry.watchPostEndJob(this, &NVProfilerService::postEndJob); @@ -514,6 +518,10 @@ void NVProfilerService::preallocate(edm::service::SystemBounds const& bounds) { event_.resize(concurrentStreams); stream_modules_.resize(concurrentStreams); + for (auto& modulesForOneStream : stream_modules_) { + modulesForOneStream.resize(global_modules_.size(), nvtxInvalidRangeId); + } + if (skipFirstEvent_) { globalFirstEventDone_ = false; std::vector> tmp(concurrentStreams); @@ -523,18 +531,8 @@ void NVProfilerService::preallocate(edm::service::SystemBounds const& bounds) { } } -void NVProfilerService::preBeginJob(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, - edm::ProcessContext const& context) { - callgraph_.preBeginJob(pathsAndConsumes, context); +void NVProfilerService::preBeginJob(edm::ProcessContext const& context) { nvtxDomainMark(global_domain_, "preBeginJob"); - - // this assumes that preBeginJob is not called concurrently with the modules' beginJob method - // or the preBeginJob for a subprocess - unsigned int modules = callgraph_.size(); - global_modules_.resize(modules, nvtxInvalidRangeId); - for (unsigned int sid = 0; sid < stream_modules_.size(); ++sid) { - stream_modules_[sid].resize(modules, nvtxInvalidRangeId); - } } void NVProfilerService::postBeginJob() { @@ -543,6 +541,11 @@ void NVProfilerService::postBeginJob() { } } +void NVProfilerService::lookupInitializationComplete(edm::PathsAndConsumesOfModulesBase const& pathsAndConsumes, + edm::ProcessContext const& context) { + callgraph_.lookupInitializationComplete(pathsAndConsumes, context); +} + void NVProfilerService::postEndJob() { if (not skipFirstEvent_ or globalFirstEventDone_) { nvtxDomainMark(global_domain_, "postEndJob"); @@ -811,9 +814,18 @@ void NVProfilerService::postModuleEventPrefetching(edm::StreamContext const& sc, } void NVProfilerService::preModuleConstruction(edm::ModuleDescription const& desc) { + auto mid = desc.id(); + global_modules_.grow_to_at_least(mid + 1); + + // This normally does nothing because stream_modules_ is empty when + // called. But there is a rare case when a looper is used that replacement + // modules can be constructed at end of loop. I'm not sure if that feature + // is ever actually used but just to be safe... + for (auto& modulesForOneStream : stream_modules_) { + modulesForOneStream.resize(global_modules_.size(), nvtxInvalidRangeId); + } + if (not skipFirstEvent_) { - auto mid = desc.id(); - global_modules_.grow_to_at_least(mid + 1); auto const& label = desc.moduleLabel(); auto const& msg = label + " construction"; global_modules_[mid] = nvtxDomainRangeStartColor(global_domain_, msg.c_str(), labelColor(label)); @@ -831,7 +843,6 @@ void NVProfilerService::postModuleConstruction(edm::ModuleDescription const& des void NVProfilerService::preModuleDestruction(edm::ModuleDescription const& desc) { if (not skipFirstEvent_) { auto mid = desc.id(); - global_modules_.grow_to_at_least(mid + 1); auto const& label = desc.moduleLabel(); auto const& msg = label + " destruction"; global_modules_[mid] = nvtxDomainRangeStartColor(global_domain_, msg.c_str(), labelColor(label)); @@ -1118,9 +1129,10 @@ void NVProfilerService::postModuleGlobalEndLumi(edm::GlobalContext const& gc, ed void NVProfilerService::preSourceConstruction(edm::ModuleDescription const& desc) { callgraph_.preSourceConstruction(desc); + auto mid = desc.id(); + global_modules_.grow_to_at_least(mid + 1); + if (not skipFirstEvent_) { - auto mid = desc.id(); - global_modules_.grow_to_at_least(mid + 1); auto const& label = desc.moduleLabel(); auto const& msg = label + " construction"; global_modules_[mid] = nvtxDomainRangeStartColor(global_domain_, msg.c_str(), labelColor(label)); diff --git a/HeterogeneousCore/SonicTriton/interface/TritonService.h b/HeterogeneousCore/SonicTriton/interface/TritonService.h index 470c6ad76b436..8f36f73566e06 100644 --- a/HeterogeneousCore/SonicTriton/interface/TritonService.h +++ b/HeterogeneousCore/SonicTriton/interface/TritonService.h @@ -18,7 +18,6 @@ namespace edm { class ActivityRegistry; class ConfigurationDescriptions; - class PathsAndConsumesOfModulesBase; class ProcessContext; class ModuleDescription; namespace service { @@ -123,7 +122,7 @@ class TritonService { void preModuleConstruction(edm::ModuleDescription const&); void postModuleConstruction(edm::ModuleDescription const&); void preModuleDestruction(edm::ModuleDescription const&); - void preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&); + void preBeginJob(edm::ProcessContext const&); void postEndJob(); //helper diff --git a/HeterogeneousCore/SonicTriton/src/TritonService.cc b/HeterogeneousCore/SonicTriton/src/TritonService.cc index ca5aa9c7c65e7..5bae6dba9787b 100644 --- a/HeterogeneousCore/SonicTriton/src/TritonService.cc +++ b/HeterogeneousCore/SonicTriton/src/TritonService.cc @@ -243,7 +243,7 @@ TritonService::Server TritonService::serverInfo(const std::string& model, const return server; } -void TritonService::preBeginJob(edm::PathsAndConsumesOfModulesBase const&, edm::ProcessContext const&) { +void TritonService::preBeginJob(edm::ProcessContext const&) { //only need fallback if there are unserved models if (!fallbackOpts_.enable or unservedModels_.empty()) return; diff --git a/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.cc b/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.cc index 964a4b5e2f11e..37b374a225b13 100644 --- a/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.cc +++ b/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.cc @@ -428,9 +428,7 @@ namespace edm { } } - void RandomNumberGeneratorService::preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&) { - beginJobEndJobActive_ = true; - } + void RandomNumberGeneratorService::preBeginJob(ProcessContext const&) { beginJobEndJobActive_ = true; } void RandomNumberGeneratorService::postBeginJob() { beginJobEndJobActive_ = false; } diff --git a/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.h b/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.h index 89ee4ea1167ba..4aceaa2f6f5a2 100644 --- a/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.h +++ b/IOMC/RandomEngine/plugins/RandomNumberGeneratorService.h @@ -93,7 +93,7 @@ namespace edm { void setLumiCache(LuminosityBlockIndex, std::vector const& iStates) override; void setEventCache(StreamID, std::vector const& iStates) override; - void preBeginJob(PathsAndConsumesOfModulesBase const&, ProcessContext const&); + void preBeginJob(ProcessContext const&); void postBeginJob(); void preEndJob(); void postEndJob(); diff --git a/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc b/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc index 227f1b1d22f7d..184129222d017 100644 --- a/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc +++ b/PerfTools/AllocMonitor/plugins/ModuleEventAllocMonitor.cc @@ -270,7 +270,7 @@ class ModuleEventAllocMonitor { }); } iAR.watchPreallocate([this](auto const& alloc) { nStreams_ = alloc.maxNumberOfStreams(); }); - iAR.watchPreBeginJob([this](auto const&, auto const&) { + iAR.watchPreBeginJob([this](auto const&) { streamModuleAllocs_.resize(nStreams_ * nModules_); streamModuleInAcquire_ = std::vector>(nStreams_ * nModules_); streamModuleFinishOrder_ = std::vector(nStreams_ * nModules_); diff --git a/PerfTools/AllocMonitor/plugins/moduleAlloc_setupFile.cc b/PerfTools/AllocMonitor/plugins/moduleAlloc_setupFile.cc index cd271170ac036..5653cf050a21b 100644 --- a/PerfTools/AllocMonitor/plugins/moduleAlloc_setupFile.cc +++ b/PerfTools/AllocMonitor/plugins/moduleAlloc_setupFile.cc @@ -486,7 +486,7 @@ namespace edm::service::moduleAlloc { sourceCtrPtr, beginTime, beginModuleAlloc, - addDataInDtr](auto&, auto&) mutable { + addDataInDtr](auto&) mutable { *addDataInDtr = true; { std::ostringstream oss;