CMS 3D CMS Logo

SubProcess.cc
Go to the documentation of this file.
2 
41 
42 #include "boost/range/adaptor/reversed.hpp"
43 
44 #include <cassert>
45 #include <exception>
46 #include <string>
47 
48 namespace edm {
49 
51  ParameterSet const& topLevelParameterSet,
52  std::shared_ptr<ProductRegistry const> parentProductRegistry,
53  std::shared_ptr<BranchIDListHelper const> parentBranchIDListHelper,
54  ProcessBlockHelperBase const& parentProcessBlockHelper,
55  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
56  SubProcessParentageHelper const& parentSubProcessParentageHelper,
58  ActivityRegistry& parentActReg,
59  ServiceToken const& token,
61  PreallocationConfiguration const& preallocConfig,
62  ProcessContext const* parentProcessContext)
63  : EDConsumerBase(),
64  serviceToken_(),
65  parentPreg_(parentProductRegistry),
66  preg_(),
67  branchIDListHelper_(),
68  act_table_(),
69  processConfiguration_(),
70  historyLumiOffset_(preallocConfig.numberOfStreams()),
71  historyRunOffset_(historyLumiOffset_ + preallocConfig.numberOfLuminosityBlocks()),
72  processHistoryRegistries_(historyRunOffset_ + preallocConfig.numberOfRuns()),
73  historyAppenders_(historyRunOffset_ + preallocConfig.numberOfRuns()),
74  principalCache_(),
75  esp_(),
76  schedule_(),
77  parentToChildPhID_(),
78  subProcesses_(),
79  processParameterSet_(),
80  productSelectorRules_(parameterSet, "outputCommands", "OutputModule"),
81  productSelector_(),
82  wantAllEvents_(true) {
83  //Setup the event selection
85 
86  ParameterSet selectevents = parameterSet.getUntrackedParameterSet("SelectEvents", ParameterSet());
87 
88  selectevents.registerIt(); // Just in case this PSet is not registered
90  selectevents, tns->getProcessName(), getAllTriggerNames(), selectors_, consumesCollector());
91  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
93  selectevents, "", outputModulePathPositions, parentProductRegistry->anyProductProduced());
94 
95  std::map<BranchID, bool> keepAssociation;
96  selectProducts(*parentProductRegistry, parentThinnedAssociationsHelper, keepAssociation);
97 
98  std::string const maxEvents("maxEvents");
99  std::string const maxLumis("maxLuminosityBlocks");
100 
101  // propagate_const<T> has no reset() function
103  std::unique_ptr<ParameterSet>(parameterSet.popParameterSet(std::string("process")).release());
104 
105  // if this process has a maxEvents or maxLuminosityBlocks parameter set, remove them.
106  if (processParameterSet_->exists(maxEvents)) {
107  processParameterSet_->popParameterSet(maxEvents);
108  }
109  if (processParameterSet_->exists(maxLumis)) {
110  processParameterSet_->popParameterSet(maxLumis);
111  }
112 
113  // if the top level process has a maxEvents or maxLuminosityBlocks parameter set, add them to this process.
114  if (topLevelParameterSet.exists(maxEvents)) {
115  processParameterSet_->addUntrackedParameter<ParameterSet>(
116  maxEvents, topLevelParameterSet.getUntrackedParameterSet(maxEvents));
117  }
118  if (topLevelParameterSet.exists(maxLumis)) {
119  processParameterSet_->addUntrackedParameter<ParameterSet>(
120  maxLumis, topLevelParameterSet.getUntrackedParameterSet(maxLumis));
121  }
122 
123  // If there are subprocesses, pop the subprocess parameter sets out of the process parameter set
124  auto subProcessVParameterSet = popSubProcessVParameterSet(*processParameterSet_);
125  bool hasSubProcesses = subProcessVParameterSet.size() != 0ull;
126 
127  // Validates the parameters in the 'options', 'maxEvents', and 'maxLuminosityBlocks'
128  // top level parameter sets. Default values are also set in here if the
129  // parameters were not explicitly set.
131 
132  processBlockHelper_ = std::make_shared<SubProcessBlockHelper>();
133 
134  ScheduleItems items(*parentProductRegistry, *this, *processBlockHelper_, parentProcessBlockHelper);
135  actReg_ = items.actReg_;
136 
137  //initialize the services
138  ServiceToken iToken;
139 
140  // get any configured services.
141  auto serviceSets = processParameterSet_->popVParameterSet(std::string("services"));
142 
143  ServiceToken newToken = items.initServices(serviceSets, *processParameterSet_, token, iLegacy, false);
144  parentActReg.connectToSubProcess(*items.actReg_);
145  serviceToken_ = items.addCPRandTNS(*processParameterSet_, newToken);
146 
147  //make the services available
149 
150  // intialize miscellaneous items
151  items.initMisc(*processParameterSet_);
152 
153  // intialize the event setup provider
154  esp_ = esController.makeProvider(*processParameterSet_, actReg_.get());
155 
156  branchIDListHelper_ = items.branchIDListHelper();
157  updateBranchIDListHelper(parentBranchIDListHelper->branchIDLists());
158 
159  thinnedAssociationsHelper_ = items.thinnedAssociationsHelper();
160  thinnedAssociationsHelper_->updateFromParentProcess(
161  parentThinnedAssociationsHelper, keepAssociation, droppedBranchIDToKeptBranchID_);
162 
163  // intialize the Schedule
164  schedule_ = items.initSchedule(
165  *processParameterSet_, hasSubProcesses, preallocConfig, &processContext_, *processBlockHelper_);
166 
167  // set the items
168  act_table_ = std::move(items.act_table_);
169  preg_ = items.preg();
170 
171  subProcessParentageHelper_ = items.subProcessParentageHelper();
172  subProcessParentageHelper_->update(parentSubProcessParentageHelper, *parentProductRegistry);
173 
174  //CMS-THREADING this only works since Run/Lumis are synchronous so when principalCache asks for
175  // the reducedProcessHistoryID from a full ProcessHistoryID that registry will not be in use by
176  // another thread. We really need to change how this is done in the PrincipalCache.
178 
179  processConfiguration_ = items.processConfiguration();
181  processContext_.setParentProcessContext(parentProcessContext);
182 
184  for (unsigned int index = 0; index < preallocConfig.numberOfStreams(); ++index) {
185  auto ep = std::make_shared<EventPrincipal>(preg_,
190  index,
191  false /*not primary process*/,
194  }
195  for (unsigned int index = 0; index < preallocConfig.numberOfLuminosityBlocks(); ++index) {
196  auto lbpp = std::make_unique<LuminosityBlockPrincipal>(
199  }
200 
201  {
202  auto pb = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
204 
205  auto pbForInput = std::make_unique<ProcessBlockPrincipal>(preg_, *processConfiguration_, false);
207  }
208 
209  inUseLumiPrincipals_.resize(preallocConfig.numberOfLuminosityBlocks());
210 
211  subProcesses_.reserve(subProcessVParameterSet.size());
212  for (auto& subProcessPSet : subProcessVParameterSet) {
213  subProcesses_.emplace_back(subProcessPSet,
214  topLevelParameterSet,
215  preg_,
220  esController,
221  *items.actReg_,
222  newToken,
223  iLegacy,
224  preallocConfig,
225  &processContext_);
226  }
227  }
228 
230 
231  std::vector<ModuleProcessName> SubProcess::keepOnlyConsumedUnscheduledModules(bool deleteModules) {
232  schedule_->convertCurrentProcessAlias(processConfiguration_->processName());
234 
235  // Note: all these may throw
237 
238  // Consumes information from the child SubProcesses
239  std::vector<ModuleProcessName> consumedByChildren;
240  for_all(subProcesses_, [&consumedByChildren, deleteModules](auto& subProcess) {
241  auto c = subProcess.keepOnlyConsumedUnscheduledModules(deleteModules);
242  if (consumedByChildren.empty()) {
243  std::swap(consumedByChildren, c);
244  } else if (not c.empty()) {
245  std::vector<ModuleProcessName> tmp;
246  tmp.reserve(consumedByChildren.size() + c.size());
247  std::merge(consumedByChildren.begin(), consumedByChildren.end(), c.begin(), c.end(), std::back_inserter(tmp));
248  std::swap(consumedByChildren, tmp);
249  }
250  });
251 
252  // Non-consumed unscheduled modules in this SubProcess, take into account of the consumes from child SubProcesses
253  if (deleteModules) {
254  if (auto const unusedModules = nonConsumedUnscheduledModules(pathsAndConsumesOfModules_, consumedByChildren);
255  not unusedModules.empty()) {
257 
258  edm::LogInfo("DeleteModules").log([&unusedModules, this](auto& l) {
259  l << "Following modules are not in any Path or EndPath, nor is their output consumed by any other module, "
260  "and "
261  "therefore they are deleted from SubProcess "
262  << processConfiguration_->processName() << " before beginJob transition.";
263  for (auto const& description : unusedModules) {
264  l << "\n " << description->moduleLabel();
265  }
266  });
267  for (auto const& description : unusedModules) {
268  schedule_->deleteModule(description->moduleLabel(), actReg_.get());
269  }
270  }
271  }
272 
273  // Products possibly consumed from the parent (Sub)Process
274  for (auto const& description : pathsAndConsumesOfModules_.allModules()) {
275  for (auto const& dep :
277  auto it = std::lower_bound(consumedByChildren.begin(),
278  consumedByChildren.end(),
279  ModuleProcessName{dep.moduleLabel(), dep.processName()});
280  consumedByChildren.emplace(it, dep.moduleLabel(), dep.processName());
281  }
282  }
283  return consumedByChildren;
284  }
285 
286  void SubProcess::doBeginJob() { this->beginJob(); }
287 
289 
291  // If event selection is being used, the SubProcess class reads TriggerResults
292  // object(s) in the parent process from the event. This next call is needed for
293  // getByToken to work properly. Normally, this is done by the worker, but since
294  // a SubProcess is not a module, it has no worker.
295  updateLookup(InEvent, *parentPreg_->productLookup(InEvent), false);
296 
297  if (!droppedBranchIDToKeptBranchID().empty()) {
299  }
301  actReg_->preBeginJobSignal_(pathsAndConsumesOfModules_, processContext_);
302  schedule_->beginJob(*preg_, esp_->recordsToProxyIndices(), *processBlockHelper_);
303  for_all(subProcesses_, [](auto& subProcess) { subProcess.doBeginJob(); });
304  }
305 
309  "Multiple exceptions were thrown while executing endJob. An exception message follows for each.");
310  schedule_->endJob(c);
311  for (auto& subProcess : subProcesses_) {
312  c.call([&subProcess]() { subProcess.doEndJob(); });
313  }
314  if (c.hasThrown()) {
315  c.rethrow();
316  }
317  }
318 
320  ThinnedAssociationsHelper const& parentThinnedAssociationsHelper,
321  std::map<BranchID, bool>& keepAssociation) {
323  return;
325 
326  // TODO: See if we can collapse keptProducts_ and productSelector_ into a
327  // single object. See the notes in the header for ProductSelector
328  // for more information.
329 
330  std::map<BranchID, BranchDescription const*> trueBranchIDToKeptBranchDesc;
331  std::vector<BranchDescription const*> associationDescriptions;
332  std::set<BranchID> keptProductsInEvent;
333 
334  for (auto const& it : preg.productList()) {
335  BranchDescription const& desc = it.second;
336  if (desc.transient()) {
337  // if the class of the branch is marked transient, output nothing
338  } else if (!desc.present() && !desc.produced()) {
339  // else if the branch containing the product has been previously dropped,
340  // output nothing
341  } else if (desc.unwrappedType() == typeid(ThinnedAssociation)) {
342  associationDescriptions.push_back(&desc);
343  } else if (productSelector_.selected(desc)) {
344  keepThisBranch(desc, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
345  }
346  }
347 
348  parentThinnedAssociationsHelper.selectAssociationProducts(
349  associationDescriptions, keptProductsInEvent, keepAssociation);
350 
351  for (auto association : associationDescriptions) {
352  if (keepAssociation[association->branchID()]) {
353  keepThisBranch(*association, trueBranchIDToKeptBranchDesc, keptProductsInEvent);
354  }
355  }
356 
357  // Now fill in a mapping needed in the case that a branch was dropped while its EDAlias was kept.
358  ProductSelector::fillDroppedToKept(preg, trueBranchIDToKeptBranchDesc, droppedBranchIDToKeptBranchID_);
359  }
360 
362  std::map<BranchID, BranchDescription const*>& trueBranchIDToKeptBranchDesc,
363  std::set<BranchID>& keptProductsInEvent) {
364  ProductSelector::checkForDuplicateKeptBranch(desc, trueBranchIDToKeptBranchDesc);
365 
366  if (desc.branchType() == InEvent) {
367  if (desc.produced()) {
368  keptProductsInEvent.insert(desc.originalBranchID());
369  } else {
370  keptProductsInEvent.insert(desc.branchID());
371  }
372  }
373  EDGetToken token = consumes(TypeToGet{desc.unwrappedTypeID(), PRODUCT_TYPE},
374  InputTag{desc.moduleLabel(), desc.productInstanceName(), desc.processName()});
375 
376  // Now put it in the list of selected branches.
377  keptProducts_[desc.branchType()].push_back(std::make_pair(&desc, token));
378  }
379 
381  std::map<BranchID::value_type, BranchID::value_type> const& droppedBranchIDToKeptBranchID) {
382  // Check for branches dropped while an EDAlias was kept.
383  // Replace BranchID of each dropped branch with that of the kept alias.
384  for (BranchIDList& branchIDList : branchIDListHelper_->mutableBranchIDLists()) {
385  for (BranchID::value_type& branchID : branchIDList) {
386  std::map<BranchID::value_type, BranchID::value_type>::const_iterator iter =
387  droppedBranchIDToKeptBranchID.find(branchID);
388  if (iter != droppedBranchIDToKeptBranchID.end()) {
389  branchID = iter->second;
390  }
391  }
392  }
393  for_all(subProcesses_, [&droppedBranchIDToKeptBranchID](auto& subProcess) {
394  subProcess.fixBranchIDListsForEDAliases(droppedBranchIDToKeptBranchID);
395  });
396  }
397 
399  EventPrincipal const& ep,
400  std::vector<std::shared_ptr<const EventSetupImpl>> const* iEventSetupImpls) {
402  /* BEGIN relevant bits from OutputModule::doEvent */
403  if (!wantAllEvents_) {
404  EventForOutput e(ep, ModuleDescription(), nullptr);
405  e.setConsumer(this);
406  if (!selectors_.wantEvent(e)) {
407  return;
408  }
409  }
410  processAsync(std::move(iHolder), ep, iEventSetupImpls);
411  /* END relevant bits from OutputModule::doEvent */
412  }
413 
415  EventPrincipal const& principal,
416  std::vector<std::shared_ptr<const EventSetupImpl>> const* iEventSetupImpls) {
417  EventAuxiliary aux(principal.aux());
418  aux.setProcessHistoryID(principal.processHistoryID());
419 
420  EventSelectionIDVector esids{principal.eventSelectionIDs()};
421  if (principal.productRegistry().anyProductProduced() || !wantAllEvents_) {
422  esids.push_back(selector_config_id_);
423  }
424 
426  auto& processHistoryRegistry = processHistoryRegistries_[principal.streamID().value()];
427  processHistoryRegistry.registerProcessHistory(principal.processHistory());
428  BranchListIndexes bli(principal.branchListIndexes());
429  branchIDListHelper_->fixBranchListIndexes(bli);
430  bool deepCopyRetriever = false;
431  ep.fillEventPrincipal(
432  aux,
433  &principal.processHistory(),
434  std::move(esids),
435  std::move(bli),
436  principal.eventToProcessBlockIndexes(),
437  *(principal.productProvenanceRetrieverPtr()), //NOTE: this transfers the per product provenance
438  principal.reader(),
439  deepCopyRetriever);
440  ep.setLuminosityBlockPrincipal(inUseLumiPrincipals_[principal.luminosityBlockPrincipal().index()].get());
441  propagateProducts(InEvent, principal, ep);
442 
443  WaitingTaskHolder finalizeEventTask(*iHolder.group(),
444  make_waiting_task([&ep, iHolder](std::exception_ptr const* iPtr) mutable {
445  ep.clearEventPrincipal();
446  if (iPtr) {
447  iHolder.doneWaiting(*iPtr);
448  } else {
449  iHolder.doneWaiting(std::exception_ptr());
450  }
451  }));
452  WaitingTaskHolder afterProcessTask;
453  if (subProcesses_.empty()) {
454  afterProcessTask = std::move(finalizeEventTask);
455  } else {
456  afterProcessTask = WaitingTaskHolder(
457  *iHolder.group(),
458  make_waiting_task([this, &ep, finalizeEventTask, iEventSetupImpls](std::exception_ptr const* iPtr) mutable {
459  if (not iPtr) {
460  for (auto& subProcess : boost::adaptors::reverse(subProcesses_)) {
461  subProcess.doEventAsync(finalizeEventTask, ep, iEventSetupImpls);
462  }
463  } else {
464  finalizeEventTask.doneWaiting(*iPtr);
465  }
466  }));
467  }
468  EventTransitionInfo info(ep, *((*iEventSetupImpls)[esp_->subProcessIndex()]));
469  schedule_->processOneEventAsync(std::move(afterProcessTask), ep.streamID().value(), info, serviceToken_);
470  }
471 
472  template <>
473  void SubProcess::doBeginProcessBlockAsync<OccurrenceTraits<ProcessBlockPrincipal, BranchActionProcessBlockInput>>(
474  WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const& iTransitionInfo, bool cleaningUpAfterException) {
475  ServiceRegistry::Operate operate(serviceToken_);
476 
477  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
478  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
479  processBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
480  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
481 
482  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
484  beginGlobalTransitionAsync<Traits>(
485  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
486  }
487 
488  template <>
489  void SubProcess::doBeginProcessBlockAsync<OccurrenceTraits<ProcessBlockPrincipal, BranchActionGlobalBegin>>(
490  WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const& iTransitionInfo, bool) {
491  ServiceRegistry::Operate operate(serviceToken_);
492 
493  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal();
494  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
495  processBlockPrincipal.fillProcessBlockPrincipal(processConfiguration_->processName());
496  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
497 
498  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
500  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
501  }
502 
504  ProcessBlockTransitionInfo const& iTransitionInfo,
505  bool cleaningUpAfterException) {
507  ProcessBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
508  propagateProducts(InProcess, parentPrincipal, processBlockPrincipal);
509 
510  ProcessBlockTransitionInfo transitionInfo(processBlockPrincipal);
511 
512  if (parentProducedProductIsKept(parentPrincipal, processBlockPrincipal)) {
513  auto& taskGroup = *iHolder.group();
514  auto runEndProcessBlock =
515  make_waiting_task([this, iWait = std::move(iHolder), info = transitionInfo, cleaningUpAfterException](
516  std::exception_ptr const* iPtr) mutable {
517  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
518  inputProcessBlockPrincipal.clearPrincipal();
519  for (auto& s : subProcesses_) {
520  s.clearProcessBlockPrincipal(ProcessBlockType::Input);
521  }
522  if (iPtr) {
523  iWait.doneWaiting(*iPtr);
524  } else {
526  endGlobalTransitionAsync<Traits>(
527  std::move(iWait), *schedule_, info, serviceToken_, subProcesses_, cleaningUpAfterException);
528  }
529  });
530  WaitingTaskHolder holder(taskGroup, runEndProcessBlock);
531 
532  auto runWriteProcessBlock =
533  make_waiting_task([this, iWait = std::move(holder)](std::exception_ptr const* iPtr) mutable {
534  if (iPtr) {
535  iWait.doneWaiting(*iPtr);
536  } else {
538  }
539  });
540  WaitingTaskHolder writeHolder(taskGroup, runWriteProcessBlock);
541 
542  ProcessBlockPrincipal& inputProcessBlockPrincipal = principalCache_.inputProcessBlockPrincipal();
543  inputProcessBlockPrincipal.fillProcessBlockPrincipal(parentPrincipal.processName(), parentPrincipal.reader());
544  propagateProducts(InProcess, parentPrincipal, inputProcessBlockPrincipal);
545  ProcessBlockTransitionInfo inputTransitionInfo(inputProcessBlockPrincipal);
546 
548  beginGlobalTransitionAsync<TraitsInput>(std::move(writeHolder),
549  *schedule_,
550  inputTransitionInfo,
553  cleaningUpAfterException);
554 
555  } else {
557  endGlobalTransitionAsync<Traits>(
558  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
559  }
560  }
561 
562  void SubProcess::doBeginRunAsync(WaitingTaskHolder iHolder, RunTransitionInfo const& iTransitionInfo) {
564 
565  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
566  auto aux = std::make_shared<RunAuxiliary>(parentPrincipal.aux());
567  aux->setProcessHistoryID(parentPrincipal.processHistoryID());
568  auto rpp = std::make_shared<RunPrincipal>(aux,
569  preg_,
571  &(historyAppenders_[historyRunOffset_ + parentPrincipal.index()]),
572  parentPrincipal.index(),
573  false);
574  auto& processHistoryRegistry = processHistoryRegistries_[historyRunOffset_ + parentPrincipal.index()];
575  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
576  rpp->fillRunPrincipal(processHistoryRegistry, parentPrincipal.reader());
577  principalCache_.insert(rpp);
578 
579  ProcessHistoryID const& parentInputReducedPHID = parentPrincipal.reducedProcessHistoryID();
580  ProcessHistoryID const& inputReducedPHID = rpp->reducedProcessHistoryID();
581 
582  parentToChildPhID_.insert(std::make_pair(parentInputReducedPHID, inputReducedPHID));
583 
585  propagateProducts(InRun, parentPrincipal, rp);
586 
587  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
589  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
590  }
591 
593  RunTransitionInfo const& iTransitionInfo,
594  bool cleaningUpAfterException) {
595  RunPrincipal const& parentPrincipal = iTransitionInfo.principal();
597  propagateProducts(InRun, parentPrincipal, rp);
598 
599  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
601  endGlobalTransitionAsync<Traits>(
602  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
603  }
604 
607 
608  auto subTasks = edm::make_waiting_task([this, task, processBlockType](std::exception_ptr const* iExcept) mutable {
609  if (iExcept) {
610  task.doneWaiting(*iExcept);
611  } else {
613  for (auto& s : subProcesses_) {
614  s.writeProcessBlockAsync(task, processBlockType);
615  }
616  }
617  });
618  schedule_->writeProcessBlockAsync(WaitingTaskHolder(*task.group(), subTasks),
619  principalCache_.processBlockPrincipal(processBlockType),
621  actReg_.get());
622  }
623 
625  ProcessHistoryID const& parentPhID,
626  int runNumber,
627  MergeableRunProductMetadata const* mergeableRunProductMetadata) {
629  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
630  assert(it != parentToChildPhID_.end());
631  auto const& childPhID = it->second;
632 
633  auto subTasks = edm::make_waiting_task(
634  [this, childPhID, runNumber, task, mergeableRunProductMetadata](std::exception_ptr const* iExcept) mutable {
635  if (iExcept) {
636  task.doneWaiting(*iExcept);
637  } else {
638  ServiceRegistry::Operate operateWriteRun(serviceToken_);
639  for (auto& s : subProcesses_) {
640  s.writeRunAsync(task, childPhID, runNumber, mergeableRunProductMetadata);
641  }
642  }
643  });
644  schedule_->writeRunAsync(WaitingTaskHolder(*task.group(), subTasks),
647  actReg_.get(),
648  mergeableRunProductMetadata);
649  }
650 
652  std::map<ProcessHistoryID, ProcessHistoryID>::const_iterator it = parentToChildPhID_.find(parentPhID);
653  assert(it != parentToChildPhID_.end());
654  auto const& childPhID = it->second;
655  principalCache_.deleteRun(childPhID, runNumber);
657  [&childPhID, runNumber](auto& subProcess) { subProcess.deleteRunFromCache(childPhID, runNumber); });
658  }
659 
661  ProcessBlockPrincipal& processBlockPrincipal = principalCache_.processBlockPrincipal(processBlockType);
662  processBlockPrincipal.clearPrincipal();
663  for (auto& s : subProcesses_) {
664  s.clearProcessBlockPrincipal(processBlockType);
665  }
666  }
667 
670 
671  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
672  auto aux = parentPrincipal.aux();
673  aux.setProcessHistoryID(parentPrincipal.processHistoryID());
675  lbpp->setAux(aux);
676  auto& processHistoryRegistry = processHistoryRegistries_[historyLumiOffset_ + lbpp->index()];
677  inUseLumiPrincipals_[parentPrincipal.index()] = lbpp;
678  processHistoryRegistry.registerProcessHistory(parentPrincipal.processHistory());
679  lbpp->fillLuminosityBlockPrincipal(&parentPrincipal.processHistory(), parentPrincipal.reader());
680  lbpp->setRunPrincipal(principalCache_.runPrincipalPtr());
681  LuminosityBlockPrincipal& lbp = *lbpp;
682  propagateProducts(InLumi, parentPrincipal, lbp);
683 
684  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
685  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
687  beginGlobalTransitionAsync<Traits>(std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_);
688  }
689 
691  LumiTransitionInfo const& iTransitionInfo,
692  bool cleaningUpAfterException) {
693  LuminosityBlockPrincipal const& parentPrincipal = iTransitionInfo.principal();
694  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[parentPrincipal.index()];
695  propagateProducts(InLumi, parentPrincipal, lbp);
696 
697  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
698  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
700  endGlobalTransitionAsync<Traits>(
701  std::move(iHolder), *schedule_, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
702  }
703 
706 
707  auto l = inUseLumiPrincipals_[principal.index()];
708  auto subTasks = edm::make_waiting_task([this, l, task](std::exception_ptr const* iExcept) mutable {
709  if (iExcept) {
710  task.doneWaiting(*iExcept);
711  } else {
712  ServiceRegistry::Operate operateWriteLumi(serviceToken_);
713  for (auto& s : subProcesses_) {
714  s.writeLumiAsync(task, *l);
715  }
716  }
717  });
718  schedule_->writeLumiAsync(WaitingTaskHolder(*task.group(), subTasks), *l, &processContext_, actReg_.get());
719  }
720 
722  //release from list but stay around till end of routine
723  auto lb = std::move(inUseLumiPrincipals_[principal.index()]);
724  for (auto& s : subProcesses_) {
725  s.deleteLumiFromCache(*lb);
726  }
727  lb->clearPrincipal();
728  }
729 
730  void SubProcess::doBeginStream(unsigned int iID) {
732  schedule_->beginStream(iID);
733  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doBeginStream(iID); });
734  }
735 
736  void SubProcess::doEndStream(unsigned int iID) {
738  schedule_->endStream(iID);
739  for_all(subProcesses_, [iID](auto& subProcess) { subProcess.doEndStream(iID); });
740  }
741 
744 
746 
747  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
748  beginStreamTransitionAsync<Traits>(
749  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
750  }
751 
753  unsigned int id,
754  RunTransitionInfo const&,
755  bool cleaningUpAfterException) {
758 
759  RunTransitionInfo transitionInfo(rp, esp_->eventSetupImpl());
760  endStreamTransitionAsync<Traits>(
761  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
762  }
763 
765  unsigned int id,
766  LumiTransitionInfo const& iTransitionInfo) {
768 
769  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
770  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
771  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
772  beginStreamTransitionAsync<Traits>(
773  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_);
774  }
775 
777  unsigned int id,
778  LumiTransitionInfo const& iTransitionInfo,
779  bool cleaningUpAfterException) {
780  LuminosityBlockPrincipal& lbp = *inUseLumiPrincipals_[iTransitionInfo.principal().index()];
782  std::vector<std::shared_ptr<const EventSetupImpl>> const* eventSetupImpls = iTransitionInfo.eventSetupImpls();
783  LumiTransitionInfo transitionInfo(lbp, *((*eventSetupImpls)[esp_->subProcessIndex()]), eventSetupImpls);
784  endStreamTransitionAsync<Traits>(
785  std::move(iHolder), *schedule_, id, transitionInfo, serviceToken_, subProcesses_, cleaningUpAfterException);
786  }
787 
788  void SubProcess::propagateProducts(BranchType type, Principal const& parentPrincipal, Principal& principal) const {
789  SelectedProducts const& keptVector = keptProducts()[type];
790  for (auto const& item : keptVector) {
791  BranchDescription const& desc = *item.first;
792  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
793  if (parentProductResolver != nullptr) {
794  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
795  if (productResolver != nullptr) {
796  //Propagate the per event(run)(lumi)(processBlock) data for this product to the subprocess.
797  productResolver->connectTo(*parentProductResolver, &parentPrincipal);
798  }
799  }
800  }
801  }
802 
803  bool SubProcess::parentProducedProductIsKept(Principal const& parentPrincipal, Principal& principal) const {
804  SelectedProducts const& keptVector = keptProducts()[InProcess];
805  for (auto const& item : keptVector) {
806  BranchDescription const& desc = *item.first;
807  assert(desc.branchType() == InProcess);
808  ProductResolverBase const* parentProductResolver = parentPrincipal.getProductResolver(desc.branchID());
809  if (parentProductResolver != nullptr) {
810  ProductResolverBase* productResolver = principal.getModifiableProductResolver(desc.branchID());
811  if (productResolver != nullptr) {
812  if (parentProductResolver->branchDescription().produced()) {
813  return true;
814  }
815  }
816  }
817  }
818  return false;
819  }
820 
822  branchIDListHelper_->updateFromParent(branchIDLists);
824  [this](auto& subProcess) { subProcess.updateBranchIDListHelper(branchIDListHelper_->branchIDLists()); });
825  }
826 
827  // Call respondToOpenInputFile() on all Modules
830  schedule_->respondToOpenInputFile(fb);
831  for_all(subProcesses_, [&fb](auto& subProcess) { subProcess.respondToOpenInputFile(fb); });
832  }
833 
834  // free function
836  std::vector<std::string> subProcesses =
837  parameterSet.getUntrackedParameter<std::vector<std::string>>("@all_subprocesses");
838  if (!subProcesses.empty()) {
839  return parameterSet.popVParameterSet("subProcesses");
840  }
841  return {};
842  }
843 } // namespace edm
edm::SubProcess::beginJob
void beginJob()
Definition: SubProcess.cc:290
edm::ParameterSet::registerIt
ParameterSet const & registerIt()
Definition: ParameterSet.cc:113
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SubProcess::respondToOpenInputFile
void respondToOpenInputFile(FileBlock const &fb)
Definition: SubProcess.cc:828
ThinnedAssociationsHelper.h
IllegalParameters.h
edm::ProcessBlockTransitionInfo::principal
ProcessBlockPrincipal & principal()
Definition: TransitionInfoTypes.h:86
edm::SubProcess::processConfiguration_
std::shared_ptr< ProcessConfiguration const > processConfiguration_
Definition: SubProcess.h:293
ProcessHistoryID.h
edm::EventPrincipal::aux
EventAuxiliary const & aux() const
Definition: EventPrincipal.h:108
ProductResolverBase.h
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalEnd >
Definition: OccurrenceTraits.h:356
electrons_cff.bool
bool
Definition: electrons_cff.py:366
edm::SubProcess::historyRunOffset_
unsigned int historyRunOffset_
Definition: SubProcess.h:299
edm::SubProcess::historyLumiOffset_
unsigned int historyLumiOffset_
Definition: SubProcess.h:298
edm::SubProcess::selector_config_id_
ParameterSetID selector_config_id_
Definition: SubProcess.h:321
edm::SubProcessParentageHelper
Definition: SubProcessParentageHelper.h:21
edm::EventPrincipal::luminosityBlockPrincipal
LuminosityBlockPrincipal const & luminosityBlockPrincipal() const
Definition: EventPrincipal.h:85
edm::popSubProcessVParameterSet
std::vector< ParameterSet > popSubProcessVParameterSet(ParameterSet &parameterSet)
Definition: SubProcess.cc:835
edm::getAllTriggerNames
std::vector< std::string > const & getAllTriggerNames()
Definition: getAllTriggerNames.cc:22
edm::OccurrenceTraits< ProcessBlockPrincipal, BranchActionGlobalBegin >
Definition: OccurrenceTraits.h:397
edm::SubProcess::parentProducedProductIsKept
bool parentProducedProductIsKept(Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:803
edm::ProcessBlockTransitionInfo
Definition: TransitionInfoTypes.h:80
edm::SubProcess::processHistoryRegistries_
std::vector< ProcessHistoryRegistry > processHistoryRegistries_
Definition: SubProcess.h:300
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::SubProcess::clearProcessBlockPrincipal
void clearProcessBlockPrincipal(ProcessBlockType)
Definition: SubProcess.cc:660
edm::PathsAndConsumesOfModules::modulesInPreviousProcessesWhoseProductsAreConsumedBy
std::vector< ModuleProcessName > const & modulesInPreviousProcessesWhoseProductsAreConsumedBy(unsigned int moduleID) const
Definition: PathsAndConsumesOfModules.cc:90
SubProcessBlockHelper.h
edm::SubProcess::branchIDListHelper
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: SubProcess.h:273
edm::ParameterSet::getUntrackedParameterSet
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
Definition: ParameterSet.cc:2136
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::SubProcess::keptProducts
SelectedProductsForBranchType const & keptProducts() const
Definition: SubProcess.h:80
edm::validateTopLevelParameterSets
void validateTopLevelParameterSets(ParameterSet *processParameterSet)
Definition: validateTopLevelParameterSets.cc:115
BranchIDListHelper.h
TriggerNamesService.h
WaitingTaskHolder.h
edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalBegin >
Definition: OccurrenceTraits.h:71
edm::SubProcess::pathsAndConsumesOfModules_
PathsAndConsumesOfModules pathsAndConsumesOfModules_
Definition: SubProcess.h:295
edm::SubProcess::doStreamEndRunAsync
void doStreamEndRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &, bool cleaningUpAfterException)
Definition: SubProcess.cc:752
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ProcessContext
Definition: ProcessContext.h:27
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
edm::PrincipalCache::setProcessHistoryRegistry
void setProcessHistoryRegistry(ProcessHistoryRegistry const &phr)
Definition: PrincipalCache.h:87
edm::ProductSelector::initialize
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
Definition: ProductSelector.cc:20
edm::SubProcess::updateBranchIDListHelper
void updateBranchIDListHelper(BranchIDLists const &)
Definition: SubProcess.cc:821
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::BranchListIndexes
std::vector< BranchListIndex > BranchListIndexes
Definition: BranchListIndex.h:18
edm::ThinnedAssociation
Definition: ThinnedAssociation.h:15
edm::SubProcess::thinnedAssociationsHelper_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: SubProcess.h:290
edm::ScheduleItems
Definition: ScheduleItems.h:30
edm::SubProcess::subProcesses_
std::vector< SubProcess > subProcesses_
Definition: SubProcess.h:308
cms::cuda::assert
assert(be >=bs)
edm::SubProcess::doEndStream
void doEndStream(unsigned int)
Definition: SubProcess.cc:736
edm::SubProcess::processBlockHelper_
edm::propagate_const< std::shared_ptr< SubProcessBlockHelper > > processBlockHelper_
Definition: SubProcess.h:289
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamBegin >
Definition: OccurrenceTraits.h:274
edm::Principal
Definition: Principal.h:56
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
edm::ModuleProcessName::moduleLabel
std::string_view moduleLabel() const
Definition: ModuleProcessName.h:17
edm::ProductSelector::selected
bool selected(BranchDescription const &desc) const
Definition: ProductSelector.cc:55
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
ProcessBlockPrincipal.h
SignallingProductRegistry.h
ProcessHistoryRegistry.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::StreamID::value
unsigned int value() const
Definition: StreamID.h:43
edm::ProcessBlockPrincipal::processName
std::string const & processName() const
Definition: ProcessBlockPrincipal.h:30
PreallocationConfiguration.h
ESRecordsToProxyIndices.h
ProductRegistry.h
EventSetupsController.h
EventForOutput.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Principal::processHistory
ProcessHistory const & processHistory() const
Definition: Principal.h:140
edm::SubProcess::doEndProcessBlockAsync
void doEndProcessBlockAsync(WaitingTaskHolder iHolder, ProcessBlockTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
Definition: SubProcess.cc:503
edm::WaitingTaskHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskHolder.h:93
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::RunPrincipal::aux
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59
getAllTriggerNames.h
edm::PrincipalCache::runPrincipalPtr
std::shared_ptr< RunPrincipal > const & runPrincipalPtr(ProcessHistoryID const &phid, RunNumber_t run) const
Definition: PrincipalCache.cc:28
edm::InRun
Definition: BranchType.h:11
edm::SubProcess::doBeginJob
void doBeginJob()
Definition: SubProcess.cc:286
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::OccurrenceTraits< ProcessBlockPrincipal, BranchActionGlobalEnd >
Definition: OccurrenceTraits.h:471
edm::SubProcess::processAsync
void processAsync(WaitingTaskHolder iHolder, EventPrincipal const &e, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:414
edm::PathsAndConsumesOfModules::initialize
void initialize(Schedule const *, std::shared_ptr< ProductRegistry const >)
Definition: PathsAndConsumesOfModules.cc:16
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ModuleDescription
Definition: ModuleDescription.h:21
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
edm::EventPrincipal::productProvenanceRetrieverPtr
ProductProvenanceRetriever const * productProvenanceRetrieverPtr() const
Definition: EventPrincipal.h:118
edm::SelectedProducts
std::vector< std::pair< BranchDescription const *, EDGetToken > > SelectedProducts
Definition: SelectedProducts.h:11
edm::OccurrenceTraits< RunPrincipal, BranchActionStreamBegin >
Definition: OccurrenceTraits.h:112
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
edm::LuminosityBlockPrincipal::aux
LuminosityBlockAuxiliary const & aux() const
Definition: LuminosityBlockPrincipal.h:64
edm::ProductRegistry
Definition: ProductRegistry.h:37
ActivityRegistry.h
edm::parameterSet
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
edm::EventPrincipal::branchListIndexes
BranchListIndexes const & branchListIndexes() const
Definition: EventPrincipal.cc:376
edm::FileBlock
Definition: FileBlock.h:22
edm::SubProcess::wantAllEvents_
bool wantAllEvents_
Definition: SubProcess.h:320
edm::PreallocationConfiguration::numberOfLuminosityBlocks
unsigned int numberOfLuminosityBlocks() const
Definition: PreallocationConfiguration.h:36
edm::ServiceToken
Definition: ServiceToken.h:42
edm::InProcess
Definition: BranchType.h:11
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::PrincipalCache::runPrincipal
RunPrincipal & runPrincipal(ProcessHistoryID const &phid, RunNumber_t run) const
Definition: PrincipalCache.cc:21
edm::ParameterSet::popParameterSet
std::unique_ptr< ParameterSet > popParameterSet(std::string const &name)
Definition: ParameterSet.cc:121
edm::ProcessContext::setProcessConfiguration
void setProcessConfiguration(ProcessConfiguration const *processConfiguration)
Definition: ProcessContext.cc:19
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::SubProcess::droppedBranchIDToKeptBranchID
std::map< BranchID::value_type, BranchID::value_type > const & droppedBranchIDToKeptBranchID()
Definition: SubProcess.h:269
edm::SubProcess::deleteRunFromCache
void deleteRunFromCache(ProcessHistoryID const &parentPhID, int runNumber)
Definition: SubProcess.cc:651
edm::SubProcess::schedule_
edm::propagate_const< std::unique_ptr< Schedule > > schedule_
Definition: SubProcess.h:306
edm::EventPrincipal
Definition: EventPrincipal.h:48
edm::SubProcess::inUseLumiPrincipals_
std::vector< std::shared_ptr< LuminosityBlockPrincipal > > inUseLumiPrincipals_
Definition: SubProcess.h:304
OutputModuleDescription.h
edm::OccurrenceTraits< RunPrincipal, BranchActionGlobalEnd >
Definition: OccurrenceTraits.h:192
edm::ProductSelector::initialized
bool initialized() const
Definition: ProductSelector.h:38
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::ExceptionCollector
Definition: ExceptionCollector.h:33
edm::Principal::processHistoryID
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:142
edm::BranchIDList
std::vector< BranchID::value_type > BranchIDList
Definition: BranchIDList.h:18
EventPrincipal.h
edm::SubProcess::thinnedAssociationsHelper
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
Definition: SubProcess.h:277
edm::SubProcess::selectProducts
void selectProducts(ProductRegistry const &preg, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, std::map< BranchID, bool > &keepAssociation)
Definition: SubProcess.cc:319
SubProcessParentageHelper.h
edm::ProductSelector::checkForDuplicateKeptBranch
static void checkForDuplicateKeptBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc)
Definition: ProductSelector.cc:71
edm::Principal::reader
DelayedReader * reader() const
Definition: Principal.h:187
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:253
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::ThinnedAssociationsHelper::selectAssociationProducts
void selectAssociationProducts(std::vector< BranchDescription const * > const &associationDescriptions, std::set< BranchID > const &keptProductsInEvent, std::map< BranchID, bool > &keepAssociation) const
Definition: ThinnedAssociationsHelper.cc:189
edm::MergeableRunProductMetadata
Definition: MergeableRunProductMetadata.h:52
edm::SubProcess::doEventAsync
void doEventAsync(WaitingTaskHolder iHolder, EventPrincipal const &principal, std::vector< std::shared_ptr< const EventSetupImpl >> const *)
Definition: SubProcess.cc:398
edm::checkForModuleDependencyCorrectness
void checkForModuleDependencyCorrectness(edm::PathsAndConsumesOfModulesBase const &iPnC, bool iPrintDependencies)
Definition: PathsAndConsumesOfModules.cc:269
edm::Principal::getProductResolver
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554
edm::Hash
Definition: Hash.h:43
edm::SubProcess::serviceToken_
ServiceToken serviceToken_
Definition: SubProcess.h:285
edm::ActivityRegistry::connectToSubProcess
void connectToSubProcess(ActivityRegistry &iOther)
Definition: ActivityRegistry.cc:308
edm::SubProcess::esp_
edm::propagate_const< std::shared_ptr< eventsetup::EventSetupProvider > > esp_
Definition: SubProcess.h:305
edm::InEvent
Definition: BranchType.h:11
edm::OccurrenceTraits< RunPrincipal, BranchActionStreamEnd >
Definition: OccurrenceTraits.h:152
ExceptionCollector.h
edm::ProductSelector::fillDroppedToKept
static void fillDroppedToKept(ProductRegistry const &preg, std::map< BranchID, BranchDescription const * > const &trueBranchIDToKeptBranchDesc, std::map< BranchID::value_type, BranchID::value_type > &droppedBranchIDToKeptBranchID_)
Definition: ProductSelector.cc:99
edm::SubProcess::doBeginLuminosityBlockAsync
void doBeginLuminosityBlockAsync(WaitingTaskHolder iHolder, LumiTransitionInfo const &iTransitionInfo)
Definition: SubProcess.cc:668
edm::BranchIDLists
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
edm::BranchID::value_type
unsigned int value_type
Definition: BranchID.h:16
edm::Principal::productRegistry
ProductRegistry const & productRegistry() const
Definition: Principal.h:146
edm::SubProcess::~SubProcess
~SubProcess() override
Definition: SubProcess.cc:229
edm::EventAuxiliary
Definition: EventAuxiliary.h:14
edm::SubProcess::propagateProducts
void propagateProducts(BranchType type, Principal const &parentPrincipal, Principal &principal) const
Definition: SubProcess.cc:788
streamTransitionAsync.h
edm::RunPrincipal::index
RunIndex index() const
Definition: RunPrincipal.h:57
edm::SubProcess::keptProducts_
SelectedProductsForBranchType keptProducts_
Definition: SubProcess.h:315
edm::SubProcess::doEndJob
void doEndJob()
Definition: SubProcess.cc:288
HistoryAppender.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
funct::true
true
Definition: Factorize.h:173
LuminosityBlockAuxiliary.h
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::SubProcess::deleteLumiFromCache
void deleteLumiFromCache(LuminosityBlockPrincipal &)
Definition: SubProcess.cc:721
edm::ProcessBlockHelperBase
Definition: ProcessBlockHelperBase.h:18
edm::SubProcess::productSelectorRules_
ProductSelectorRules productSelectorRules_
Definition: SubProcess.h:316
edm::ParameterSet
Definition: ParameterSet.h:47
edm::OccurrenceTraits< ProcessBlockPrincipal, BranchActionProcessBlockInput >
Definition: OccurrenceTraits.h:434
edm::ProcessContext::setParentProcessContext
void setParentProcessContext(ProcessContext const *parentProcessContext)
Definition: ProcessContext.cc:23
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(F f)
Definition: WaitingTask.h:101
edm::detail::TriggerResultsBasedEventSelector::wantEvent
bool wantEvent(EventForOutput const &e)
Definition: TriggerResultsBasedEventSelector.cc:148
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionGlobalBegin >
Definition: OccurrenceTraits.h:233
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::InLumi
Definition: BranchType.h:11
edm::Principal::getModifiableProductResolver
ProductResolverBase * getModifiableProductResolver(BranchID const &oid)
Definition: Principal.h:153
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
edm::SubProcess::processParameterSet_
edm::propagate_const< std::unique_ptr< ParameterSet > > processParameterSet_
Definition: SubProcess.h:309
edm::SubProcess::act_table_
std::unique_ptr< ExceptionToActionTable const > act_table_
Definition: SubProcess.h:292
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
RunPrincipal.h
edm::SubProcess::keepThisBranch
void keepThisBranch(BranchDescription const &desc, std::map< BranchID, BranchDescription const * > &trueBranchIDToKeptBranchDesc, std::set< BranchID > &keptProductsInEvent)
Definition: SubProcess.cc:361
edm::PrincipalCache::deleteRun
void deleteRun(ProcessHistoryID const &phid, RunNumber_t run)
Definition: PrincipalCache.cc:110
edm::SubProcess::droppedBranchIDToKeptBranchID_
std::map< BranchID::value_type, BranchID::value_type > droppedBranchIDToKeptBranchID_
Definition: SubProcess.h:326
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
edm::EDConsumerBase::updateLookup
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
Definition: EDConsumerBase.cc:112
edm::Service
Definition: Service.h:30
edm::SubProcess::writeRunAsync
void writeRunAsync(WaitingTaskHolder, ProcessHistoryID const &parentPhID, int runNumber, MergeableRunProductMetadata const *)
Definition: SubProcess.cc:624
edm::EventPrincipal::eventSelectionIDs
EventSelectionIDVector const & eventSelectionIDs() const
Definition: EventPrincipal.cc:374
edm::LumiTransitionInfo::principal
LuminosityBlockPrincipal & principal()
Definition: TransitionInfoTypes.h:53
edm::SubProcess::selectors_
detail::TriggerResultsBasedEventSelector selectors_
Definition: SubProcess.h:322
edm::SubProcess::doStreamBeginLuminosityBlockAsync
void doStreamBeginLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &)
Definition: SubProcess.cc:764
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::RunPrincipal::reducedProcessHistoryID
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:63
edm::ParameterSet::popVParameterSet
std::vector< ParameterSet > popVParameterSet(std::string const &name)
Definition: ParameterSet.cc:150
edm::PrincipalCache::insertForInput
void insertForInput(std::unique_ptr< ProcessBlockPrincipal >)
Definition: PrincipalCache.cc:98
edm::ProductRegistry::allBranchDescriptions
std::vector< BranchDescription const * > allBranchDescriptions() const
Definition: ProductRegistry.cc:199
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EventPrincipal::streamID
StreamID streamID() const
Definition: EventPrincipal.h:110
edm::SubProcess::actReg_
std::shared_ptr< ActivityRegistry > actReg_
Definition: SubProcess.h:284
edm::EDGetToken
Definition: EDGetToken.h:35
edm::eventsetup::EventSetupsController
Definition: EventSetupsController.h:80
edm::Principal::clearPrincipal
void clearPrincipal()
Definition: Principal.cc:382
edm::SubProcess::writeProcessBlockAsync
void writeProcessBlockAsync(edm::WaitingTaskHolder task, ProcessBlockType)
Definition: SubProcess.cc:605
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LuminosityBlockPrincipal.h
WaitingTask.h
SubProcess.h
edm::SubProcess::SubProcess
SubProcess(ParameterSet &parameterSet, ParameterSet const &topLevelParameterSet, std::shared_ptr< ProductRegistry const > parentProductRegistry, std::shared_ptr< BranchIDListHelper const > parentBranchIDListHelper, ProcessBlockHelperBase const &parentProcessBlockHelper, ThinnedAssociationsHelper const &parentThinnedAssociationsHelper, SubProcessParentageHelper const &parentSubProcessParentageHelper, eventsetup::EventSetupsController &esController, ActivityRegistry &parentActReg, ServiceToken const &token, serviceregistry::ServiceLegacy iLegacy, PreallocationConfiguration const &preallocConfig, ProcessContext const *parentProcessContext)
Definition: SubProcess.cc:50
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
edm::PrincipalCache::ProcessBlockType
ProcessBlockType
Definition: PrincipalCache.h:57
edm::PrincipalCache::inputProcessBlockPrincipal
ProcessBlockPrincipal & inputProcessBlockPrincipal() const
Definition: PrincipalCache.h:55
edm::LumiTransitionInfo::eventSetupImpls
std::vector< std::shared_ptr< const EventSetupImpl > > const * eventSetupImpls() const
Definition: TransitionInfoTypes.h:56
FileBlock.h
edm::detail::configureEventSelector
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
Definition: TriggerResultsBasedEventSelector.cc:80
edm::ProcessBlockPrincipal::fillProcessBlockPrincipal
void fillProcessBlockPrincipal(std::string const &processName, DelayedReader *reader=nullptr)
Definition: ProcessBlockPrincipal.cc:16
edm::SubProcess::productSelector_
ProductSelector productSelector_
Definition: SubProcess.h:317
ScheduleItems.h
edm::EventForOutput
Definition: EventForOutput.h:50
OccurrenceTraits.h
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::PrincipalCache::ProcessBlockType::Input
edm::SubProcess::doStreamBeginRunAsync
void doStreamBeginRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &)
Definition: SubProcess.cc:742
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::detail::registerProperSelectionInfo
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
Definition: TriggerResultsBasedEventSelector.cc:163
edm::ProductRegistry::productList
ProductList const & productList() const
Definition: ProductRegistry.h:76
edm::SubProcess::endJob
void endJob()
Definition: SubProcess.cc:306
edm::SubProcess::parentToChildPhID_
std::map< ProcessHistoryID, ProcessHistoryID > parentToChildPhID_
Definition: SubProcess.h:307
edm::nonConsumedUnscheduledModules
std::vector< ModuleDescription const * > nonConsumedUnscheduledModules(edm::PathsAndConsumesOfModulesBase const &iPnC, std::vector< ModuleProcessName > &consumedByChildren)
Definition: PathsAndConsumesOfModules.cc:165
edm::SubProcess::doBeginStream
void doBeginStream(unsigned int)
Definition: SubProcess.cc:730
edm::SubProcess::parentPreg_
std::shared_ptr< ProductRegistry const > parentPreg_
Definition: SubProcess.h:286
edm::SubProcess::doEndRunAsync
void doEndRunAsync(WaitingTaskHolder iHolder, RunTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
Definition: SubProcess.cc:592
edm::PathsAndConsumesOfModules::removeModules
void removeModules(std::vector< ModuleDescription const * > const &modules)
Definition: PathsAndConsumesOfModules.cc:53
edm::SubProcess::doBeginRunAsync
void doBeginRunAsync(WaitingTaskHolder iHolder, RunTransitionInfo const &iTransitionInfo)
Definition: SubProcess.cc:562
edm::SubProcess::fixBranchIDListsForEDAliases
void fixBranchIDListsForEDAliases(std::map< BranchID::value_type, BranchID::value_type > const &droppedBranchIDToKeptBranchID)
Definition: SubProcess.cc:380
edm::ProductResolverBase
Definition: ProductResolverBase.h:34
edm::PrincipalCache::getAvailableLumiPrincipalPtr
std::shared_ptr< LuminosityBlockPrincipal > getAvailableLumiPrincipalPtr()
Definition: PrincipalCache.cc:50
edm::SubProcess::branchIDListHelper_
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: SubProcess.h:288
RunAuxiliary.h
edm::eventsetup::EventSetupsController::makeProvider
std::shared_ptr< EventSetupProvider > makeProvider(ParameterSet &, ActivityRegistry *, ParameterSet const *eventSetupPset=nullptr, unsigned int maxConcurrentIOVs=0, bool dumpOptions=false)
Definition: EventSetupsController.cc:42
edm::ModuleProcessName
Definition: ModuleProcessName.h:12
Data_TkAlMinBias_Run2018C_PromptReco_v3_cff.maxEvents
maxEvents
Definition: Data_TkAlMinBias_Run2018C_PromptReco_v3_cff.py:3
hgcal::association
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
Definition: LCToCPAssociatorByEnergyScoreImpl.h:44
edm::SubProcess::historyAppenders_
std::vector< HistoryAppender > historyAppenders_
Definition: SubProcess.h:301
ThinnedAssociation.h
edm::OccurrenceTraits< LuminosityBlockPrincipal, BranchActionStreamEnd >
Definition: OccurrenceTraits.h:314
edm::PreallocationConfiguration::numberOfStreams
unsigned int numberOfStreams() const
Definition: PreallocationConfiguration.h:35
edm::ProductResolverBase::connectTo
virtual void connectTo(ProductResolverBase const &, Principal const *)=0
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::PrincipalCache::processBlockPrincipal
ProcessBlockPrincipal & processBlockPrincipal() const
Definition: PrincipalCache.h:54
edm::BranchDescription
Definition: BranchDescription.h:32
visualization-live-secondInstance_cfg.numberOfStreams
numberOfStreams
Definition: visualization-live-secondInstance_cfg.py:95
globalTransitionAsync.h
validateTopLevelParameterSets.h
TransitionInfoTypes.h
ParameterSet.h
edm::SubProcess::writeLumiAsync
void writeLumiAsync(WaitingTaskHolder, LuminosityBlockPrincipal &)
Definition: SubProcess.cc:704
edm::LuminosityBlockPrincipal::index
LuminosityBlockIndex index() const
Definition: LuminosityBlockPrincipal.h:51
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
edm::SubProcess::processContext_
ProcessContext processContext_
Definition: SubProcess.h:294
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::ProductRegistry::anyProductProduced
bool anyProductProduced() const
Definition: ProductRegistry.h:122
edm::PrincipalCache::eventPrincipal
EventPrincipal & eventPrincipal(unsigned int iStreamIndex) const
Definition: PrincipalCache.h:70
edm::TypeToGet
Definition: TypeToGet.h:32
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::PrincipalCache::insert
void insert(std::unique_ptr< ProcessBlockPrincipal >)
Definition: PrincipalCache.cc:96
edm::SubProcess::subProcessParentageHelper_
edm::propagate_const< std::shared_ptr< SubProcessParentageHelper > > subProcessParentageHelper_
Definition: SubProcess.h:291
edm::EventSelectionIDVector
std::vector< EventSelectionID > EventSelectionIDVector
Definition: EventSelectionID.h:16
MatrixUtil.merge
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:201
edm::SubProcess::keepOnlyConsumedUnscheduledModules
std::vector< ModuleProcessName > keepOnlyConsumedUnscheduledModules(bool deleteModules)
Definition: SubProcess.cc:231
edm::PathsAndConsumesOfModulesBase::allModules
std::vector< ModuleDescription const * > const & allModules() const
Definition: PathsAndConsumesOfModulesBase.h:42
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::InputTag
Definition: InputTag.h:15
edm::EventPrincipal::eventToProcessBlockIndexes
EventToProcessBlockIndexes const & eventToProcessBlockIndexes() const
Definition: EventPrincipal.cc:378
edm::SubProcess::doStreamEndLuminosityBlockAsync
void doStreamEndLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &, bool cleaningUpAfterException)
Definition: SubProcess.cc:776
edm::RunTransitionInfo::principal
RunPrincipal & principal()
Definition: TransitionInfoTypes.h:71
edm::WaitingTaskHolder::group
tbb::task_group * group() const noexcept
Definition: WaitingTaskHolder.h:77
EventSelectionID.h
edm::serviceregistry::ServiceLegacy
ServiceLegacy
Definition: ServiceLegacy.h:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edm::SubProcess::doEndLuminosityBlockAsync
void doEndLuminosityBlockAsync(WaitingTaskHolder iHolder, LumiTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)
Definition: SubProcess.cc:690
edm::PrincipalCache::setNumberOfConcurrentPrincipals
void setNumberOfConcurrentPrincipals(PreallocationConfiguration const &)
Definition: PrincipalCache.cc:17
edm::SubProcess::preg_
std::shared_ptr< ProductRegistry const > preg_
Definition: SubProcess.h:287
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
edm::SubProcess::principalCache_
PrincipalCache principalCache_
Definition: SubProcess.h:302