CMS 3D CMS Logo

Schedule.cc
Go to the documentation of this file.
2 
36 
37 #include <algorithm>
38 #include <cassert>
39 #include <cstdlib>
40 #include <functional>
41 #include <iomanip>
42 #include <list>
43 #include <map>
44 #include <set>
45 #include <exception>
46 #include <sstream>
47 
49 
50 namespace edm {
51 
52  class Maker;
53 
54  namespace {
55  using std::placeholders::_1;
56 
57  bool binary_search_string(std::vector<std::string> const& v, std::string const& s) {
58  return std::binary_search(v.begin(), v.end(), s);
59  }
60 
61  // Here we make the trigger results inserter directly. This should
62  // probably be a utility in the WorkerRegistry or elsewhere.
63 
64  std::shared_ptr<TriggerResultInserter> makeInserter(ParameterSet& proc_pset,
65  PreallocationConfiguration const& iPrealloc,
66  ProductRegistry& preg,
67  ExceptionToActionTable const& actions,
68  std::shared_ptr<ActivityRegistry> areg,
69  std::shared_ptr<ProcessConfiguration> processConfiguration) {
70  ParameterSet* trig_pset = proc_pset.getPSetForUpdate("@trigger_paths");
71  trig_pset->registerIt();
72 
73  WorkerParams work_args(trig_pset, preg, &iPrealloc, processConfiguration, actions);
74  ModuleDescription md(trig_pset->id(),
75  "TriggerResultInserter",
76  "TriggerResults",
77  processConfiguration.get(),
79 
80  areg->preModuleConstructionSignal_(md);
81  bool postCalled = false;
82  std::shared_ptr<TriggerResultInserter> returnValue;
83  // Caught exception is rethrown
84  CMS_SA_ALLOW try {
85  maker::ModuleHolderT<TriggerResultInserter> holder(
86  make_shared_noexcept_false<TriggerResultInserter>(*trig_pset, iPrealloc.numberOfStreams()),
87  static_cast<Maker const*>(nullptr));
88  holder.setModuleDescription(md);
89  holder.registerProductsAndCallbacks(&preg);
90  returnValue = holder.module();
91  postCalled = true;
92  // if exception then post will be called in the catch block
93  areg->postModuleConstructionSignal_(md);
94  } catch (...) {
95  if (!postCalled) {
96  CMS_SA_ALLOW try { areg->postModuleConstructionSignal_(md); } catch (...) {
97  // If post throws an exception ignore it because we are already handling another exception
98  }
99  }
100  throw;
101  }
102  return returnValue;
103  }
104 
105  template <typename T>
106  void makePathStatusInserters(std::vector<edm::propagate_const<std::shared_ptr<T>>>& pathStatusInserters,
107  std::vector<std::string> const& pathNames,
108  PreallocationConfiguration const& iPrealloc,
109  ProductRegistry& preg,
110  std::shared_ptr<ActivityRegistry> areg,
111  std::shared_ptr<ProcessConfiguration> processConfiguration,
112  std::string const& moduleTypeName) {
114  pset.addParameter<std::string>("@module_type", moduleTypeName);
115  pset.addParameter<std::string>("@module_edm_type", "EDProducer");
116  pset.registerIt();
117 
118  pathStatusInserters.reserve(pathNames.size());
119 
120  for (auto const& pathName : pathNames) {
121  ModuleDescription md(
122  pset.id(), moduleTypeName, pathName, processConfiguration.get(), ModuleDescription::getUniqueID());
123 
124  areg->preModuleConstructionSignal_(md);
125  bool postCalled = false;
126  // Caught exception is rethrown
127  CMS_SA_ALLOW try {
128  maker::ModuleHolderT<T> holder(make_shared_noexcept_false<T>(iPrealloc.numberOfStreams()),
129  static_cast<Maker const*>(nullptr));
130  holder.setModuleDescription(md);
131  holder.registerProductsAndCallbacks(&preg);
132  pathStatusInserters.emplace_back(holder.module());
133  postCalled = true;
134  // if exception then post will be called in the catch block
135  areg->postModuleConstructionSignal_(md);
136  } catch (...) {
137  if (!postCalled) {
138  CMS_SA_ALLOW try { areg->postModuleConstructionSignal_(md); } catch (...) {
139  // If post throws an exception ignore it because we are already handling another exception
140  }
141  }
142  throw;
143  }
144  }
145  }
146 
147  void checkAndInsertAlias(std::string const& friendlyClassName,
148  std::string const& moduleLabel,
149  std::string const& productInstanceName,
150  std::string const& processName,
151  std::string const& alias,
152  std::string const& instanceAlias,
153  ProductRegistry const& preg,
154  std::multimap<BranchKey, BranchKey>& aliasMap,
155  std::map<BranchKey, BranchKey>& aliasKeys) {
156  std::string const star("*");
157 
158  BranchKey key(friendlyClassName, moduleLabel, productInstanceName, processName);
159  if (preg.productList().find(key) == preg.productList().end()) {
160  // No product was found matching the alias.
161  // We throw an exception only if a module with the specified module label was created in this process.
162  for (auto const& product : preg.productList()) {
163  if (moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
164  throw Exception(errors::Configuration, "EDAlias does not match data\n")
165  << "There are no products of type '" << friendlyClassName << "'\n"
166  << "with module label '" << moduleLabel << "' and instance name '" << productInstanceName << "'.\n";
167  }
168  }
169  }
170 
171  if (auto iter = aliasMap.find(key); iter != aliasMap.end()) {
172  // If the same EDAlias defines multiple products pointing to the same product, throw
173  if (iter->second.moduleLabel() == alias) {
174  throw Exception(errors::Configuration, "EDAlias conflict\n")
175  << "The module label alias '" << alias << "' is used for multiple products of type '" << friendlyClassName
176  << "' with module label '" << moduleLabel << "' and instance name '" << productInstanceName
177  << "'. One alias has the instance name '" << iter->first.productInstanceName()
178  << "' and the other has the instance name '" << instanceAlias << "'.";
179  }
180  }
181 
182  std::string const& theInstanceAlias(instanceAlias == star ? productInstanceName : instanceAlias);
183  BranchKey aliasKey(friendlyClassName, alias, theInstanceAlias, processName);
184  if (preg.productList().find(aliasKey) != preg.productList().end()) {
185  throw Exception(errors::Configuration, "EDAlias conflicts with data\n")
186  << "A product of type '" << friendlyClassName << "'\n"
187  << "with module label '" << alias << "' and instance name '" << theInstanceAlias << "'\n"
188  << "already exists.\n";
189  }
190  auto iter = aliasKeys.find(aliasKey);
191  if (iter != aliasKeys.end()) {
192  // The alias matches a previous one. If the same alias is used for different product, throw.
193  if (iter->second != key) {
194  throw Exception(errors::Configuration, "EDAlias conflict\n")
195  << "The module label alias '" << alias << "' and product instance alias '" << theInstanceAlias << "'\n"
196  << "are used for multiple products of type '" << friendlyClassName << "'\n"
197  << "One has module label '" << moduleLabel << "' and product instance name '" << productInstanceName
198  << "',\n"
199  << "the other has module label '" << iter->second.moduleLabel() << "' and product instance name '"
200  << iter->second.productInstanceName() << "'.\n";
201  }
202  } else {
203  auto prodIter = preg.productList().find(key);
204  if (prodIter != preg.productList().end()) {
205  if (!prodIter->second.produced()) {
206  throw Exception(errors::Configuration, "EDAlias\n")
207  << "The module label alias '" << alias << "' and product instance alias '" << theInstanceAlias << "'\n"
208  << "are used for a product of type '" << friendlyClassName << "'\n"
209  << "with module label '" << moduleLabel << "' and product instance name '" << productInstanceName
210  << "',\n"
211  << "An EDAlias can only be used for products produced in the current process. This one is not.\n";
212  }
213  aliasMap.insert(std::make_pair(key, aliasKey));
214  aliasKeys.insert(std::make_pair(aliasKey, key));
215  }
216  }
217  }
218 
219  void processEDAliases(ParameterSet const& proc_pset, std::string const& processName, ProductRegistry& preg) {
220  std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string>>("@all_aliases");
221  if (aliases.empty()) {
222  return;
223  }
224  std::string const star("*");
225  std::string const empty("");
227  desc.add<std::string>("type");
228  desc.add<std::string>("fromProductInstance", star);
229  desc.add<std::string>("toProductInstance", star);
230 
231  std::multimap<BranchKey, BranchKey> aliasMap;
232 
233  std::map<BranchKey, BranchKey> aliasKeys; // Used to search for duplicates or clashes.
234 
235  // Now, loop over the alias information and store it in aliasMap.
236  for (std::string const& alias : aliases) {
237  ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
238  std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<VParameterSet>();
239  for (std::string const& moduleLabel : vPSetNames) {
240  VParameterSet vPSet = aliasPSet.getParameter<VParameterSet>(moduleLabel);
241  for (ParameterSet& pset : vPSet) {
242  desc.validate(pset);
243  std::string friendlyClassName = pset.getParameter<std::string>("type");
244  std::string productInstanceName = pset.getParameter<std::string>("fromProductInstance");
245  std::string instanceAlias = pset.getParameter<std::string>("toProductInstance");
246  if (productInstanceName == star) {
247  bool match = false;
248  BranchKey lowerBound(friendlyClassName, moduleLabel, empty, empty);
249  for (ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
250  it != preg.productList().end() && it->first.friendlyClassName() == friendlyClassName &&
251  it->first.moduleLabel() == moduleLabel;
252  ++it) {
253  if (it->first.processName() != processName) {
254  continue;
255  }
256  match = true;
257 
258  checkAndInsertAlias(friendlyClassName,
259  moduleLabel,
260  it->first.productInstanceName(),
261  processName,
262  alias,
263  instanceAlias,
264  preg,
265  aliasMap,
266  aliasKeys);
267  }
268  if (!match) {
269  // No product was found matching the alias.
270  // We throw an exception only if a module with the specified module label was created in this process.
271  for (auto const& product : preg.productList()) {
272  if (moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
273  throw Exception(errors::Configuration, "EDAlias parameter set mismatch\n")
274  << "There are no products of type '" << friendlyClassName << "'\n"
275  << "with module label '" << moduleLabel << "'.\n";
276  }
277  }
278  }
279  } else {
280  checkAndInsertAlias(friendlyClassName,
281  moduleLabel,
282  productInstanceName,
283  processName,
284  alias,
285  instanceAlias,
286  preg,
287  aliasMap,
288  aliasKeys);
289  }
290  }
291  }
292  }
293 
294  // Now add the new alias entries to the product registry.
295  for (auto const& aliasEntry : aliasMap) {
296  ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
297  assert(it != preg.productList().end());
298  preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel(), aliasEntry.second.productInstanceName());
299  }
300  }
301 
302  typedef std::vector<std::string> vstring;
303 
304  void processSwitchProducers(ParameterSet const& proc_pset, std::string const& processName, ProductRegistry& preg) {
305  // Update Switch BranchDescriptions for the chosen case
306  struct BranchesCases {
307  BranchesCases(std::vector<std::string> cases) : caseLabels{std::move(cases)} {}
308  std::vector<BranchKey> chosenBranches;
309  std::vector<std::string> caseLabels;
310  };
311  std::map<std::string, BranchesCases> switchMap;
312  for (auto& prod : preg.productListUpdator()) {
313  if (prod.second.isSwitchAlias()) {
314  auto it = switchMap.find(prod.second.moduleLabel());
315  if (it == switchMap.end()) {
316  auto const& switchPSet = proc_pset.getParameter<edm::ParameterSet>(prod.second.moduleLabel());
317  auto inserted = switchMap.emplace(prod.second.moduleLabel(),
318  switchPSet.getParameter<std::vector<std::string>>("@all_cases"));
319  assert(inserted.second);
320  it = inserted.first;
321  }
322 
323  bool found = false;
324  for (auto const& productIter : preg.productList()) {
325  BranchKey const& branchKey = productIter.first;
326  // The alias-for product must be in the same process as
327  // the SwitchProducer (earlier processes or SubProcesses
328  // may contain products with same type, module label, and
329  // instance name)
330  if (branchKey.processName() != processName) {
331  continue;
332  }
333 
334  BranchDescription const& desc = productIter.second;
335  if (desc.branchType() == prod.second.branchType() and
336  desc.unwrappedTypeID().typeInfo() == prod.second.unwrappedTypeID().typeInfo() and
337  branchKey.moduleLabel() == prod.second.switchAliasModuleLabel() and
338  branchKey.productInstanceName() == prod.second.productInstanceName()) {
339  prod.second.setSwitchAliasForBranch(desc);
340  it->second.chosenBranches.push_back(prod.first); // with moduleLabel of the Switch
341  found = true;
342  }
343  }
344  if (not found) {
346  ex << "Trying to find a BranchDescription to be aliased-for by SwitchProducer with\n"
347  << " friendly class name = " << prod.second.friendlyClassName() << "\n"
348  << " module label = " << prod.second.moduleLabel() << "\n"
349  << " product instance name = " << prod.second.productInstanceName() << "\n"
350  << " process name = " << processName
351  << "\n\nbut did not find any. Please contact a framework developer.";
352  ex.addContext("Calling Schedule.cc:processSwitchProducers()");
353  throw ex;
354  }
355  }
356  }
357  if (switchMap.empty())
358  return;
359 
360  for (auto& elem : switchMap) {
361  std::sort(elem.second.chosenBranches.begin(), elem.second.chosenBranches.end());
362  }
363 
364  // Check that non-chosen cases declare exactly the same branches
365  // Also set the alias-for branches to transient
366  std::vector<bool> foundBranches;
367  for (auto const& switchItem : switchMap) {
368  auto const& switchLabel = switchItem.first;
369  auto const& chosenBranches = switchItem.second.chosenBranches;
370  auto const& caseLabels = switchItem.second.caseLabels;
371  foundBranches.resize(chosenBranches.size());
372  for (auto const& caseLabel : caseLabels) {
373  std::fill(foundBranches.begin(), foundBranches.end(), false);
374  for (auto& nonConstItem : preg.productListUpdator()) {
375  auto const& item = nonConstItem;
376  if (item.first.moduleLabel() == caseLabel and item.first.processName() == processName) {
377  // Set the alias-for branch as transient so it gets fully ignored in output.
378  // I tried first to implicitly drop all branches with
379  // '@' in ProductSelector, but that gave problems on
380  // input (those branches would be implicitly dropped on
381  // input as well, leading to the SwitchProducer branches
382  // do be dropped as dependent ones, as the alias
383  // detection logic in RootFile says that the
384  // SwitchProducer branches are not alias branches)
385  nonConstItem.second.setTransient(true);
386 
387  auto range = std::equal_range(chosenBranches.begin(),
388  chosenBranches.end(),
389  BranchKey(item.first.friendlyClassName(),
390  switchLabel,
391  item.first.productInstanceName(),
392  item.first.processName()));
393  if (range.first == range.second) {
395  << "SwitchProducer " << switchLabel << " has a case " << caseLabel << " with a product "
396  << item.first << " that is not produced by the chosen case "
397  << proc_pset.getParameter<edm::ParameterSet>(switchLabel)
398  .getUntrackedParameter<std::string>("@chosen_case");
399  }
400  assert(std::distance(range.first, range.second) == 1);
401  foundBranches[std::distance(chosenBranches.begin(), range.first)] = true;
402 
403  // Check that there are no BranchAliases for any of the cases
404  auto const& bd = item.second;
405  if (not bd.branchAliases().empty()) {
407  << "SwitchProducer does not support ROOT branch aliases. Got the following ROOT branch "
408  "aliases for SwitchProducer with label "
409  << switchLabel << " for case " << caseLabel << ":";
410  for (auto const& branchAlias : bd.branchAliases()) {
411  ex << " " << branchAlias;
412  }
413  throw ex;
414  }
415  }
416  }
417 
418  for (size_t i = 0; i < chosenBranches.size(); i++) {
419  if (not foundBranches[i]) {
421  << "SwitchProducer " << switchLabel << " has a case " << caseLabel
422  << " that does not produce a product " << chosenBranches[i] << " that is produced by the chosen case "
423  << proc_pset.getParameter<edm::ParameterSet>(switchLabel)
424  .getUntrackedParameter<std::string>("@chosen_case");
425  }
426  }
427  }
428  }
429  }
430 
431  void reduceParameterSet(ParameterSet& proc_pset,
432  vstring const& end_path_name_list,
433  vstring& modulesInConfig,
434  std::set<std::string> const& usedModuleLabels,
435  std::map<std::string, std::vector<std::pair<std::string, int>>>& outputModulePathPositions) {
436  // Before calculating the ParameterSetID of the top level ParameterSet or
437  // saving it in the registry drop from the top level ParameterSet all
438  // OutputModules and EDAnalyzers not on trigger paths. If unscheduled
439  // production is not enabled also drop all the EDFilters and EDProducers
440  // that are not scheduled. Drop the ParameterSet used to configure the module
441  // itself. Also drop the other traces of these labels in the top level
442  // ParameterSet: Remove that labels from @all_modules and from all the
443  // end paths. If this makes any end paths empty, then remove the end path
444  // name from @end_paths, and @paths.
445 
446  // First make a list of labels to drop
447  vstring outputModuleLabels;
448  std::string edmType;
449  std::string const moduleEdmType("@module_edm_type");
450  std::string const outputModule("OutputModule");
451  std::string const edAnalyzer("EDAnalyzer");
452  std::string const edFilter("EDFilter");
453  std::string const edProducer("EDProducer");
454 
455  std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
456 
457  //need a list of all modules on paths in order to determine
458  // if an EDAnalyzer only appears on an end path
459  vstring scheduledPaths = proc_pset.getParameter<vstring>("@paths");
460  std::set<std::string> modulesOnPaths;
461  {
462  std::set<std::string> noEndPaths(scheduledPaths.begin(), scheduledPaths.end());
463  for (auto const& endPath : end_path_name_list) {
464  noEndPaths.erase(endPath);
465  }
466  {
467  vstring labels;
468  for (auto const& path : noEndPaths) {
469  labels = proc_pset.getParameter<vstring>(path);
470  modulesOnPaths.insert(labels.begin(), labels.end());
471  }
472  }
473  }
474  //Initially fill labelsToBeDropped with all module mentioned in
475  // the configuration but which are not being used by the system
476  std::vector<std::string> labelsToBeDropped;
477  labelsToBeDropped.reserve(modulesInConfigSet.size());
478  std::set_difference(modulesInConfigSet.begin(),
479  modulesInConfigSet.end(),
480  usedModuleLabels.begin(),
481  usedModuleLabels.end(),
482  std::back_inserter(labelsToBeDropped));
483 
484  const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
485  for (auto const& modLabel : usedModuleLabels) {
486  // Do nothing for modules that do not have a ParameterSet. Modules of type
487  // PathStatusInserter and EndPathStatusInserter will not have a ParameterSet.
488  if (proc_pset.existsAs<ParameterSet>(modLabel)) {
489  edmType = proc_pset.getParameterSet(modLabel).getParameter<std::string>(moduleEdmType);
490  if (edmType == outputModule) {
491  outputModuleLabels.push_back(modLabel);
492  labelsToBeDropped.push_back(modLabel);
493  }
494  if (edmType == edAnalyzer) {
495  if (modulesOnPaths.end() == modulesOnPaths.find(modLabel)) {
496  labelsToBeDropped.push_back(modLabel);
497  }
498  }
499  }
500  }
501  //labelsToBeDropped must be sorted
502  std::inplace_merge(
503  labelsToBeDropped.begin(), labelsToBeDropped.begin() + sizeBeforeOutputModules, labelsToBeDropped.end());
504 
505  // drop the parameter sets used to configure the modules
506  for_all(labelsToBeDropped, std::bind(&ParameterSet::eraseOrSetUntrackedParameterSet, std::ref(proc_pset), _1));
507 
508  // drop the labels from @all_modules
509  vstring::iterator endAfterRemove =
510  std::remove_if(modulesInConfig.begin(),
511  modulesInConfig.end(),
512  std::bind(binary_search_string, std::ref(labelsToBeDropped), _1));
513  modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
514  proc_pset.addParameter<vstring>(std::string("@all_modules"), modulesInConfig);
515 
516  // drop the labels from all end paths
517  vstring endPathsToBeDropped;
518  vstring labels;
519  for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
520  iEndPath != endEndPath;
521  ++iEndPath) {
522  labels = proc_pset.getParameter<vstring>(*iEndPath);
523  vstring::iterator iSave = labels.begin();
524  vstring::iterator iBegin = labels.begin();
525 
526  for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end(); iLabel != iEnd; ++iLabel) {
527  if (binary_search_string(labelsToBeDropped, *iLabel)) {
528  if (binary_search_string(outputModuleLabels, *iLabel)) {
529  outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
530  }
531  } else {
532  if (iSave != iLabel) {
533  iSave->swap(*iLabel);
534  }
535  ++iSave;
536  }
537  }
538  labels.erase(iSave, labels.end());
539  if (labels.empty()) {
540  // remove empty end paths and save their names
541  proc_pset.eraseSimpleParameter(*iEndPath);
542  endPathsToBeDropped.push_back(*iEndPath);
543  } else {
544  proc_pset.addParameter<vstring>(*iEndPath, labels);
545  }
546  }
547  sort_all(endPathsToBeDropped);
548 
549  // remove empty end paths from @paths
550  endAfterRemove = std::remove_if(scheduledPaths.begin(),
551  scheduledPaths.end(),
552  std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
553  scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
554  proc_pset.addParameter<vstring>(std::string("@paths"), scheduledPaths);
555 
556  // remove empty end paths from @end_paths
557  vstring scheduledEndPaths = proc_pset.getParameter<vstring>("@end_paths");
558  endAfterRemove = std::remove_if(scheduledEndPaths.begin(),
559  scheduledEndPaths.end(),
560  std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
561  scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
562  proc_pset.addParameter<vstring>(std::string("@end_paths"), scheduledEndPaths);
563  }
564 
565  class RngEDConsumer : public EDConsumerBase {
566  public:
567  explicit RngEDConsumer(std::set<TypeID>& typesConsumed) {
569  if (rng.isAvailable()) {
570  rng->consumes(consumesCollector());
571  for (auto const& consumesInfo : this->consumesInfo()) {
572  typesConsumed.emplace(consumesInfo.type());
573  }
574  }
575  }
576  };
577  } // namespace
578  // -----------------------------
579 
580  typedef std::vector<std::string> vstring;
581 
582  // -----------------------------
583 
585  service::TriggerNamesService const& tns,
586  ProductRegistry& preg,
587  BranchIDListHelper& branchIDListHelper,
588  ThinnedAssociationsHelper& thinnedAssociationsHelper,
589  SubProcessParentageHelper const* subProcessParentageHelper,
591  std::shared_ptr<ActivityRegistry> areg,
592  std::shared_ptr<ProcessConfiguration> processConfiguration,
593  bool hasSubprocesses,
594  PreallocationConfiguration const& prealloc,
595  ProcessContext const* processContext)
596  : //Only create a resultsInserter if there is a trigger path
597  resultsInserter_{tns.getTrigPaths().empty()
598  ? std::shared_ptr<TriggerResultInserter>{}
599  : makeInserter(proc_pset, prealloc, preg, actions, areg, processConfiguration)},
600  moduleRegistry_(new ModuleRegistry()),
601  all_output_communicators_(),
602  preallocConfig_(prealloc),
603  pathNames_(&tns.getTrigPaths()),
604  endPathNames_(&tns.getEndPaths()),
605  wantSummary_(tns.wantSummary()),
606  endpathsAreActive_(true) {
607  makePathStatusInserters(pathStatusInserters_,
608  *pathNames_,
609  prealloc,
610  preg,
611  areg,
612  processConfiguration,
613  std::string("PathStatusInserter"));
614 
615  makePathStatusInserters(endPathStatusInserters_,
616  *endPathNames_,
617  prealloc,
618  preg,
619  areg,
620  processConfiguration,
621  std::string("EndPathStatusInserter"));
622 
623  assert(0 < prealloc.numberOfStreams());
624  streamSchedules_.reserve(prealloc.numberOfStreams());
625  for (unsigned int i = 0; i < prealloc.numberOfStreams(); ++i) {
626  streamSchedules_.emplace_back(make_shared_noexcept_false<StreamSchedule>(resultsInserter(),
627  pathStatusInserters_,
628  endPathStatusInserters_,
629  moduleRegistry(),
630  proc_pset,
631  tns,
632  prealloc,
633  preg,
634  branchIDListHelper,
635  actions,
636  areg,
637  processConfiguration,
638  !hasSubprocesses,
639  StreamID{i},
640  processContext));
641  }
642 
643  //TriggerResults are injected automatically by StreamSchedules and are
644  // unknown to the ModuleRegistry
645  const std::string kTriggerResults("TriggerResults");
646  std::vector<std::string> modulesToUse;
647  modulesToUse.reserve(streamSchedules_[0]->allWorkers().size());
648  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
649  if (worker->description().moduleLabel() != kTriggerResults) {
650  modulesToUse.push_back(worker->description().moduleLabel());
651  }
652  }
653  //The unscheduled modules are at the end of the list, but we want them at the front
654  unsigned int const nUnscheduledModules = streamSchedules_[0]->numberOfUnscheduledModules();
655  if (nUnscheduledModules > 0) {
656  std::vector<std::string> temp;
657  temp.reserve(modulesToUse.size());
658  auto itBeginUnscheduled = modulesToUse.begin() + modulesToUse.size() - nUnscheduledModules;
659  std::copy(itBeginUnscheduled, modulesToUse.end(), std::back_inserter(temp));
660  std::copy(modulesToUse.begin(), itBeginUnscheduled, std::back_inserter(temp));
661  temp.swap(modulesToUse);
662  }
663 
664  // propagate_const<T> has no reset() function
665  globalSchedule_ = std::make_unique<GlobalSchedule>(resultsInserter(),
666  pathStatusInserters_,
667  endPathStatusInserters_,
668  moduleRegistry(),
669  modulesToUse,
670  proc_pset,
671  preg,
672  prealloc,
673  actions,
674  areg,
675  processConfiguration,
676  processContext);
677 
678  //TriggerResults is not in the top level ParameterSet so the call to
679  // reduceParameterSet would fail to find it. Just remove it up front.
680  std::set<std::string> usedModuleLabels;
681  for (auto const& worker : allWorkers()) {
682  if (worker->description().moduleLabel() != kTriggerResults) {
683  usedModuleLabels.insert(worker->description().moduleLabel());
684  }
685  }
686  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string>>("@all_modules"));
687  std::map<std::string, std::vector<std::pair<std::string, int>>> outputModulePathPositions;
688  reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels, outputModulePathPositions);
689  processEDAliases(proc_pset, processConfiguration->processName(), preg);
690 
691  // At this point all BranchDescriptions are created. Mark now the
692  // ones of unscheduled workers to be on-demand.
693  if (nUnscheduledModules > 0) {
694  std::set<std::string> unscheduledModules(modulesToUse.begin(), modulesToUse.begin() + nUnscheduledModules);
695  preg.setUnscheduledProducts(unscheduledModules);
696  }
697 
698  processSwitchProducers(proc_pset, processConfiguration->processName(), preg);
699  proc_pset.registerIt();
700  processConfiguration->setParameterSetID(proc_pset.id());
701  processConfiguration->setProcessConfigurationID();
702 
703  // This is used for a little sanity-check to make sure no code
704  // modifications alter the number of workers at a later date.
705  size_t all_workers_count = allWorkers().size();
706 
707  moduleRegistry_->forAllModuleHolders([this](maker::ModuleHolder* iHolder) {
708  auto comm = iHolder->createOutputModuleCommunicator();
709  if (comm) {
710  all_output_communicators_.emplace_back(std::shared_ptr<OutputModuleCommunicator>{comm.release()});
711  }
712  });
713  // Now that the output workers are filled in, set any output limits or information.
714  limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
715 
716  // Sanity check: make sure nobody has added a worker after we've
717  // already relied on the WorkerManager being full.
718  assert(all_workers_count == allWorkers().size());
719 
720  branchIDListHelper.updateFromRegistry(preg);
721 
722  for (auto const& worker : streamSchedules_[0]->allWorkers()) {
723  worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
724  }
725  thinnedAssociationsHelper.sort();
726 
727  // The output modules consume products in kept branches.
728  // So we must set this up before freezing.
729  for (auto& c : all_output_communicators_) {
730  c->selectProducts(preg, thinnedAssociationsHelper);
731  }
732 
733  for (auto& product : preg.productListUpdator()) {
734  setIsMergeable(product.second);
735  }
736 
737  {
738  // We now get a collection of types that may be consumed.
739  std::set<TypeID> productTypesConsumed;
740  std::set<TypeID> elementTypesConsumed;
741  // Loop over all modules
742  for (auto const& worker : allWorkers()) {
743  for (auto const& consumesInfo : worker->consumesInfo()) {
744  if (consumesInfo.kindOfType() == PRODUCT_TYPE) {
745  productTypesConsumed.emplace(consumesInfo.type());
746  } else {
747  elementTypesConsumed.emplace(consumesInfo.type());
748  }
749  }
750  }
751  // The SubProcess class is not a module, yet it may consume.
752  if (hasSubprocesses) {
753  productTypesConsumed.emplace(typeid(TriggerResults));
754  }
755  // The RandomNumberGeneratorService is not a module, yet it consumes.
756  { RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
757  preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
758  }
759 
760  for (auto& c : all_output_communicators_) {
761  c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
762  }
763 
764  if (wantSummary_) {
765  std::vector<const ModuleDescription*> modDesc;
766  const auto& workers = allWorkers();
767  modDesc.reserve(workers.size());
768 
769  std::transform(workers.begin(),
770  workers.end(),
771  std::back_inserter(modDesc),
772  [](const Worker* iWorker) -> const ModuleDescription* { return iWorker->descPtr(); });
773 
774  // propagate_const<T> has no reset() function
775  summaryTimeKeeper_ = std::make_unique<SystemTimeKeeper>(prealloc.numberOfStreams(), modDesc, tns, processContext);
776  auto timeKeeperPtr = summaryTimeKeeper_.get();
777 
778  areg->watchPreModuleEvent(timeKeeperPtr, &SystemTimeKeeper::startModuleEvent);
779  areg->watchPostModuleEvent(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
780  areg->watchPreModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
781  areg->watchPostModuleEventAcquire(timeKeeperPtr, &SystemTimeKeeper::stopModuleEvent);
782  areg->watchPreModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::pauseModuleEvent);
783  areg->watchPostModuleEventDelayedGet(timeKeeperPtr, &SystemTimeKeeper::restartModuleEvent);
784 
785  areg->watchPreSourceEvent(timeKeeperPtr, &SystemTimeKeeper::startEvent);
786  areg->watchPostEvent(timeKeeperPtr, &SystemTimeKeeper::stopEvent);
787 
788  areg->watchPrePathEvent(timeKeeperPtr, &SystemTimeKeeper::startPath);
789  areg->watchPostPathEvent(timeKeeperPtr, &SystemTimeKeeper::stopPath);
790 
791  areg->watchPostBeginJob(timeKeeperPtr, &SystemTimeKeeper::startProcessingLoop);
792  areg->watchPreEndJob(timeKeeperPtr, &SystemTimeKeeper::stopProcessingLoop);
793  //areg->preModuleEventSignal_.connect([timeKeeperPtr](StreamContext const& iContext, ModuleCallingContext const& iMod) {
794  //timeKeeperPtr->startModuleEvent(iContext,iMod);
795  //});
796  }
797 
798  } // Schedule::Schedule
799 
800  void Schedule::limitOutput(ParameterSet const& proc_pset,
801  BranchIDLists const& branchIDLists,
802  SubProcessParentageHelper const* subProcessParentageHelper) {
803  std::string const output("output");
804 
805  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents");
806  int maxEventSpecs = 0;
807  int maxEventsOut = -1;
808  ParameterSet const* vMaxEventsOut = nullptr;
809  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
810  if (search_all(intNamesE, output)) {
811  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
812  ++maxEventSpecs;
813  }
814  std::vector<std::string> psetNamesE;
815  maxEventsPSet.getParameterSetNames(psetNamesE, false);
816  if (search_all(psetNamesE, output)) {
817  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
818  ++maxEventSpecs;
819  }
820 
821  if (maxEventSpecs > 1) {
823  << "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
824  }
825 
826  for (auto& c : all_output_communicators_) {
827  OutputModuleDescription desc(branchIDLists, maxEventsOut, subProcessParentageHelper);
828  if (vMaxEventsOut != nullptr && !vMaxEventsOut->empty()) {
829  std::string const& moduleLabel = c->description().moduleLabel();
830  try {
831  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
832  } catch (Exception const&) {
834  << "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
835  }
836  }
837  c->configure(desc);
838  }
839  }
840 
841  bool Schedule::terminate() const {
842  if (all_output_communicators_.empty()) {
843  return false;
844  }
845  for (auto& c : all_output_communicators_) {
846  if (!c->limitReached()) {
847  // Found an output module that has not reached output event count.
848  return false;
849  }
850  }
851  LogInfo("SuccessfulTermination") << "The job is terminating successfully because each output module\n"
852  << "has reached its configured limit.\n";
853  return true;
854  }
855 
857  globalSchedule_->endJob(collector);
858  if (collector.hasThrown()) {
859  return;
860  }
861 
862  if (wantSummary_ == false)
863  return;
864  {
865  TriggerReport tr;
866  getTriggerReport(tr);
867 
868  // The trigger report (pass/fail etc.):
869 
870  LogVerbatim("FwkSummary") << "";
871  if (streamSchedules_[0]->context().processContext()->isSubProcess()) {
872  LogVerbatim("FwkSummary") << "TrigReport Process: "
873  << streamSchedules_[0]->context().processContext()->processName();
874  }
875  LogVerbatim("FwkSummary") << "TrigReport "
876  << "---------- Event Summary ------------";
877  if (!tr.trigPathSummaries.empty()) {
878  LogVerbatim("FwkSummary") << "TrigReport"
879  << " Events total = " << tr.eventSummary.totalEvents
880  << " passed = " << tr.eventSummary.totalEventsPassed
881  << " failed = " << tr.eventSummary.totalEventsFailed << "";
882  } else {
883  LogVerbatim("FwkSummary") << "TrigReport"
884  << " Events total = " << tr.eventSummary.totalEvents
885  << " passed = " << tr.eventSummary.totalEvents << " failed = 0";
886  }
887 
888  LogVerbatim("FwkSummary") << "";
889  LogVerbatim("FwkSummary") << "TrigReport "
890  << "---------- Path Summary ------------";
891  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
892  << " " << std::right << std::setw(10) << "Executed"
893  << " " << std::right << std::setw(10) << "Passed"
894  << " " << std::right << std::setw(10) << "Failed"
895  << " " << std::right << std::setw(10) << "Error"
896  << " "
897  << "Name"
898  << "";
899  for (auto const& p : tr.trigPathSummaries) {
900  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
901  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
902  << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10)
903  << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " "
904  << p.name << "";
905  }
906 
907  /*
908  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
909  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
910  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
911  for (; epi != epe; ++epi, ++epn) {
912 
913  LogVerbatim("FwkSummary") << "TrigReport "
914  << std::right << std::setw(5) << 1
915  << std::right << std::setw(5) << *epi << " "
916  << std::right << std::setw(10) << totalEvents() << " "
917  << std::right << std::setw(10) << totalEvents() << " "
918  << std::right << std::setw(10) << 0 << " "
919  << std::right << std::setw(10) << 0 << " "
920  << *epn << "";
921  }
922  */
923 
924  LogVerbatim("FwkSummary") << "";
925  LogVerbatim("FwkSummary") << "TrigReport "
926  << "-------End-Path Summary ------------";
927  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
928  << " " << std::right << std::setw(10) << "Executed"
929  << " " << std::right << std::setw(10) << "Passed"
930  << " " << std::right << std::setw(10) << "Failed"
931  << " " << std::right << std::setw(10) << "Error"
932  << " "
933  << "Name"
934  << "";
935  for (auto const& p : tr.endPathSummaries) {
936  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
937  << p.bitPosition << " " << std::right << std::setw(10) << p.timesRun << " "
938  << std::right << std::setw(10) << p.timesPassed << " " << std::right << std::setw(10)
939  << p.timesFailed << " " << std::right << std::setw(10) << p.timesExcept << " "
940  << p.name << "";
941  }
942 
943  for (auto const& p : tr.trigPathSummaries) {
944  LogVerbatim("FwkSummary") << "";
945  LogVerbatim("FwkSummary") << "TrigReport "
946  << "---------- Modules in Path: " << p.name << " ------------";
947  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
948  << " " << std::right << std::setw(10) << "Visited"
949  << " " << std::right << std::setw(10) << "Passed"
950  << " " << std::right << std::setw(10) << "Failed"
951  << " " << std::right << std::setw(10) << "Error"
952  << " "
953  << "Name"
954  << "";
955 
956  unsigned int bitpos = 0;
957  for (auto const& mod : p.moduleInPathSummaries) {
958  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 1 << std::right << std::setw(5)
959  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
960  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
961  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
962  << mod.timesExcept << " " << mod.moduleLabel << "";
963  ++bitpos;
964  }
965  }
966 
967  for (auto const& p : tr.endPathSummaries) {
968  LogVerbatim("FwkSummary") << "";
969  LogVerbatim("FwkSummary") << "TrigReport "
970  << "------ Modules in End-Path: " << p.name << " ------------";
971  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Trig Bit#"
972  << " " << std::right << std::setw(10) << "Visited"
973  << " " << std::right << std::setw(10) << "Passed"
974  << " " << std::right << std::setw(10) << "Failed"
975  << " " << std::right << std::setw(10) << "Error"
976  << " "
977  << "Name"
978  << "";
979 
980  unsigned int bitpos = 0;
981  for (auto const& mod : p.moduleInPathSummaries) {
982  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(5) << 0 << std::right << std::setw(5)
983  << bitpos << " " << std::right << std::setw(10) << mod.timesVisited << " "
984  << std::right << std::setw(10) << mod.timesPassed << " " << std::right
985  << std::setw(10) << mod.timesFailed << " " << std::right << std::setw(10)
986  << mod.timesExcept << " " << mod.moduleLabel << "";
987  ++bitpos;
988  }
989  }
990 
991  LogVerbatim("FwkSummary") << "";
992  LogVerbatim("FwkSummary") << "TrigReport "
993  << "---------- Module Summary ------------";
994  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << "Visited"
995  << " " << std::right << std::setw(10) << "Executed"
996  << " " << std::right << std::setw(10) << "Passed"
997  << " " << std::right << std::setw(10) << "Failed"
998  << " " << std::right << std::setw(10) << "Error"
999  << " "
1000  << "Name"
1001  << "";
1002  for (auto const& worker : tr.workerSummaries) {
1003  LogVerbatim("FwkSummary") << "TrigReport " << std::right << std::setw(10) << worker.timesVisited << " "
1004  << std::right << std::setw(10) << worker.timesRun << " " << std::right
1005  << std::setw(10) << worker.timesPassed << " " << std::right << std::setw(10)
1006  << worker.timesFailed << " " << std::right << std::setw(10) << worker.timesExcept
1007  << " " << worker.moduleLabel << "";
1008  }
1009  LogVerbatim("FwkSummary") << "";
1010  }
1011  // The timing report (CPU and Real Time):
1014 
1015  const int totalEvents = std::max(1, tr.eventSummary.totalEvents);
1016 
1017  LogVerbatim("FwkSummary") << "TimeReport "
1018  << "---------- Event Summary ---[sec]----";
1019  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1020  << " event loop CPU/event = " << tr.eventSummary.cpuTime / totalEvents;
1021  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1022  << " event loop Real/event = " << tr.eventSummary.realTime / totalEvents;
1023  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed
1024  << " sum Streams Real/event = " << tr.eventSummary.sumStreamRealTime / totalEvents;
1025  LogVerbatim("FwkSummary") << "TimeReport" << std::setprecision(6) << std::fixed << " efficiency CPU/Real/thread = "
1027 
1028  constexpr int kColumn1Size = 10;
1029  constexpr int kColumn2Size = 12;
1030  constexpr int kColumn3Size = 12;
1031  LogVerbatim("FwkSummary") << "";
1032  LogVerbatim("FwkSummary") << "TimeReport "
1033  << "---------- Path Summary ---[Real sec]----";
1034  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1035  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1036  << " Name";
1037  for (auto const& p : tr.trigPathSummaries) {
1038  const int timesRun = std::max(1, p.timesRun);
1039  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1040  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1041  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1042  }
1043  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1044  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1045  << " Name"
1046  << "";
1047 
1048  LogVerbatim("FwkSummary") << "";
1049  LogVerbatim("FwkSummary") << "TimeReport "
1050  << "-------End-Path Summary ---[Real sec]----";
1051  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1052  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1053  << " Name"
1054  << "";
1055  for (auto const& p : tr.endPathSummaries) {
1056  const int timesRun = std::max(1, p.timesRun);
1057 
1058  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1059  << std::setw(kColumn1Size) << p.realTime / totalEvents << " " << std::right
1060  << std::setw(kColumn2Size) << p.realTime / timesRun << " " << p.name << "";
1061  }
1062  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1063  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1064  << " Name"
1065  << "";
1066 
1067  for (auto const& p : tr.trigPathSummaries) {
1068  LogVerbatim("FwkSummary") << "";
1069  LogVerbatim("FwkSummary") << "TimeReport "
1070  << "---------- Modules in Path: " << p.name << " ---[Real sec]----";
1071  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1072  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1073  << " Name"
1074  << "";
1075  for (auto const& mod : p.moduleInPathSummaries) {
1076  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1077  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1078  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1079  << mod.moduleLabel << "";
1080  }
1081  }
1082  if (not tr.trigPathSummaries.empty()) {
1083  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1084  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1085  << " Name"
1086  << "";
1087  }
1088  for (auto const& p : tr.endPathSummaries) {
1089  LogVerbatim("FwkSummary") << "";
1090  LogVerbatim("FwkSummary") << "TimeReport "
1091  << "------ Modules in End-Path: " << p.name << " ---[Real sec]----";
1092  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1093  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1094  << " Name"
1095  << "";
1096  for (auto const& mod : p.moduleInPathSummaries) {
1097  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1098  << std::setw(kColumn1Size) << mod.realTime / totalEvents << " " << std::right
1099  << std::setw(kColumn2Size) << mod.realTime / std::max(1, mod.timesVisited) << " "
1100  << mod.moduleLabel << "";
1101  }
1102  }
1103  if (not tr.endPathSummaries.empty()) {
1104  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1105  << " " << std::right << std::setw(kColumn2Size) << "per visit"
1106  << " Name"
1107  << "";
1108  }
1109  LogVerbatim("FwkSummary") << "";
1110  LogVerbatim("FwkSummary") << "TimeReport "
1111  << "---------- Module Summary ---[Real sec]----";
1112  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1113  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1114  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1115  << " Name"
1116  << "";
1117  for (auto const& worker : tr.workerSummaries) {
1118  LogVerbatim("FwkSummary") << "TimeReport " << std::setprecision(6) << std::fixed << std::right
1119  << std::setw(kColumn1Size) << worker.realTime / totalEvents << " " << std::right
1120  << std::setw(kColumn2Size) << worker.realTime / std::max(1, worker.timesRun) << " "
1121  << std::right << std::setw(kColumn3Size)
1122  << worker.realTime / std::max(1, worker.timesVisited) << " " << worker.moduleLabel
1123  << "";
1124  }
1125  LogVerbatim("FwkSummary") << "TimeReport " << std::right << std::setw(kColumn1Size) << "per event"
1126  << " " << std::right << std::setw(kColumn2Size) << "per exec"
1127  << " " << std::right << std::setw(kColumn3Size) << "per visit"
1128  << " Name"
1129  << "";
1130 
1131  LogVerbatim("FwkSummary") << "";
1132  LogVerbatim("FwkSummary") << "T---Report end!"
1133  << "";
1134  LogVerbatim("FwkSummary") << "";
1135  }
1136 
1138  using std::placeholders::_1;
1140  }
1141 
1143  using std::placeholders::_1;
1145  }
1146 
1148  RunPrincipal const& rp,
1149  ProcessContext const* processContext,
1150  ActivityRegistry* activityRegistry,
1151  MergeableRunProductMetadata const* mergeableRunProductMetadata) {
1154  LuminosityBlockID(rp.run(), 0),
1155  rp.index(),
1157  rp.endTime(),
1158  processContext);
1159  auto t =
1160  make_waiting_task(tbb::task::allocate_root(),
1161  [task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable {
1162  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1163  CMS_SA_ALLOW try {
1164  //services can depend on other services
1166 
1167  activityRegistry->postGlobalWriteRunSignal_(globalContext);
1168  } catch (...) {
1169  }
1170  std::exception_ptr ptr;
1171  if (iExcept) {
1172  ptr = *iExcept;
1173  }
1174  task.doneWaiting(ptr);
1175  });
1176  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1177  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteRunSignal_(globalContext); } catch (...) {
1178  }
1179  WaitingTaskHolder tHolder(t);
1180 
1181  for (auto& c : all_output_communicators_) {
1182  c->writeRunAsync(tHolder, rp, processContext, activityRegistry, mergeableRunProductMetadata);
1183  }
1184  }
1185 
1187  LuminosityBlockPrincipal const& lbp,
1188  ProcessContext const* processContext,
1189  ActivityRegistry* activityRegistry) {
1192  lbp.id(),
1193  lbp.runPrincipal().index(),
1194  lbp.index(),
1195  lbp.beginTime(),
1196  processContext);
1197 
1198  auto t =
1199  make_waiting_task(tbb::task::allocate_root(),
1200  [task, activityRegistry, globalContext, token](std::exception_ptr const* iExcept) mutable {
1201  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1202  CMS_SA_ALLOW try {
1203  //services can depend on other services
1205 
1206  activityRegistry->postGlobalWriteLumiSignal_(globalContext);
1207  } catch (...) {
1208  }
1209  std::exception_ptr ptr;
1210  if (iExcept) {
1211  ptr = *iExcept;
1212  }
1213  task.doneWaiting(ptr);
1214  });
1215  // Propagating the exception would be nontrivial, and signal actions are not supposed to throw exceptions
1216  CMS_SA_ALLOW try { activityRegistry->preGlobalWriteLumiSignal_(globalContext); } catch (...) {
1217  }
1218  WaitingTaskHolder tHolder(t);
1219  for (auto& c : all_output_communicators_) {
1220  c->writeLumiAsync(tHolder, lbp, processContext, activityRegistry);
1221  }
1222  }
1223 
1225  using std::placeholders::_1;
1226  // Return true iff at least one output module returns true.
1227  return (std::find_if(all_output_communicators_.begin(),
1231  }
1232 
1234  using std::placeholders::_1;
1235  for_all(allWorkers(), std::bind(&Worker::respondToOpenInputFile, _1, std::cref(fb)));
1236  }
1237 
1239  using std::placeholders::_1;
1240  for_all(allWorkers(), std::bind(&Worker::respondToCloseInputFile, _1, std::cref(fb)));
1241  }
1242 
1243  void Schedule::beginJob(ProductRegistry const& iRegistry, eventsetup::ESRecordsToProxyIndices const& iESIndices) {
1244  globalSchedule_->beginJob(iRegistry, iESIndices);
1245  }
1246 
1247  void Schedule::beginStream(unsigned int iStreamID) {
1248  assert(iStreamID < streamSchedules_.size());
1249  streamSchedules_[iStreamID]->beginStream();
1250  }
1251 
1252  void Schedule::endStream(unsigned int iStreamID) {
1253  assert(iStreamID < streamSchedules_.size());
1254  streamSchedules_[iStreamID]->endStream();
1255  }
1256 
1258  unsigned int iStreamID,
1259  EventPrincipal& ep,
1260  EventSetupImpl const& es,
1261  ServiceToken const& token) {
1262  assert(iStreamID < streamSchedules_.size());
1263  streamSchedules_[iStreamID]->processOneEventAsync(std::move(iTask), ep, es, token, pathStatusInserters_);
1264  }
1265 
1267  ParameterSet const& iPSet,
1268  const ProductRegistry& iRegistry,
1269  eventsetup::ESRecordsToProxyIndices const& iIndices) {
1270  Worker* found = nullptr;
1271  for (auto const& worker : allWorkers()) {
1272  if (worker->description().moduleLabel() == iLabel) {
1273  found = worker;
1274  break;
1275  }
1276  }
1277  if (nullptr == found) {
1278  return false;
1279  }
1280 
1281  auto newMod = moduleRegistry_->replaceModule(iLabel, iPSet, preallocConfig_);
1282 
1283  globalSchedule_->replaceModule(newMod, iLabel);
1284 
1285  for (auto& s : streamSchedules_) {
1286  s->replaceModule(newMod, iLabel);
1287  }
1288 
1289  {
1290  //Need to updateLookup in order to make getByToken work
1291  auto const runLookup = iRegistry.productLookup(InRun);
1292  auto const lumiLookup = iRegistry.productLookup(InLumi);
1293  auto const eventLookup = iRegistry.productLookup(InEvent);
1294  found->updateLookup(InRun, *runLookup);
1295  found->updateLookup(InLumi, *lumiLookup);
1296  found->updateLookup(InEvent, *eventLookup);
1297  found->updateLookup(iIndices);
1298 
1299  auto const& processName = newMod->moduleDescription().processName();
1300  auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1301  auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1302  auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1303  found->resolvePutIndicies(InRun, runModuleToIndicies);
1304  found->resolvePutIndicies(InLumi, lumiModuleToIndicies);
1305  found->resolvePutIndicies(InEvent, eventModuleToIndicies);
1306  }
1307 
1308  return true;
1309  }
1310 
1311  std::vector<ModuleDescription const*> Schedule::getAllModuleDescriptions() const {
1312  std::vector<ModuleDescription const*> result;
1313  result.reserve(allWorkers().size());
1314 
1315  for (auto const& worker : allWorkers()) {
1316  ModuleDescription const* p = worker->descPtr();
1317  result.push_back(p);
1318  }
1319  return result;
1320  }
1321 
1322  Schedule::AllWorkers const& Schedule::allWorkers() const { return globalSchedule_->allWorkers(); }
1323 
1325  for (auto const& worker : allWorkers()) {
1326  worker->convertCurrentProcessAlias(processName);
1327  }
1328  }
1329 
1330  void Schedule::availablePaths(std::vector<std::string>& oLabelsToFill) const {
1331  streamSchedules_[0]->availablePaths(oLabelsToFill);
1332  }
1333 
1334  void Schedule::triggerPaths(std::vector<std::string>& oLabelsToFill) const { oLabelsToFill = *pathNames_; }
1335 
1336  void Schedule::endPaths(std::vector<std::string>& oLabelsToFill) const { oLabelsToFill = *endPathNames_; }
1337 
1338  void Schedule::modulesInPath(std::string const& iPathLabel, std::vector<std::string>& oLabelsToFill) const {
1339  streamSchedules_[0]->modulesInPath(iPathLabel, oLabelsToFill);
1340  }
1341 
1343  std::vector<ModuleDescription const*>& descriptions,
1344  unsigned int hint) const {
1345  streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1346  }
1347 
1349  std::vector<ModuleDescription const*>& descriptions,
1350  unsigned int hint) const {
1351  streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1352  }
1353 
1355  std::vector<ModuleDescription const*>& allModuleDescriptions,
1356  std::vector<std::pair<unsigned int, unsigned int>>& moduleIDToIndex,
1357  std::vector<std::vector<ModuleDescription const*>>& modulesWhoseProductsAreConsumedBy,
1358  ProductRegistry const& preg) const {
1359  allModuleDescriptions.clear();
1360  moduleIDToIndex.clear();
1361  modulesWhoseProductsAreConsumedBy.clear();
1362 
1363  allModuleDescriptions.reserve(allWorkers().size());
1364  moduleIDToIndex.reserve(allWorkers().size());
1365  modulesWhoseProductsAreConsumedBy.resize(allWorkers().size());
1366 
1367  std::map<std::string, ModuleDescription const*> labelToDesc;
1368  unsigned int i = 0;
1369  for (auto const& worker : allWorkers()) {
1370  ModuleDescription const* p = worker->descPtr();
1371  allModuleDescriptions.push_back(p);
1372  moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->id(), i));
1373  labelToDesc[p->moduleLabel()] = p;
1374  ++i;
1375  }
1376  sort_all(moduleIDToIndex);
1377 
1378  i = 0;
1379  for (auto const& worker : allWorkers()) {
1380  std::vector<ModuleDescription const*>& modules = modulesWhoseProductsAreConsumedBy.at(i);
1381  worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1382  ++i;
1383  }
1384  }
1385 
1386  void Schedule::enableEndPaths(bool active) {
1387  endpathsAreActive_ = active;
1388  for (auto& s : streamSchedules_) {
1389  s->enableEndPaths(active);
1390  }
1391  }
1392 
1394 
1396  rep.eventSummary.totalEvents = 0;
1397  rep.eventSummary.totalEventsPassed = 0;
1398  rep.eventSummary.totalEventsFailed = 0;
1399  for (auto& s : streamSchedules_) {
1400  s->getTriggerReport(rep);
1401  }
1402  sort_all(rep.workerSummaries);
1403  }
1404 
1406  rep.eventSummary.totalEvents = 0;
1407  rep.eventSummary.cpuTime = 0.;
1408  rep.eventSummary.realTime = 0.;
1409  summaryTimeKeeper_->fillTriggerTimingReport(rep);
1410  }
1411 
1413  int returnValue = 0;
1414  for (auto& s : streamSchedules_) {
1415  returnValue += s->totalEvents();
1416  }
1417  return returnValue;
1418  }
1419 
1421  int returnValue = 0;
1422  for (auto& s : streamSchedules_) {
1423  returnValue += s->totalEventsPassed();
1424  }
1425  return returnValue;
1426  }
1427 
1429  int returnValue = 0;
1430  for (auto& s : streamSchedules_) {
1431  returnValue += s->totalEventsFailed();
1432  }
1433  return returnValue;
1434  }
1435 
1437  for (auto& s : streamSchedules_) {
1438  s->clearCounters();
1439  }
1440  }
1441 } // namespace edm
edm::OutputModuleDescription::maxEvents_
int maxEvents_
Definition: OutputModuleDescription.h:26
edm::Schedule::beginJob
void beginJob(ProductRegistry const &, eventsetup::ESRecordsToProxyIndices const &)
Definition: Schedule.cc:1243
edm::Schedule::Schedule
Schedule(ParameterSet &proc_pset, service::TriggerNamesService const &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ThinnedAssociationsHelper &thinnedAssociationsHelper, SubProcessParentageHelper const *subProcessParentageHelper, ExceptionToActionTable const &actions, std::shared_ptr< ActivityRegistry > areg, std::shared_ptr< ProcessConfiguration > processConfiguration, bool hasSubprocesses, PreallocationConfiguration const &config, ProcessContext const *processContext)
Definition: Schedule.cc:584
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
edm::StreamID
Definition: StreamID.h:30
edm::ActivityRegistry::preGlobalWriteLumiSignal_
PreGlobalEndLumi preGlobalWriteLumiSignal_
Definition: ActivityRegistry.h:358
ThinnedAssociationsHelper.h
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
edm::RunPrincipal::endTime
Timestamp const & endTime() const
Definition: RunPrincipal.h:69
edm::LuminosityBlockPrincipal::runPrincipal
RunPrincipal const & runPrincipal() const
Definition: LuminosityBlockPrincipal.h:45
edm::EventTimingSummary::sumStreamRealTime
double sumStreamRealTime
Definition: TriggerTimingReport.h:21
ProductResolverIndexHelper.h
mps_fire.i
i
Definition: mps_fire.py:355
ZMuMuCategoriesSequences_cff.endPath
endPath
Definition: ZMuMuCategoriesSequences_cff.py:316
edm::TriggerTimingReport::eventSummary
EventTimingSummary eventSummary
Definition: TriggerTimingReport.h:53
edm::Schedule::limitOutput
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
Definition: Schedule.cc:800
edm::SubProcessParentageHelper
Definition: SubProcessParentageHelper.h:21
edm::Schedule::pathNames_
std::vector< std::string > const * pathNames_
Definition: Schedule.h:310
MessageLogger.h
edm::eventsetup::ESRecordsToProxyIndices
Definition: ESRecordsToProxyIndices.h:35
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::Schedule::endStream
void endStream(unsigned int)
Definition: Schedule.cc:1252
edm::Schedule::writeRunAsync
void writeRunAsync(WaitingTaskHolder iTask, RunPrincipal const &rp, ProcessContext const *, ActivityRegistry *, MergeableRunProductMetadata const *)
Definition: Schedule.cc:1147
edm::EventSummary::totalEvents
int totalEvents
Definition: TriggerReport.h:19
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
TriggerResults.h
edm::setIsMergeable
void setIsMergeable(BranchDescription &)
Definition: setIsMergeable.cc:15
edm::TriggerTimingReport::trigPathSummaries
std::vector< PathTimingSummary > trigPathSummaries
Definition: TriggerTimingReport.h:54
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
edm::ParameterSet::getUntrackedParameterSet
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
Definition: ParameterSet.cc:2129
edm::errors::LogicError
Definition: EDMException.h:37
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
BranchIDListHelper.h
edm::ActivityRegistry::postGlobalWriteRunSignal_
PostGlobalWriteRun postGlobalWriteRunSignal_
Definition: ActivityRegistry.h:301
TriggerNamesService.h
WaitingTaskHolder.h
edm::PreallocationConfiguration::numberOfThreads
unsigned int numberOfThreads() const
Definition: PreallocationConfiguration.h:34
modules
Definition: ZHLTMatchFilter.cc:17
edm::ParameterSet::eraseOrSetUntrackedParameterSet
void eraseOrSetUntrackedParameterSet(std::string const &name)
Definition: ParameterSet.cc:131
edm::Schedule::modulesInPath
void modulesInPath(std::string const &iPathLabel, std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill in execution order the labels of all modules in path iPathLabel
Definition: Schedule.cc:1338
edm
HLT enums.
Definition: AlignableModifier.h:19
RandomNumberGenerator.h
edm::ProcessContext
Definition: ProcessContext.h:27
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
edm::EventTimingSummary::cpuTime
double cpuTime
Definition: TriggerTimingReport.h:19
edm::LogInfo
Definition: MessageLogger.h:254
edm::Schedule::clearCounters
void clearCounters()
Clear all the counters in the trigger report.
Definition: Schedule.cc:1436
TriggerTimingReport.h
edm::TriggerTimingReport::endPathSummaries
std::vector< PathTimingSummary > endPathSummaries
Definition: TriggerTimingReport.h:55
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
Algorithms.h
edm::ModuleDescription::getUniqueID
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
Definition: ModuleDescription.cc:87
cms::cuda::assert
assert(be >=bs)
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
edm::Worker::respondToOpenInputFile
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:173
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
TypeID.h
edm::Schedule::openOutputFiles
void openOutputFiles(FileBlock &fb)
Definition: Schedule.cc:1142
edm::SystemTimeKeeper::startProcessingLoop
void startProcessingLoop()
Definition: SystemTimeKeeper.cc:193
edm::ProductRegistry::productLookup
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
Definition: ProductRegistry.cc:149
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
PreallocationConfiguration.h
ProductRegistry.h
edm::Schedule::moduleDescriptionsInEndPath
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
Definition: Schedule.cc:1348
edm::Schedule::totalEvents
int totalEvents() const
Definition: Schedule.cc:1412
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::SystemTimeKeeper::stopProcessingLoop
void stopProcessingLoop()
Definition: SystemTimeKeeper.cc:195
edm::Schedule::totalEventsFailed
int totalEventsFailed() const
Definition: Schedule.cc:1428
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::InRun
Definition: BranchType.h:11
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
edm::Schedule::closeOutputFiles
void closeOutputFiles()
Definition: Schedule.cc:1137
edm::Schedule::wantSummary_
bool wantSummary_
Definition: Schedule.h:312
edm::SystemTimeKeeper::startModuleEvent
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:153
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::TriggerReport::trigPathSummaries
std::vector< PathSummary > trigPathSummaries
Definition: TriggerReport.h:58
edm::Exception
Definition: EDMException.h:77
edm::Schedule::convertCurrentProcessAlias
void convertCurrentProcessAlias(std::string const &processName)
Convert "@currentProcess" in InputTag process names to the actual current process name.
Definition: Schedule.cc:1324
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
edm::ProductRegistry
Definition: ProductRegistry.h:34
ActivityRegistry.h
edm::Schedule::availablePaths
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: Schedule.cc:1330
edm::FileBlock
Definition: FileBlock.h:20
TriggerReport.h
edm::ServiceToken
Definition: ServiceToken.h:40
edm::ActivityRegistry::postGlobalWriteLumiSignal_
PostGlobalEndLumi postGlobalWriteLumiSignal_
Definition: ActivityRegistry.h:365
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::propagate_const
Definition: propagate_const.h:32
OutputModuleCommunicator.h
edm::vstring
std::vector< std::string > vstring
Definition: Schedule.cc:580
edm::SystemTimeKeeper::startEvent
void startEvent(StreamID)
Definition: SystemTimeKeeper.cc:124
edm::EventPrincipal
Definition: EventPrincipal.h:46
OutputModuleDescription.h
ProcessConfiguration.h
hltMonBTagIPClient_cfi.pathName
pathName
Definition: hltMonBTagIPClient_cfi.py:5
edm::ExceptionCollector
Definition: ExceptionCollector.h:33
edm::TriggerReport::workerSummaries
std::vector< WorkerSummary > workerSummaries
Definition: TriggerReport.h:60
edm::Schedule::shouldWeCloseOutput
bool shouldWeCloseOutput() const
Definition: Schedule.cc:1224
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
edm::Schedule::endJob
void endJob(ExceptionCollector &collector)
Definition: Schedule.cc:856
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
edm::TriggerTimingReport
Definition: TriggerTimingReport.h:52
edm::Schedule::processOneEventAsync
void processOneEventAsync(WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetupImpl const &eventSetup, ServiceToken const &token)
Definition: Schedule.cc:1257
edm::Schedule::changeModule
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry, eventsetup::ESRecordsToProxyIndices const &)
Definition: Schedule.cc:1266
edm::MergeableRunProductMetadata
Definition: MergeableRunProductMetadata.h:52
Service
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
edm::Schedule::beginStream
void beginStream(unsigned int)
Definition: Schedule.cc:1247
edm::InEvent
Definition: BranchType.h:11
ConvertException.h
ExceptionCollector.h
ParameterSetDescription.h
edm::LuminosityBlockID
Definition: LuminosityBlockID.h:31
OrderedSet.t
t
Definition: OrderedSet.py:90
edm::Worker
Definition: Worker.h:83
edm::make_waiting_task
FunctorWaitingTask< F > * make_waiting_task(ALLOC &&iAlloc, F f)
Definition: WaitingTask.h:87
edm::BranchIDLists
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::RunPrincipal::index
RunIndex index() const
Definition: RunPrincipal.h:57
edm::Schedule::getTriggerReport
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1395
edm::ExceptionCollector::hasThrown
bool hasThrown() const
Definition: ExceptionCollector.cc:27
edm::OutputModuleCommunicator::shouldWeCloseFile
virtual bool shouldWeCloseFile() const =0
edm::GlobalContext::Transition::kWriteLuminosityBlock
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::GlobalContext
Definition: GlobalContext.h:29
edm::Schedule::streamSchedules_
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
Definition: Schedule.h:301
edm::ParameterSet
Definition: ParameterSet.h:36
edm::Schedule::endPathsEnabled
bool endPathsEnabled() const
Definition: Schedule.cc:1393
EDConsumerBase.h
edm::LuminosityBlockIndex::invalidLuminosityBlockIndex
static LuminosityBlockIndex invalidLuminosityBlockIndex()
Definition: LuminosityBlockIndex.cc:9
edm::TriggerReport::eventSummary
EventSummary eventSummary
Definition: TriggerReport.h:57
ParameterSet
Definition: Functions.h:16
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:30
edm::InLumi
Definition: BranchType.h:11
edm::Schedule::terminate
bool terminate() const
Return whether each output module has reached its maximum count.
Definition: Schedule.cc:841
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::OutputModuleCommunicator::openFile
virtual void openFile(FileBlock const &fb)=0
edm::Schedule::pathStatusInserters_
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
Definition: Schedule.h:298
edm::Schedule::fillModuleAndConsumesInfo
void fillModuleAndConsumesInfo(std::vector< ModuleDescription const * > &allModuleDescriptions, std::vector< std::pair< unsigned int, unsigned int >> &moduleIDToIndex, std::vector< std::vector< ModuleDescription const * >> &modulesWhoseProductsAreConsumedBy, ProductRegistry const &preg) const
Definition: Schedule.cc:1354
edm::ServiceRegistry::presentToken
ServiceToken presentToken() const
Definition: ServiceRegistry.cc:63
Exception
thread_safety_macros.h
TriggerResultInserter.h
edm::BranchIDListHelper
Definition: BranchIDListHelper.h:15
edm::RunPrincipal::run
RunNumber_t run() const
Definition: RunPrincipal.h:61
Schedule.h
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:168
edm::Schedule::endpathsAreActive_
volatile bool endpathsAreActive_
Definition: Schedule.h:314
edm::Schedule::respondToCloseInputFile
void respondToCloseInputFile(FileBlock const &fb)
Definition: Schedule.cc:1238
cuy.rep
rep
Definition: cuy.py:1190
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::SystemTimeKeeper::stopPath
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
Definition: SystemTimeKeeper.cc:140
edm::Schedule::AllWorkers
std::vector< Worker * > AllWorkers
Definition: Schedule.h:125
edm::GlobalContext::Transition::kWriteRun
edm::Worker::respondToCloseInputFile
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:174
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::SystemTimeKeeper::stopModuleEvent
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:160
edm::EventTimingSummary::totalEvents
int totalEvents
Definition: TriggerTimingReport.h:18
edm::ExceptionToActionTable
Definition: ExceptionActions.h:16
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Schedule::all_output_communicators_
AllOutputModuleCommunicators all_output_communicators_
Definition: Schedule.h:305
edm::EventSummary::totalEventsPassed
int totalEventsPassed
Definition: TriggerReport.h:20
PathStatusInserter.h
edm::ServiceRegistry::instance
static ServiceRegistry & instance()
Definition: ServiceRegistry.cc:90
edm::TriggerReport
Definition: TriggerReport.h:56
edm::Schedule::respondToOpenInputFile
void respondToOpenInputFile(FileBlock const &fb)
Definition: Schedule.cc:1233
SubProcess.h
EndPathStatusInserter.h
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::Schedule::endPaths
void endPaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all end paths in the process
Definition: Schedule.cc:1336
edm::Schedule::totalEventsPassed
int totalEventsPassed() const
Definition: Schedule.cc:1420
edm::service::TriggerNamesService
Definition: TriggerNamesService.h:42
edm::Schedule::enableEndPaths
void enableEndPaths(bool active)
Definition: Schedule.cc:1386
edm::Schedule::endPathNames_
std::vector< std::string > const * endPathNames_
Definition: Schedule.h:311
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
patCandidatesForDimuonsSequences_cff.pathNames
pathNames
Definition: patCandidatesForDimuonsSequences_cff.py:109
edm::TriggerTimingReport::workerSummaries
std::vector< WorkerTimingSummary > workerSummaries
Definition: TriggerTimingReport.h:56
ModuleRegistry.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::Schedule::allWorkers
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
Definition: Schedule.cc:1322
edm::ModuleRegistry
Definition: ModuleRegistry.h:40
edm::match
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
Definition: BranchDescription.cc:351
edm::Schedule::moduleDescriptionsInPath
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
Definition: Schedule.cc:1342
edm::SystemTimeKeeper::startPath
void startPath(StreamContext const &, PathContext const &)
Definition: SystemTimeKeeper.cc:133
edm::service::TriggerNamesService::getTrigPaths
Strings const & getTrigPaths() const
Definition: TriggerNamesService.h:55
ModuleHolder.h
edm::LuminosityBlockPrincipal::id
LuminosityBlockID id() const
Definition: LuminosityBlockPrincipal.h:53
edm::Schedule::summaryTimeKeeper_
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
Definition: Schedule.h:308
setIsMergeable.h
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:129
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:246
edm::SystemTimeKeeper::pauseModuleEvent
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:173
edm::OutputModuleCommunicator::closeFile
virtual void closeFile()=0
ParameterSetDescription
vstring
vector< string > vstring
Definition: ExoticaDQM.cc:8
edm::Schedule::writeLumiAsync
void writeLumiAsync(WaitingTaskHolder iTask, LuminosityBlockPrincipal const &lbp, ProcessContext const *, ActivityRegistry *)
Definition: Schedule.cc:1186
edm::Schedule::globalSchedule_
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
Definition: Schedule.h:303
edm::ActivityRegistry::preGlobalWriteRunSignal_
PreGlobalWriteRun preGlobalWriteRunSignal_
Definition: ActivityRegistry.h:296
actions
roAction_t actions[nactions]
Definition: GenABIO.cc:181
mps_fire.result
result
Definition: mps_fire.py:303
edm::search_all
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:36
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
genParticles_cff.map
map
Definition: genParticles_cff.py:11
edm::Schedule::moduleRegistry_
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
Definition: Schedule.h:300
edm::OutputModuleDescription
Definition: OutputModuleDescription.h:17
ParameterSet.h
edm::LuminosityBlockPrincipal::index
LuminosityBlockIndex index() const
Definition: LuminosityBlockPrincipal.h:51
edm::LuminosityBlockPrincipal::beginTime
Timestamp const & beginTime() const
Definition: LuminosityBlockPrincipal.h:55
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::TriggerReport::endPathSummaries
std::vector< PathSummary > endPathSummaries
Definition: TriggerReport.h:59
edm::EventSummary::totalEventsFailed
int totalEventsFailed
Definition: TriggerReport.h:21
edm::Schedule::getAllModuleDescriptions
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:1311
edm::SystemTimeKeeper::stopEvent
void stopEvent(StreamContext const &)
Definition: SystemTimeKeeper.cc:129
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::Schedule::triggerPaths
void triggerPaths(std::vector< std::string > &oLabelsToFill) const
Definition: Schedule.cc:1334
Factory.h
crabWrapper.key
key
Definition: crabWrapper.py:19
ConsumesInfo.h
edm::ServiceRegistry::Operate
Definition: ServiceRegistry.h:40
edm::errors::Configuration
Definition: EDMException.h:36
edm::EventTimingSummary::realTime
double realTime
Definition: TriggerTimingReport.h:20
EcalCalibMonitorClient_cfi.workers
workers
Definition: EcalCalibMonitorClient_cfi.py:19
edm::SystemTimeKeeper::restartModuleEvent
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: SystemTimeKeeper.cc:186
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
make_shared_noexcept_false.h
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
edm::Schedule::preallocConfig_
PreallocationConfiguration preallocConfig_
Definition: Schedule.h:306
edm::Schedule::getTriggerTimingReport
void getTriggerTimingReport(TriggerTimingReport &rep) const
Definition: Schedule.cc:1405
edm::ParameterSet::empty
bool empty() const
Definition: ParameterSet.h:190
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
edm::ParameterSet::getParameterSetNames
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
Definition: ParameterSet.cc:717