CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Schedule.cc
Go to the documentation of this file.
2 
26 
27 #include "boost/bind.hpp"
28 #include "boost/ref.hpp"
29 
30 #include <algorithm>
31 #include <cassert>
32 #include <cstdlib>
33 #include <functional>
34 #include <iomanip>
35 #include <list>
36 #include <map>
37 #include <exception>
38 
39 namespace edm {
40  namespace {
41 
42  // Function template to transform each element in the input range to
43  // a value placed into the output range. The supplied function
44  // should take a const_reference to the 'input', and write to a
45  // reference to the 'output'.
46  template <typename InputIterator, typename ForwardIterator, typename Func>
47  void
48  transform_into(InputIterator begin, InputIterator end,
49  ForwardIterator out, Func func) {
50  for (; begin != end; ++begin, ++out) func(*begin, *out);
51  }
52 
53  // Function template that takes a sequence 'from', a sequence
54  // 'to', and a callable object 'func'. It and applies
55  // transform_into to fill the 'to' sequence with the values
56  // calcuated by the callable object, taking care to fill the
57  // outupt only if all calls succeed.
58  template <typename FROM, typename TO, typename FUNC>
59  void
60  fill_summary(FROM const& from, TO& to, FUNC func) {
61  TO temp(from.size());
62  transform_into(from.begin(), from.end(), temp.begin(), func);
63  to.swap(temp);
64  }
65 
66  // -----------------------------
67 
68  // Here we make the trigger results inserter directly. This should
69  // probably be a utility in the WorkerRegistry or elsewhere.
70 
72  makeInserter(ParameterSet& proc_pset,
73  ProductRegistry& preg,
74  ActionTable const& actions,
75  boost::shared_ptr<ActivityRegistry> areg,
76  boost::shared_ptr<ProcessConfiguration> processConfiguration,
77  Schedule::TrigResPtr trptr) {
78 
79  ParameterSet* trig_pset = proc_pset.getPSetForUpdate("@trigger_paths");
80  trig_pset->registerIt();
81 
82  WorkerParams work_args(proc_pset, trig_pset, preg, processConfiguration, actions);
83  ModuleDescription md(trig_pset->id(),
84  "TriggerResultInserter",
85  "TriggerResults",
86  processConfiguration.get());
87 
88  areg->preModuleConstructionSignal_(md);
89  std::unique_ptr<EDProducer> producer(new TriggerResultInserter(*trig_pset, trptr));
90  areg->postModuleConstructionSignal_(md);
91 
92  Schedule::WorkerPtr ptr(new WorkerT<EDProducer>(std::move(producer), md, work_args));
93  ptr->setActivityRegistry(areg);
94  return ptr;
95  }
96 
97  bool binary_search_string(std::vector<std::string> const& v, std::string const& s) {
98  return std::binary_search(v.begin(), v.end(), s);
99  }
100 
101  void
102  initializeBranchToReadingWorker(ParameterSet const& opts,
103  ProductRegistry const& preg,
104  std::multimap<std::string,Worker*>& branchToReadingWorker)
105  {
106  // See if any data has been marked to be deleted early (removing any duplicates)
107  auto vBranchesToDeleteEarly = opts.getUntrackedParameter<std::vector<std::string>>("canDeleteEarly",std::vector<std::string>());
108  if(not vBranchesToDeleteEarly.empty()) {
109  std::sort(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),std::less<std::string>());
110  vBranchesToDeleteEarly.erase(std::unique(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end()),
111  vBranchesToDeleteEarly.end());
112 
113  // Are the requested items in the product registry?
114  auto allBranchNames = preg.allBranchNames();
115  //the branch names all end with a period, which we do not want to compare with
116  for(auto & b:allBranchNames) {
117  b.resize(b.size()-1);
118  }
119  std::sort(allBranchNames.begin(),allBranchNames.end(),std::less<std::string>());
120  std::vector<std::string> temp;
121  temp.reserve(vBranchesToDeleteEarly.size());
122 
123  std::set_intersection(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),
124  allBranchNames.begin(),allBranchNames.end(),
125  std::back_inserter(temp));
126  vBranchesToDeleteEarly.swap(temp);
127  if(temp.size() != vBranchesToDeleteEarly.size()) {
128  std::vector<std::string> missingProducts;
129  std::set_difference(temp.begin(),temp.end(),
130  vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),
131  std::back_inserter(missingProducts));
132  LogInfo l("MissingProductsForCanDeleteEarly");
133  l<<"The following products in the 'canDeleteEarly' list are not available in this job and will be ignored.";
134  for(auto const& n:missingProducts){
135  l<<"\n "<<n;
136  }
137  }
138  //set placeholder for the branch, we will remove the nullptr if a
139  // module actually wants the branch.
140  for(auto const& branch:vBranchesToDeleteEarly) {
141  branchToReadingWorker.insert(std::make_pair(branch, static_cast<Worker*>(nullptr)));
142  }
143  }
144  }
145 
146  void
147  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  std::string const& theInstanceAlias(instanceAlias == star ? productInstanceName : instanceAlias);
172  BranchKey aliasKey(friendlyClassName, alias, theInstanceAlias, processName);
173  if(preg.productList().find(aliasKey) != preg.productList().end()) {
174  throw Exception(errors::Configuration, "EDAlias conflicts with data\n")
175  << "A product of type '" << friendlyClassName << "'\n"
176  << "with module label '" << alias << "' and instance name '" << theInstanceAlias << "'\n"
177  << "already exists.\n";
178  }
179  auto iter = aliasKeys.find(aliasKey);
180  if(iter != aliasKeys.end()) {
181  // The alias matches a previous one. If the same alias is used for different product, throw.
182  if(iter->second != key) {
183  throw Exception(errors::Configuration, "EDAlias conflict\n")
184  << "The module label alias '" << alias << "' and product instance alias '" << theInstanceAlias << "'\n"
185  << "are used for multiple products of type '" << friendlyClassName << "'\n"
186  << "One has module label '" << moduleLabel << "' and product instance name '" << productInstanceName << "',\n"
187  << "the other has module label '" << iter->second.moduleLabel_ << "' and product instance name '" << iter->second.productInstanceName_ << "'.\n";
188  }
189  } else {
190  auto prodIter = preg.productList().find(key);
191  if(prodIter != preg.productList().end()) {
192  if (!prodIter->second.produced()) {
193  throw Exception(errors::Configuration, "EDAlias\n")
194  << "The module label alias '" << alias << "' and product instance alias '" << theInstanceAlias << "'\n"
195  << "are used for a product of type '" << friendlyClassName << "'\n"
196  << "with module label '" << moduleLabel << "' and product instance name '" << productInstanceName << "',\n"
197  << "An EDAlias can only be used for products produced in the current process. This one is not.\n";
198  }
199  aliasMap.insert(std::make_pair(key, aliasKey));
200  aliasKeys.insert(std::make_pair(aliasKey, key));
201  }
202  }
203  }
204 
205  void
206  processEDAliases(ParameterSet const& proc_pset, std::string const& processName, ProductRegistry& preg) {
207  std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string> >("@all_aliases");
208  if(aliases.empty()) {
209  return;
210  }
211  std::string const star("*");
212  std::string const empty("");
214  desc.add<std::string>("type");
215  desc.add<std::string>("fromProductInstance", star);
216  desc.add<std::string>("toProductInstance", star);
217 
218  std::multimap<BranchKey, BranchKey> aliasMap;
219 
220  std::map<BranchKey, BranchKey> aliasKeys; // Used to search for duplicates or clashes.
221 
222  // Now, loop over the alias information and store it in aliasMap.
223  for(std::string const& alias : aliases) {
224  ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
225  std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<VParameterSet>();
226  for(std::string const& moduleLabel : vPSetNames) {
227  VParameterSet vPSet = aliasPSet.getParameter<VParameterSet>(moduleLabel);
228  for(ParameterSet& pset : vPSet) {
229  desc.validate(pset);
230  std::string friendlyClassName = pset.getParameter<std::string>("type");
231  std::string productInstanceName = pset.getParameter<std::string>("fromProductInstance");
232  std::string instanceAlias = pset.getParameter<std::string>("toProductInstance");
233  if(productInstanceName == star) {
234  bool match = false;
235  BranchKey lowerBound(friendlyClassName, moduleLabel, empty, empty);
236  for(ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
237  it != preg.productList().end() && it->first.friendlyClassName_ == friendlyClassName && it->first.moduleLabel_ == moduleLabel;
238  ++it) {
239  if(it->first.processName_ != processName) {
240  continue;
241  }
242  match = true;
243 
244  checkAndInsertAlias(friendlyClassName, moduleLabel, it->first.productInstanceName_, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
245  }
246  if(!match) {
247  // No product was found matching the alias.
248  // We throw an exception only if a module with the specified module label was created in this process.
249  for(auto const& product : preg.productList()) {
250  if(moduleLabel == product.first.moduleLabel_ && processName == product.first.processName_) {
251  throw Exception(errors::Configuration, "EDAlias parameter set mismatch\n")
252  << "There are no products of type '" << friendlyClassName << "'\n"
253  << "with module label '" << moduleLabel << "'.\n";
254  }
255  }
256  }
257  } else {
258  checkAndInsertAlias(friendlyClassName, moduleLabel, productInstanceName, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
259  }
260  }
261  }
262  }
263 
264 
265  // Now add the new alias entries to the product registry.
266  for(auto const& aliasEntry : aliasMap) {
267  ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
268  assert(it != preg.productList().end());
269  preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel_, aliasEntry.second.productInstanceName_);
270  }
271 
272  }
273  }
274 
275  // -----------------------------
276 
277  typedef std::vector<std::string> vstring;
278 
279  // -----------------------------
280 
283  ProductRegistry& preg,
284  BranchIDListHelper& branchIDListHelper,
285  ActionTable const& actions,
286  boost::shared_ptr<ActivityRegistry> areg,
287  boost::shared_ptr<ProcessConfiguration> processConfiguration,
288  const ParameterSet* subProcPSet) :
289  worker_reg_(areg),
290  act_table_(&actions),
291  actReg_(areg),
292  state_(Ready),
293  trig_name_list_(tns.getTrigPaths()),
294  end_path_name_list_(tns.getEndPaths()),
295  results_(new HLTGlobalStatus(trig_name_list_.size())),
296  endpath_results_(), // delay!
297  results_inserter_(),
298  all_workers_(),
299  all_output_workers_(),
300  trig_paths_(),
301  end_paths_(),
302  wantSummary_(tns.wantSummary()),
303  total_events_(),
304  total_passed_(),
305  stopwatch_(wantSummary_? new RunStopwatch::StopwatchPointer::element_type : static_cast<RunStopwatch::StopwatchPointer::element_type*> (nullptr)),
306  unscheduled_(new UnscheduledCallProducer),
307  endpathsAreActive_(true) {
308 
309  ParameterSet const& opts = proc_pset.getUntrackedParameterSet("options", ParameterSet());
310  bool hasPath = false;
311 
312  int trig_bitpos = 0;
313  vstring labelsOnTriggerPaths;
314  for (vstring::const_iterator i = trig_name_list_.begin(),
315  e = trig_name_list_.end();
316  i != e;
317  ++i) {
318  fillTrigPath(proc_pset, preg, processConfiguration, trig_bitpos, *i, results_, &labelsOnTriggerPaths);
319  ++trig_bitpos;
320  hasPath = true;
321  }
322 
323  if (hasPath) {
324  // the results inserter stands alone
325  results_inserter_ = makeInserter(proc_pset,
326  preg,
327  actions, actReg_, processConfiguration, results_);
329  }
330 
332  endpath_results_ = epptr;
333 
334  // fill normal endpaths
335  vstring::iterator eib(end_path_name_list_.begin()), eie(end_path_name_list_.end());
336  for (int bitpos = 0; eib != eie; ++eib, ++bitpos) {
337  fillEndPath(proc_pset, preg, processConfiguration, bitpos, *eib);
338  }
339 
340  //See if all modules were used
341  std::set<std::string> usedWorkerLabels;
342  for (AllWorkers::iterator itWorker = workersBegin();
343  itWorker != workersEnd();
344  ++itWorker) {
345  usedWorkerLabels.insert((*itWorker)->description().moduleLabel());
346  }
347  std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >("@all_modules"));
348  std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
349  std::vector<std::string> unusedLabels;
350  set_difference(modulesInConfigSet.begin(), modulesInConfigSet.end(),
351  usedWorkerLabels.begin(), usedWorkerLabels.end(),
352  back_inserter(unusedLabels));
353  //does the configuration say we should allow on demand?
354  bool allowUnscheduled = opts.getUntrackedParameter<bool>("allowUnscheduled", false);
355  std::set<std::string> unscheduledLabels;
356  std::vector<std::string> shouldBeUsedLabels;
357  if (!unusedLabels.empty()) {
358  //Need to
359  // 1) create worker
360  // 2) if it is a WorkerT<EDProducer>, add it to our list
361  // 3) hand list to our delayed reader
362 
363  for (std::vector<std::string>::iterator itLabel = unusedLabels.begin(), itLabelEnd = unusedLabels.end();
364  itLabel != itLabelEnd;
365  ++itLabel) {
366  if (allowUnscheduled) {
367  bool isTracked;
368  ParameterSet* modulePSet(proc_pset.getPSetForUpdate(*itLabel, isTracked));
369  assert(isTracked);
370  assert(modulePSet != 0);
371  WorkerParams params(proc_pset, modulePSet, preg,
372  processConfiguration, *act_table_);
373  Worker* newWorker(worker_reg_.getWorker(params, *itLabel));
374  if (newWorker->moduleType() == Worker::kProducer ||
375  newWorker->moduleType() == Worker::kFilter) {
376  unscheduledLabels.insert(*itLabel);
377  unscheduled_->addWorker(newWorker);
378  //add to list so it gets reset each new event
379  addToAllWorkers(newWorker);
380  } else {
381  //not a producer so should be marked as not used
382  shouldBeUsedLabels.push_back(*itLabel);
383  }
384  } else {
385  //everthing is marked are unused so no 'on demand' allowed
386  shouldBeUsedLabels.push_back(*itLabel);
387  }
388  }
389  if (!shouldBeUsedLabels.empty()) {
390  std::ostringstream unusedStream;
391  unusedStream << "'" << shouldBeUsedLabels.front() << "'";
392  for (std::vector<std::string>::iterator itLabel = shouldBeUsedLabels.begin() + 1,
393  itLabelEnd = shouldBeUsedLabels.end();
394  itLabel != itLabelEnd;
395  ++itLabel) {
396  unusedStream << ",'" << *itLabel << "'";
397  }
398  LogInfo("path")
399  << "The following module labels are not assigned to any path:\n"
400  << unusedStream.str()
401  << "\n";
402  }
403  }
404  if (!unscheduledLabels.empty()) {
405  for (ProductRegistry::ProductList::const_iterator it = preg.productList().begin(),
406  itEnd = preg.productList().end();
407  it != itEnd;
408  ++it) {
409  if (it->second.produced() &&
410  it->second.branchType() == InEvent &&
411  unscheduledLabels.end() != unscheduledLabels.find(it->second.moduleLabel())) {
412  it->second.setOnDemand();
413  }
414  }
415  }
416 
417  std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
418  reduceParameterSet(proc_pset, modulesInConfig, modulesInConfigSet, labelsOnTriggerPaths, shouldBeUsedLabels, outputModulePathPositions);
419 
420  processEDAliases(proc_pset, processConfiguration->processName(), preg);
421 
422  proc_pset.registerIt();
423  pset::Registry::instance()->extra().setID(proc_pset.id());
424  processConfiguration->setParameterSetID(proc_pset.id());
425 
426  initializeEarlyDelete(opts,preg,subProcPSet);
427 
428  // This is used for a little sanity-check to make sure no code
429  // modifications alter the number of workers at a later date.
430  size_t all_workers_count = all_workers_.size();
431 
432  for (AllWorkers::iterator i = all_workers_.begin(), e = all_workers_.end();
433  i != e;
434  ++i) {
435 
436  // All the workers should be in all_workers_ by this point. Thus
437  // we can now fill all_output_workers_.
438  OutputWorker* ow = dynamic_cast<OutputWorker*>(*i);
439  if (ow) {
440  all_output_workers_.push_back(ow);
441  }
442  }
443  // Now that the output workers are filled in, set any output limits or information.
444  limitOutput(proc_pset, branchIDListHelper.branchIDLists());
445 
447 
448  preg.setFrozen();
449 
450  for (AllOutputWorkers::iterator i = all_output_workers_.begin(), e = all_output_workers_.end();
451  i != e; ++i) {
452  (*i)->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
453  (*i)->selectProducts(preg);
454  }
455 
456  // Sanity check: make sure nobody has added a worker after we've
457  // already relied on all_workers_ being full.
458  assert (all_workers_count == all_workers_.size());
459 
460  ProcessConfigurationRegistry::instance()->insertMapped(*processConfiguration);
461  branchIDListHelper.updateRegistries(preg);
462  fillProductRegistryTransients(*processConfiguration, preg);
463  } // Schedule::Schedule
464 
465 
467  edm::ParameterSet const* subProcPSet) {
468  //for now, if have a subProcess, don't allow early delete
469  // In the future we should use the SubProcess's 'keep list' to decide what can be kept
470  if(subProcPSet) return;
471 
472  //see if 'canDeleteEarly' was set and if so setup the list with those products actually
473  // registered for this job
474  std::multimap<std::string,Worker*> branchToReadingWorker;
475  initializeBranchToReadingWorker(opts,preg,branchToReadingWorker);
476 
477  //If no delete early items have been specified we don't have to do anything
478  if(branchToReadingWorker.size()==0) {
479  return;
480  }
481  const std::vector<std::string> kEmpty;
482  std::map<Worker*,unsigned int> reserveSizeForWorker;
483  unsigned int upperLimitOnReadingWorker =0;
484  unsigned int upperLimitOnIndicies = 0;
485  unsigned int nUniqueBranchesToDelete=branchToReadingWorker.size();
486  for (AllWorkers::iterator i = all_workers_.begin(), e = all_workers_.end();
487  i != e;
488  ++i) {
489  OutputWorker* ow = dynamic_cast<OutputWorker*>(*i);
490  if (ow) {
491  if(branchToReadingWorker.size()>0) {
492  //If an OutputModule needs a product, we can't delete it early
493  // so we should remove it from our list
494  SelectionsArray const&kept = ow->keptProducts();
495  for( auto const& item: kept[InEvent]) {
496  auto found = branchToReadingWorker.equal_range(item->branchName());
497  if(found.first !=found.second) {
498  --nUniqueBranchesToDelete;
499  branchToReadingWorker.erase(found.first,found.second);
500  }
501  }
502  }
503  } else {
504  if(branchToReadingWorker.size()>0) {
505  //determine if this module could read a branch we want to delete early
506  auto pset = pset::Registry::instance()->getMapped((*i)->description().parameterSetID());
507  if(0!=pset) {
508  auto branches = pset->getUntrackedParameter<std::vector<std::string>>("mightGet",kEmpty);
509  if(not branches.empty()) {
510  ++upperLimitOnReadingWorker;
511  }
512  for(auto const& branch:branches){
513  auto found = branchToReadingWorker.equal_range(branch);
514  if(found.first != found.second) {
515  ++upperLimitOnIndicies;
516  ++reserveSizeForWorker[*i];
517  if(nullptr == found.first->second) {
518  found.first->second = *i;
519  } else {
520  branchToReadingWorker.insert(make_pair(found.first->first,*i));
521  }
522  }
523  }
524  }
525  }
526  }
527  }
528  {
529  auto it = branchToReadingWorker.begin();
530  std::vector<std::string> unusedBranches;
531  while(it !=branchToReadingWorker.end()) {
532  if(it->second == nullptr) {
533  unusedBranches.push_back(it->first);
534  //erasing the object invalidates the iterator so must advance it first
535  auto temp = it;
536  ++it;
537  branchToReadingWorker.erase(temp);
538  } else {
539  ++it;
540  }
541  }
542  if(not unusedBranches.empty()) {
543  LogWarning l("UnusedProductsForCanDeleteEarly");
544  l<<"The following products in the 'canDeleteEarly' list are not used in this job and will be ignored.\n"
545  " If possible, remove the producer from the job or add the product to the producer's own 'mightGet' list.";
546  for(auto const& n:unusedBranches){
547  l<<"\n "<<n;
548  }
549  }
550  }
551  if(0!=branchToReadingWorker.size()) {
552  earlyDeleteHelpers_.reserve(upperLimitOnReadingWorker);
553  earlyDeleteHelperToBranchIndicies_.resize(upperLimitOnIndicies,0);
554  earlyDeleteBranchToCount_.reserve(nUniqueBranchesToDelete);
555  std::map<const Worker*,EarlyDeleteHelper*> alreadySeenWorkers;
556  std::string lastBranchName;
557  size_t nextOpenIndex = 0;
558  unsigned int* beginAddress = &(earlyDeleteHelperToBranchIndicies_.front());
559  for(auto& branchAndWorker:branchToReadingWorker) {
560  if(lastBranchName != branchAndWorker.first) {
561  //have to put back the period we removed earlier in order to get the proper name
562  BranchID bid(branchAndWorker.first+".");
563  earlyDeleteBranchToCount_.emplace_back(std::make_pair(bid,0U));
564  lastBranchName = branchAndWorker.first;
565  }
566  auto found = alreadySeenWorkers.find(branchAndWorker.second);
567  if(alreadySeenWorkers.end() == found) {
568  //NOTE: we will set aside enough space in earlyDeleteHelperToBranchIndicies_ to accommodate
569  // all the branches that might be read by this worker. However, initially we will only tell the
570  // EarlyDeleteHelper about the first one. As additional branches are added via 'appendIndex' the
571  // EarlyDeleteHelper will automatically advance its internal end pointer.
572  size_t index = nextOpenIndex;
573  size_t nIndices = reserveSizeForWorker[branchAndWorker.second];
575  earlyDeleteHelpers_.emplace_back(EarlyDeleteHelper(beginAddress+index,
576  beginAddress+index+1,
578  branchAndWorker.second->setEarlyDeleteHelper(&(earlyDeleteHelpers_.back()));
579  alreadySeenWorkers.insert(std::make_pair(branchAndWorker.second,&(earlyDeleteHelpers_.back())));
580  nextOpenIndex +=nIndices;
581  } else {
582  found->second->appendIndex(earlyDeleteBranchToCount_.size()-1);
583  }
584  }
585 
586  //Now we can compactify the earlyDeleteHelperToBranchIndicies_ since we may have over estimated the
587  // space needed for each module
588  auto itLast = earlyDeleteHelpers_.begin();
589  for(auto it = earlyDeleteHelpers_.begin()+1;it != earlyDeleteHelpers_.end();++it) {
590  if(itLast->end() != it->begin()) {
591  //figure the offset for next Worker since it hasn't been moved yet so it has the original address
592  unsigned int delta = it->begin()- itLast->end();
593  it->shiftIndexPointers(delta);
594 
596  (itLast->end()-beginAddress),
598  (it->begin()-beginAddress));
599  }
600  itLast = it;
601  }
602  earlyDeleteHelperToBranchIndicies_.erase(earlyDeleteHelperToBranchIndicies_.begin()+(itLast->end()-beginAddress),
604 
605  //now tell the paths about the deleters
606  for(auto& p : trig_paths_) {
607  p.setEarlyDeleteHelpers(alreadySeenWorkers);
608  }
609  for(auto& p : end_paths_) {
610  p.setEarlyDeleteHelpers(alreadySeenWorkers);
611  }
613  }
614  }
615 
617  vstring& modulesInConfig,
618  std::set<std::string> const& modulesInConfigSet,
619  vstring& labelsOnTriggerPaths,
620  vstring& shouldBeUsedLabels,
621  std::map<std::string, std::vector<std::pair<std::string, int> > >& outputModulePathPositions) {
622 
623  // Before calculating the ParameterSetID of the top level ParameterSet or
624  // saving it in the registry drop from the top level ParameterSet all
625  // OutputModules and EDAnalyzers not on trigger paths. If unscheduled
626  // production is not enabled also drop all the EDFilters and EDProducers
627  // that are not scheduled. Drop the ParameterSet used to configure the module
628  // itself. Also drop the other traces of these labels in the top level
629  // ParameterSet: Remove that labels from @all_modules and from all the
630  // end paths. If this makes any end paths empty, then remove the end path
631  // name from @end_paths, and @paths.
632 
633  // First make a list of labels to drop
634  vstring labelsToBeDropped;
635  vstring outputModuleLabels;
636  std::string edmType;
637  std::string const moduleEdmType("@module_edm_type");
638  std::string const outputModule("OutputModule");
639  std::string const edAnalyzer("EDAnalyzer");
640  std::string const edFilter("EDFilter");
641  std::string const edProducer("EDProducer");
642  sort_all(labelsOnTriggerPaths);
643  vstring::const_iterator iLabelsOnTriggerPaths = labelsOnTriggerPaths.begin();
644  vstring::const_iterator endLabelsOnTriggerPaths = labelsOnTriggerPaths.end();
645  sort_all(shouldBeUsedLabels);
646  vstring::const_iterator iShouldBeUsedLabels = shouldBeUsedLabels.begin();
647  vstring::const_iterator endShouldBeUsedLabels = shouldBeUsedLabels.end();
648 
649  for (std::set<std::string>::const_iterator i = modulesInConfigSet.begin(),
650  e = modulesInConfigSet.end(); i != e; ++i) {
651  edmType = proc_pset.getParameterSet(*i).getParameter<std::string>(moduleEdmType);
652  if (edmType == outputModule) {
653  labelsToBeDropped.push_back(*i);
654  outputModuleLabels.push_back(*i);
655  }
656  else if (edmType == edAnalyzer) {
657  while (iLabelsOnTriggerPaths != endLabelsOnTriggerPaths &&
658  *iLabelsOnTriggerPaths < *i) {
659  ++iLabelsOnTriggerPaths;
660  }
661  if (iLabelsOnTriggerPaths == endLabelsOnTriggerPaths ||
662  *iLabelsOnTriggerPaths != *i) {
663  labelsToBeDropped.push_back(*i);
664  }
665  }
666  else if (edmType == edFilter || edmType == edProducer) {
667  while (iShouldBeUsedLabels != endShouldBeUsedLabels &&
668  *iShouldBeUsedLabels < *i) {
669  ++iShouldBeUsedLabels;
670  }
671  if (iShouldBeUsedLabels != endShouldBeUsedLabels &&
672  *iShouldBeUsedLabels == *i) {
673  labelsToBeDropped.push_back(*i);
674  }
675  }
676  }
677 
678  // drop the parameter sets used to configure the modules
679  for_all(labelsToBeDropped, boost::bind(&ParameterSet::eraseOrSetUntrackedParameterSet, boost::ref(proc_pset), _1));
680 
681  // drop the labels from @all_modules
682  vstring::iterator endAfterRemove = std::remove_if(modulesInConfig.begin(), modulesInConfig.end(), boost::bind(binary_search_string, boost::ref(labelsToBeDropped), _1));
683  modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
684  proc_pset.addParameter<vstring>(std::string("@all_modules"), modulesInConfig);
685 
686  // drop the labels from all end paths
687  vstring endPathsToBeDropped;
688  vstring labels;
689  for (vstring::iterator iEndPath = end_path_name_list_.begin(), endEndPath = end_path_name_list_.end();
690  iEndPath != endEndPath;
691  ++iEndPath) {
692  labels = proc_pset.getParameter<vstring>(*iEndPath);
693  vstring::iterator iSave = labels.begin();
694  vstring::iterator iBegin = labels.begin();
695 
696  for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end();
697  iLabel != iEnd; ++iLabel) {
698  if (binary_search_string(labelsToBeDropped, *iLabel)) {
699  if (binary_search_string(outputModuleLabels, *iLabel)) {
700  outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
701  }
702  } else {
703  if (iSave != iLabel) {
704  iSave->swap(*iLabel);
705  }
706  ++iSave;
707  }
708  }
709  labels.erase(iSave, labels.end());
710  if (labels.empty()) {
711  // remove empty end paths and save their names
712  proc_pset.eraseSimpleParameter(*iEndPath);
713  endPathsToBeDropped.push_back(*iEndPath);
714  } else {
715  proc_pset.addParameter<vstring>(*iEndPath, labels);
716  }
717  }
718  sort_all(endPathsToBeDropped);
719 
720  // remove empty end paths from @paths
721  vstring scheduledPaths = proc_pset.getParameter<vstring>("@paths");
722  endAfterRemove = std::remove_if(scheduledPaths.begin(), scheduledPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
723  scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
724  proc_pset.addParameter<vstring>(std::string("@paths"), scheduledPaths);
725 
726  // remove empty end paths from @end_paths
727  vstring scheduledEndPaths = proc_pset.getParameter<vstring>("@end_paths");
728  endAfterRemove = std::remove_if(scheduledEndPaths.begin(), scheduledEndPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
729  scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
730  proc_pset.addParameter<vstring>(std::string("@end_paths"), scheduledEndPaths);
731  }
732 
733  void
734  Schedule::limitOutput(ParameterSet const& proc_pset, BranchIDLists const& branchIDLists) {
735  std::string const output("output");
736 
737  ParameterSet const& maxEventsPSet = proc_pset.getUntrackedParameterSet("maxEvents", ParameterSet());
738  int maxEventSpecs = 0;
739  int maxEventsOut = -1;
740  ParameterSet const* vMaxEventsOut = 0;
741  std::vector<std::string> intNamesE = maxEventsPSet.getParameterNamesForType<int>(false);
742  if (search_all(intNamesE, output)) {
743  maxEventsOut = maxEventsPSet.getUntrackedParameter<int>(output);
744  ++maxEventSpecs;
745  }
746  std::vector<std::string> psetNamesE;
747  maxEventsPSet.getParameterSetNames(psetNamesE, false);
748  if (search_all(psetNamesE, output)) {
749  vMaxEventsOut = &maxEventsPSet.getUntrackedParameterSet(output);
750  ++maxEventSpecs;
751  }
752 
753  if (maxEventSpecs > 1) {
755  "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
756  }
757 
758  for (AllOutputWorkers::const_iterator it = all_output_workers_.begin(), itEnd = all_output_workers_.end();
759  it != itEnd; ++it) {
760  OutputModuleDescription desc(branchIDLists, maxEventsOut);
761  if (vMaxEventsOut != 0 && !vMaxEventsOut->empty()) {
762  std::string moduleLabel = (*it)->description().moduleLabel();
763  try {
764  desc.maxEvents_ = vMaxEventsOut->getUntrackedParameter<int>(moduleLabel);
765  } catch (Exception const&) {
767  "\nNo entry in 'maxEvents' for output module label '" << moduleLabel << "'.\n";
768  }
769  }
770  (*it)->configure(desc);
771  }
772  }
773 
774  bool Schedule::terminate() const {
775  if (all_output_workers_.empty()) {
776  return false;
777  }
778  for (AllOutputWorkers::const_iterator it = all_output_workers_.begin(),
779  itEnd = all_output_workers_.end();
780  it != itEnd; ++it) {
781  if (!(*it)->limitReached()) {
782  // Found an output module that has not reached output event count.
783  return false;
784  }
785  }
786  LogInfo("SuccessfulTermination")
787  << "The job is terminating successfully because each output module\n"
788  << "has reached its configured limit.\n";
789  return true;
790  }
791 
793  ProductRegistry& preg,
794  boost::shared_ptr<ProcessConfiguration const> processConfiguration,
795  std::string const& name,
796  bool ignoreFilters,
797  PathWorkers& out,
798  vstring* labelsOnPaths) {
799  vstring modnames = proc_pset.getParameter<vstring>(name);
800  vstring::iterator it(modnames.begin()), ie(modnames.end());
801  PathWorkers tmpworkers;
802 
803  for (; it != ie; ++it) {
804 
805  if (labelsOnPaths) labelsOnPaths->push_back(*it);
806 
808  if ((*it)[0] == '!') filterAction = WorkerInPath::Veto;
809  else if ((*it)[0] == '-') filterAction = WorkerInPath::Ignore;
810 
811  std::string moduleLabel = *it;
812  if (filterAction != WorkerInPath::Normal) moduleLabel.erase(0, 1);
813 
814  bool isTracked;
815  ParameterSet* modpset = proc_pset.getPSetForUpdate(moduleLabel, isTracked);
816  if (modpset == 0) {
817  std::string pathType("endpath");
818  if (!search_all(end_path_name_list_, name)) {
819  pathType = std::string("path");
820  }
822  "The unknown module label \"" << moduleLabel <<
823  "\" appears in " << pathType << " \"" << name <<
824  "\"\n please check spelling or remove that label from the path.";
825  }
826  assert(isTracked);
827 
828  WorkerParams params(proc_pset, modpset, preg, processConfiguration, *act_table_);
829  Worker* worker = worker_reg_.getWorker(params, moduleLabel);
830  if (ignoreFilters && filterAction != WorkerInPath::Ignore && worker->moduleType()==Worker::kFilter) {
831  // We have a filter on an end path, and the filter is not explicitly ignored.
832  // See if the filter is allowed.
833  std::vector<std::string> allowed_filters = proc_pset.getUntrackedParameter<vstring>("@filters_on_endpaths");
834  if (!search_all(allowed_filters, worker->description().moduleName())) {
835  // Filter is not allowed. Ignore the result, and issue a warning.
836  filterAction = WorkerInPath::Ignore;
837  LogWarning("FilterOnEndPath")
838  << "The EDFilter '" << worker->description().moduleName() << "' with module label '" << moduleLabel << "' appears on EndPath '" << name << "'.\n"
839  << "The return value of the filter will be ignored.\n"
840  << "To suppress this warning, either remove the filter from the endpath,\n"
841  << "or explicitly ignore it in the configuration by using cms.ignore().\n";
842  }
843  }
844  tmpworkers.emplace_back(worker, filterAction);
845  }
846 
847  out.swap(tmpworkers);
848  }
849 
851  ProductRegistry& preg,
852  boost::shared_ptr<ProcessConfiguration const> processConfiguration,
853  int bitpos, std::string const& name, TrigResPtr trptr,
854  vstring* labelsOnTriggerPaths) {
855  PathWorkers tmpworkers;
856  Workers holder;
857  fillWorkers(proc_pset, preg, processConfiguration, name, false, tmpworkers, labelsOnTriggerPaths);
858 
859  for (PathWorkers::iterator wi(tmpworkers.begin()),
860  we(tmpworkers.end()); wi != we; ++wi) {
861  holder.push_back(wi->getWorker());
862  }
863 
864  // an empty path will cause an extra bit that is not used
865  if (!tmpworkers.empty()) {
866  Path p(bitpos, name, tmpworkers, trptr, *act_table_, actReg_, false);
867  if (wantSummary_) {
868  p.useStopwatch();
869  }
870  trig_paths_.push_back(p);
871  } else {
872  empty_trig_paths_.push_back(bitpos);
873  empty_trig_path_names_.push_back(name);
874  }
875  for_all(holder, boost::bind(&Schedule::addToAllWorkers, this, _1));
876  }
877 
879  ProductRegistry& preg,
880  boost::shared_ptr<ProcessConfiguration const> processConfiguration,
881  int bitpos, std::string const& name) {
882  PathWorkers tmpworkers;
883  fillWorkers(proc_pset, preg, processConfiguration, name, true, tmpworkers, 0);
884  Workers holder;
885 
886  for (PathWorkers::iterator wi(tmpworkers.begin()), we(tmpworkers.end()); wi != we; ++wi) {
887  holder.push_back(wi->getWorker());
888  }
889 
890  if (!tmpworkers.empty()) {
891  Path p(bitpos, name, tmpworkers, endpath_results_, *act_table_, actReg_, true);
892  if (wantSummary_) {
893  p.useStopwatch();
894  }
895  end_paths_.push_back(p);
896  }
897  for_all(holder, boost::bind(&Schedule::addToAllWorkers, this, _1));
898  }
899 
901  bool failure = false;
902  AllWorkers::iterator ai(workersBegin()), ae(workersEnd());
903  for (; ai != ae; ++ai) {
904  try {
905  try {
906  (*ai)->endJob();
907  }
908  catch (cms::Exception& e) { throw; }
909  catch (std::bad_alloc& bda) { convertException::badAllocToEDM(); }
910  catch (std::exception& e) { convertException::stdToEDM(e); }
911  catch (std::string& s) { convertException::stringToEDM(s); }
912  catch (char const* c) { convertException::charPtrToEDM(c); }
913  catch (...) { convertException::unknownToEDM(); }
914  }
915  catch (cms::Exception const& ex) {
916  collector.addException(ex);
917  failure = true;
918  }
919  }
920  if (failure) {
921  return;
922  }
923 
924  if (wantSummary_ == false) return;
925 
926  TrigPaths::const_iterator pi, pe;
927 
928  // The trigger report (pass/fail etc.):
929 
930  LogVerbatim("FwkSummary") << "";
931  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Event Summary ------------";
932  if(!trig_paths_.empty()) {
933  LogVerbatim("FwkSummary") << "TrigReport"
934  << " Events total = " << totalEvents()
935  << " passed = " << totalEventsPassed()
936  << " failed = " << (totalEventsFailed())
937  << "";
938  } else {
939  LogVerbatim("FwkSummary") << "TrigReport"
940  << " Events total = " << totalEvents()
941  << " passed = " << totalEvents()
942  << " failed = 0";
943  }
944 
945  LogVerbatim("FwkSummary") << "";
946  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Path Summary ------------";
947  LogVerbatim("FwkSummary") << "TrigReport "
948  << std::right << std::setw(10) << "Trig Bit#" << " "
949  << std::right << std::setw(10) << "Run" << " "
950  << std::right << std::setw(10) << "Passed" << " "
951  << std::right << std::setw(10) << "Failed" << " "
952  << std::right << std::setw(10) << "Error" << " "
953  << "Name" << "";
954  pi = trig_paths_.begin();
955  pe = trig_paths_.end();
956  for (; pi != pe; ++pi) {
957  LogVerbatim("FwkSummary") << "TrigReport "
958  << std::right << std::setw(5) << 1
959  << std::right << std::setw(5) << pi->bitPosition() << " "
960  << std::right << std::setw(10) << pi->timesRun() << " "
961  << std::right << std::setw(10) << pi->timesPassed() << " "
962  << std::right << std::setw(10) << pi->timesFailed() << " "
963  << std::right << std::setw(10) << pi->timesExcept() << " "
964  << pi->name() << "";
965  }
966 
967  std::vector<int>::const_iterator epi = empty_trig_paths_.begin();
968  std::vector<int>::const_iterator epe = empty_trig_paths_.end();
969  std::vector<std::string>::const_iterator epn = empty_trig_path_names_.begin();
970  for (; epi != epe; ++epi, ++epn) {
971 
972  LogVerbatim("FwkSummary") << "TrigReport "
973  << std::right << std::setw(5) << 1
974  << std::right << std::setw(5) << *epi << " "
975  << std::right << std::setw(10) << totalEvents() << " "
976  << std::right << std::setw(10) << totalEvents() << " "
977  << std::right << std::setw(10) << 0 << " "
978  << std::right << std::setw(10) << 0 << " "
979  << *epn << "";
980  }
981 
982  LogVerbatim("FwkSummary") << "";
983  LogVerbatim("FwkSummary") << "TrigReport " << "-------End-Path Summary ------------";
984  LogVerbatim("FwkSummary") << "TrigReport "
985  << std::right << std::setw(10) << "Trig Bit#" << " "
986  << std::right << std::setw(10) << "Run" << " "
987  << std::right << std::setw(10) << "Passed" << " "
988  << std::right << std::setw(10) << "Failed" << " "
989  << std::right << std::setw(10) << "Error" << " "
990  << "Name" << "";
991  pi = end_paths_.begin();
992  pe = end_paths_.end();
993  for (; pi != pe; ++pi) {
994  LogVerbatim("FwkSummary") << "TrigReport "
995  << std::right << std::setw(5) << 0
996  << std::right << std::setw(5) << pi->bitPosition() << " "
997  << std::right << std::setw(10) << pi->timesRun() << " "
998  << std::right << std::setw(10) << pi->timesPassed() << " "
999  << std::right << std::setw(10) << pi->timesFailed() << " "
1000  << std::right << std::setw(10) << pi->timesExcept() << " "
1001  << pi->name() << "";
1002  }
1003 
1004  pi = trig_paths_.begin();
1005  pe = trig_paths_.end();
1006  for (; pi != pe; ++pi) {
1007  LogVerbatim("FwkSummary") << "";
1008  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Modules in Path: " << pi->name() << " ------------";
1009  LogVerbatim("FwkSummary") << "TrigReport "
1010  << std::right << std::setw(10) << "Trig Bit#" << " "
1011  << std::right << std::setw(10) << "Visited" << " "
1012  << std::right << std::setw(10) << "Passed" << " "
1013  << std::right << std::setw(10) << "Failed" << " "
1014  << std::right << std::setw(10) << "Error" << " "
1015  << "Name" << "";
1016 
1017  for (unsigned int i = 0; i < pi->size(); ++i) {
1018  LogVerbatim("FwkSummary") << "TrigReport "
1019  << std::right << std::setw(5) << 1
1020  << std::right << std::setw(5) << pi->bitPosition() << " "
1021  << std::right << std::setw(10) << pi->timesVisited(i) << " "
1022  << std::right << std::setw(10) << pi->timesPassed(i) << " "
1023  << std::right << std::setw(10) << pi->timesFailed(i) << " "
1024  << std::right << std::setw(10) << pi->timesExcept(i) << " "
1025  << pi->getWorker(i)->description().moduleLabel() << "";
1026  }
1027  }
1028 
1029  pi = end_paths_.begin();
1030  pe = end_paths_.end();
1031  for (; pi != pe; ++pi) {
1032  LogVerbatim("FwkSummary") << "";
1033  LogVerbatim("FwkSummary") << "TrigReport " << "------ Modules in End-Path: " << pi->name() << " ------------";
1034  LogVerbatim("FwkSummary") << "TrigReport "
1035  << std::right << std::setw(10) << "Trig Bit#" << " "
1036  << std::right << std::setw(10) << "Visited" << " "
1037  << std::right << std::setw(10) << "Passed" << " "
1038  << std::right << std::setw(10) << "Failed" << " "
1039  << std::right << std::setw(10) << "Error" << " "
1040  << "Name" << "";
1041 
1042  for (unsigned int i = 0; i < pi->size(); ++i) {
1043  LogVerbatim("FwkSummary") << "TrigReport "
1044  << std::right << std::setw(5) << 0
1045  << std::right << std::setw(5) << pi->bitPosition() << " "
1046  << std::right << std::setw(10) << pi->timesVisited(i) << " "
1047  << std::right << std::setw(10) << pi->timesPassed(i) << " "
1048  << std::right << std::setw(10) << pi->timesFailed(i) << " "
1049  << std::right << std::setw(10) << pi->timesExcept(i) << " "
1050  << pi->getWorker(i)->description().moduleLabel() << "";
1051  }
1052  }
1053 
1054  LogVerbatim("FwkSummary") << "";
1055  LogVerbatim("FwkSummary") << "TrigReport " << "---------- Module Summary ------------";
1056  LogVerbatim("FwkSummary") << "TrigReport "
1057  << std::right << std::setw(10) << "Visited" << " "
1058  << std::right << std::setw(10) << "Run" << " "
1059  << std::right << std::setw(10) << "Passed" << " "
1060  << std::right << std::setw(10) << "Failed" << " "
1061  << std::right << std::setw(10) << "Error" << " "
1062  << "Name" << "";
1063  ai = workersBegin();
1064  ae = workersEnd();
1065  for (; ai != ae; ++ai) {
1066  LogVerbatim("FwkSummary") << "TrigReport "
1067  << std::right << std::setw(10) << (*ai)->timesVisited() << " "
1068  << std::right << std::setw(10) << (*ai)->timesRun() << " "
1069  << std::right << std::setw(10) << (*ai)->timesPassed() << " "
1070  << std::right << std::setw(10) << (*ai)->timesFailed() << " "
1071  << std::right << std::setw(10) << (*ai)->timesExcept() << " "
1072  << (*ai)->description().moduleLabel() << "";
1073 
1074  }
1075  LogVerbatim("FwkSummary") << "";
1076 
1077  // The timing report (CPU and Real Time):
1078 
1079  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Event Summary ---[sec]----";
1080  LogVerbatim("FwkSummary") << "TimeReport"
1081  << std::setprecision(6) << std::fixed
1082  << " CPU/event = " << timeCpuReal().first/std::max(1, totalEvents())
1083  << " Real/event = " << timeCpuReal().second/std::max(1, totalEvents())
1084  << "";
1085 
1086  LogVerbatim("FwkSummary") << "";
1087  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Path Summary ---[sec]----";
1088  LogVerbatim("FwkSummary") << "TimeReport "
1089  << std::right << std::setw(22) << "per event "
1090  << std::right << std::setw(22) << "per path-run "
1091  << "";
1092  LogVerbatim("FwkSummary") << "TimeReport "
1093  << std::right << std::setw(10) << "CPU" << " "
1094  << std::right << std::setw(10) << "Real" << " "
1095  << std::right << std::setw(10) << "CPU" << " "
1096  << std::right << std::setw(10) << "Real" << " "
1097  << "Name" << "";
1098  pi = trig_paths_.begin();
1099  pe = trig_paths_.end();
1100  for (; pi != pe; ++pi) {
1101  LogVerbatim("FwkSummary") << "TimeReport "
1102  << std::setprecision(6) << std::fixed
1103  << std::right << std::setw(10) << pi->timeCpuReal().first/std::max(1, totalEvents()) << " "
1104  << std::right << std::setw(10) << pi->timeCpuReal().second/std::max(1, totalEvents()) << " "
1105  << std::right << std::setw(10) << pi->timeCpuReal().first/std::max(1, pi->timesRun()) << " "
1106  << std::right << std::setw(10) << pi->timeCpuReal().second/std::max(1, pi->timesRun()) << " "
1107  << pi->name() << "";
1108  }
1109  LogVerbatim("FwkSummary") << "TimeReport "
1110  << std::right << std::setw(10) << "CPU" << " "
1111  << std::right << std::setw(10) << "Real" << " "
1112  << std::right << std::setw(10) << "CPU" << " "
1113  << std::right << std::setw(10) << "Real" << " "
1114  << "Name" << "";
1115  LogVerbatim("FwkSummary") << "TimeReport "
1116  << std::right << std::setw(22) << "per event "
1117  << std::right << std::setw(22) << "per path-run "
1118  << "";
1119 
1120  LogVerbatim("FwkSummary") << "";
1121  LogVerbatim("FwkSummary") << "TimeReport " << "-------End-Path Summary ---[sec]----";
1122  LogVerbatim("FwkSummary") << "TimeReport "
1123  << std::right << std::setw(22) << "per event "
1124  << std::right << std::setw(22) << "per endpath-run "
1125  << "";
1126  LogVerbatim("FwkSummary") << "TimeReport "
1127  << std::right << std::setw(10) << "CPU" << " "
1128  << std::right << std::setw(10) << "Real" << " "
1129  << std::right << std::setw(10) << "CPU" << " "
1130  << std::right << std::setw(10) << "Real" << " "
1131  << "Name" << "";
1132  pi = end_paths_.begin();
1133  pe = end_paths_.end();
1134  for (; pi != pe; ++pi) {
1135  LogVerbatim("FwkSummary") << "TimeReport "
1136  << std::setprecision(6) << std::fixed
1137  << std::right << std::setw(10) << pi->timeCpuReal().first/std::max(1, totalEvents()) << " "
1138  << std::right << std::setw(10) << pi->timeCpuReal().second/std::max(1, totalEvents()) << " "
1139  << std::right << std::setw(10) << pi->timeCpuReal().first/std::max(1, pi->timesRun()) << " "
1140  << std::right << std::setw(10) << pi->timeCpuReal().second/std::max(1, pi->timesRun()) << " "
1141  << pi->name() << "";
1142  }
1143  LogVerbatim("FwkSummary") << "TimeReport "
1144  << std::right << std::setw(10) << "CPU" << " "
1145  << std::right << std::setw(10) << "Real" << " "
1146  << std::right << std::setw(10) << "CPU" << " "
1147  << std::right << std::setw(10) << "Real" << " "
1148  << "Name" << "";
1149  LogVerbatim("FwkSummary") << "TimeReport "
1150  << std::right << std::setw(22) << "per event "
1151  << std::right << std::setw(22) << "per endpath-run "
1152  << "";
1153 
1154  pi = trig_paths_.begin();
1155  pe = trig_paths_.end();
1156  for (; pi != pe; ++pi) {
1157  LogVerbatim("FwkSummary") << "";
1158  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Modules in Path: " << pi->name() << " ---[sec]----";
1159  LogVerbatim("FwkSummary") << "TimeReport "
1160  << std::right << std::setw(22) << "per event "
1161  << std::right << std::setw(22) << "per module-visit "
1162  << "";
1163  LogVerbatim("FwkSummary") << "TimeReport "
1164  << std::right << std::setw(10) << "CPU" << " "
1165  << std::right << std::setw(10) << "Real" << " "
1166  << std::right << std::setw(10) << "CPU" << " "
1167  << std::right << std::setw(10) << "Real" << " "
1168  << "Name" << "";
1169  for (unsigned int i = 0; i < pi->size(); ++i) {
1170  LogVerbatim("FwkSummary") << "TimeReport "
1171  << std::setprecision(6) << std::fixed
1172  << std::right << std::setw(10) << pi->timeCpuReal(i).first/std::max(1, totalEvents()) << " "
1173  << std::right << std::setw(10) << pi->timeCpuReal(i).second/std::max(1, totalEvents()) << " "
1174  << std::right << std::setw(10) << pi->timeCpuReal(i).first/std::max(1, pi->timesVisited(i)) << " "
1175  << std::right << std::setw(10) << pi->timeCpuReal(i).second/std::max(1, pi->timesVisited(i)) << " "
1176  << pi->getWorker(i)->description().moduleLabel() << "";
1177  }
1178  }
1179  LogVerbatim("FwkSummary") << "TimeReport "
1180  << std::right << std::setw(10) << "CPU" << " "
1181  << std::right << std::setw(10) << "Real" << " "
1182  << std::right << std::setw(10) << "CPU" << " "
1183  << std::right << std::setw(10) << "Real" << " "
1184  << "Name" << "";
1185  LogVerbatim("FwkSummary") << "TimeReport "
1186  << std::right << std::setw(22) << "per event "
1187  << std::right << std::setw(22) << "per module-visit "
1188  << "";
1189 
1190  pi = end_paths_.begin();
1191  pe = end_paths_.end();
1192  for (; pi != pe; ++pi) {
1193  LogVerbatim("FwkSummary") << "";
1194  LogVerbatim("FwkSummary") << "TimeReport " << "------ Modules in End-Path: " << pi->name() << " ---[sec]----";
1195  LogVerbatim("FwkSummary") << "TimeReport "
1196  << std::right << std::setw(22) << "per event "
1197  << std::right << std::setw(22) << "per module-visit "
1198  << "";
1199  LogVerbatim("FwkSummary") << "TimeReport "
1200  << std::right << std::setw(10) << "CPU" << " "
1201  << std::right << std::setw(10) << "Real" << " "
1202  << std::right << std::setw(10) << "CPU" << " "
1203  << std::right << std::setw(10) << "Real" << " "
1204  << "Name" << "";
1205  for (unsigned int i = 0; i < pi->size(); ++i) {
1206  LogVerbatim("FwkSummary") << "TimeReport "
1207  << std::setprecision(6) << std::fixed
1208  << std::right << std::setw(10) << pi->timeCpuReal(i).first/std::max(1, totalEvents()) << " "
1209  << std::right << std::setw(10) << pi->timeCpuReal(i).second/std::max(1, totalEvents()) << " "
1210  << std::right << std::setw(10) << pi->timeCpuReal(i).first/std::max(1, pi->timesVisited(i)) << " "
1211  << std::right << std::setw(10) << pi->timeCpuReal(i).second/std::max(1, pi->timesVisited(i)) << " "
1212  << pi->getWorker(i)->description().moduleLabel() << "";
1213  }
1214  }
1215  LogVerbatim("FwkSummary") << "TimeReport "
1216  << std::right << std::setw(10) << "CPU" << " "
1217  << std::right << std::setw(10) << "Real" << " "
1218  << std::right << std::setw(10) << "CPU" << " "
1219  << std::right << std::setw(10) << "Real" << " "
1220  << "Name" << "";
1221  LogVerbatim("FwkSummary") << "TimeReport "
1222  << std::right << std::setw(22) << "per event "
1223  << std::right << std::setw(22) << "per module-visit "
1224  << "";
1225 
1226  LogVerbatim("FwkSummary") << "";
1227  LogVerbatim("FwkSummary") << "TimeReport " << "---------- Module Summary ---[sec]----";
1228  LogVerbatim("FwkSummary") << "TimeReport "
1229  << std::right << std::setw(22) << "per event "
1230  << std::right << std::setw(22) << "per module-run "
1231  << std::right << std::setw(22) << "per module-visit "
1232  << "";
1233  LogVerbatim("FwkSummary") << "TimeReport "
1234  << std::right << std::setw(10) << "CPU" << " "
1235  << std::right << std::setw(10) << "Real" << " "
1236  << std::right << std::setw(10) << "CPU" << " "
1237  << std::right << std::setw(10) << "Real" << " "
1238  << std::right << std::setw(10) << "CPU" << " "
1239  << std::right << std::setw(10) << "Real" << " "
1240  << "Name" << "";
1241  ai = workersBegin();
1242  ae = workersEnd();
1243  for (; ai != ae; ++ai) {
1244  LogVerbatim("FwkSummary") << "TimeReport "
1245  << std::setprecision(6) << std::fixed
1246  << std::right << std::setw(10) << (*ai)->timeCpuReal().first/std::max(1, totalEvents()) << " "
1247  << std::right << std::setw(10) << (*ai)->timeCpuReal().second/std::max(1, totalEvents()) << " "
1248  << std::right << std::setw(10) << (*ai)->timeCpuReal().first/std::max(1, (*ai)->timesRun()) << " "
1249  << std::right << std::setw(10) << (*ai)->timeCpuReal().second/std::max(1, (*ai)->timesRun()) << " "
1250  << std::right << std::setw(10) << (*ai)->timeCpuReal().first/std::max(1, (*ai)->timesVisited()) << " "
1251  << std::right << std::setw(10) << (*ai)->timeCpuReal().second/std::max(1, (*ai)->timesVisited()) << " "
1252  << (*ai)->description().moduleLabel() << "";
1253  }
1254  LogVerbatim("FwkSummary") << "TimeReport "
1255  << std::right << std::setw(10) << "CPU" << " "
1256  << std::right << std::setw(10) << "Real" << " "
1257  << std::right << std::setw(10) << "CPU" << " "
1258  << std::right << std::setw(10) << "Real" << " "
1259  << std::right << std::setw(10) << "CPU" << " "
1260  << std::right << std::setw(10) << "Real" << " "
1261  << "Name" << "";
1262  LogVerbatim("FwkSummary") << "TimeReport "
1263  << std::right << std::setw(22) << "per event "
1264  << std::right << std::setw(22) << "per module-run "
1265  << std::right << std::setw(22) << "per module-visit "
1266  << "";
1267 
1268  LogVerbatim("FwkSummary") << "";
1269  LogVerbatim("FwkSummary") << "T---Report end!" << "";
1270  LogVerbatim("FwkSummary") << "";
1271  }
1272 
1275  }
1276 
1279  }
1280 
1282  for_all(all_output_workers_, boost::bind(&OutputWorker::openFile, _1, boost::cref(fb)));
1283  }
1284 
1286  for_all(all_output_workers_, boost::bind(&OutputWorker::writeRun, _1, boost::cref(rp)));
1287  }
1288 
1290  for_all(all_output_workers_, boost::bind(&OutputWorker::writeLumi, _1, boost::cref(lbp)));
1291  }
1292 
1294  // Return true iff at least one output module returns true.
1295  return (std::find_if (all_output_workers_.begin(), all_output_workers_.end(),
1296  boost::bind(&OutputWorker::shouldWeCloseFile, _1))
1297  != all_output_workers_.end());
1298  }
1299 
1301  for_all(all_workers_, boost::bind(&Worker::respondToOpenInputFile, _1, boost::cref(fb)));
1302  }
1303 
1305  for_all(all_workers_, boost::bind(&Worker::respondToCloseInputFile, _1, boost::cref(fb)));
1306  }
1307 
1309  for_all(all_workers_, boost::bind(&Worker::respondToOpenOutputFiles, _1, boost::cref(fb)));
1310  }
1311 
1313  for_all(all_workers_, boost::bind(&Worker::respondToCloseOutputFiles, _1, boost::cref(fb)));
1314  }
1315 
1316  void Schedule::beginJob(ProductRegistry const& iRegistry) {
1317  auto const runLookup = iRegistry.productLookup(InRun);
1318  auto const lumiLookup = iRegistry.productLookup(InLumi);
1319  auto const eventLookup = iRegistry.productLookup(InEvent);
1320  for(auto & worker: all_workers_) {
1321  worker->updateLookup(InRun,*runLookup);
1322  worker->updateLookup(InLumi,*lumiLookup);
1323  worker->updateLookup(InEvent,*eventLookup);
1324  }
1325 
1326  for_all(all_workers_, boost::bind(&Worker::beginJob, _1));
1328  }
1329 
1332  }
1333  void Schedule::postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
1334  for_all(all_workers_, boost::bind(&Worker::postForkReacquireResources, _1, iChildIndex, iNumberOfChildren));
1335  }
1336 
1338  ParameterSet const& iPSet) {
1339  Worker* found = 0;
1340  for (AllWorkers::const_iterator it=all_workers_.begin(), itEnd=all_workers_.end();
1341  it != itEnd; ++it) {
1342  if ((*it)->description().moduleLabel() == iLabel) {
1343  found = *it;
1344  break;
1345  }
1346  }
1347  if (0 == found) {
1348  return false;
1349  }
1350 
1351  std::auto_ptr<Maker> wm(MakerPluginFactory::get()->create(found->description().moduleName()));
1352  wm->swapModule(found, iPSet);
1353  found->beginJob();
1354  return true;
1355  }
1356 
1357  std::vector<ModuleDescription const*>
1359  AllWorkers::const_iterator i(workersBegin());
1360  AllWorkers::const_iterator e(workersEnd());
1361 
1362  std::vector<ModuleDescription const*> result;
1363  result.reserve(all_workers_.size());
1364 
1365  for (; i != e; ++i) {
1366  ModuleDescription const* p = (*i)->descPtr();
1367  result.push_back(p);
1368  }
1369  return result;
1370  }
1371 
1372  void
1373  Schedule::availablePaths(std::vector<std::string>& oLabelsToFill) const {
1374  oLabelsToFill.reserve(trig_paths_.size());
1375  std::transform(trig_paths_.begin(),
1376  trig_paths_.end(),
1377  std::back_inserter(oLabelsToFill),
1378  boost::bind(&Path::name, _1));
1379  }
1380 
1381  void
1383  std::vector<std::string>& oLabelsToFill) const {
1384  TrigPaths::const_iterator itFound =
1385  std::find_if (trig_paths_.begin(),
1386  trig_paths_.end(),
1387  boost::bind(std::equal_to<std::string>(),
1388  iPathLabel,
1389  boost::bind(&Path::name, _1)));
1390  if (itFound!=trig_paths_.end()) {
1391  oLabelsToFill.reserve(itFound->size());
1392  for (size_t i = 0; i < itFound->size(); ++i) {
1393  oLabelsToFill.push_back(itFound->getWorker(i)->description().moduleLabel());
1394  }
1395  }
1396  }
1397 
1398  void
1400  endpathsAreActive_ = active;
1401  }
1402 
1403  bool
1405  return endpathsAreActive_;
1406  }
1407 
1408  void
1410  }
1411 
1412  void
1414  size_t which,
1415  ModuleInPathSummary& sum) {
1416  sum.timesVisited = path.timesVisited(which);
1417  sum.timesPassed = path.timesPassed(which);
1418  sum.timesFailed = path.timesFailed(which);
1419  sum.timesExcept = path.timesExcept(which);
1420  sum.moduleLabel = path.getWorker(which)->description().moduleLabel();
1421  }
1422 
1423  void
1425  sum.name = path.name();
1426  sum.bitPosition = path.bitPosition();
1427  sum.timesRun = path.timesRun();
1428  sum.timesPassed = path.timesPassed();
1429  sum.timesFailed = path.timesFailed();
1430  sum.timesExcept = path.timesExcept();
1431 
1432  Path::size_type sz = path.size();
1433  std::vector<ModuleInPathSummary> temp(sz);
1434  for (size_t i = 0; i != sz; ++i) {
1435  fillModuleInPathSummary(path, i, temp[i]);
1436  }
1437  sum.moduleInPathSummaries.swap(temp);
1438  }
1439 
1440  void
1442  sum.timesVisited = w.timesVisited();
1443  sum.timesRun = w.timesRun();
1444  sum.timesPassed = w.timesPassed();
1445  sum.timesFailed = w.timesFailed();
1446  sum.timesExcept = w.timesExcept();
1447  sum.moduleLabel = w.description().moduleLabel();
1448  }
1449 
1450  void
1452  fillWorkerSummaryAux(*pw, sum);
1453  }
1454 
1455  void
1460 
1461  fill_summary(trig_paths_, rep.trigPathSummaries, &fillPathSummary);
1462  fill_summary(end_paths_, rep.endPathSummaries, &fillPathSummary);
1463  fill_summary(all_workers_, rep.workerSummaries, &fillWorkerSummary);
1464  }
1465 
1466  void
1469  for_all(trig_paths_, boost::bind(&Path::clearCounters, _1));
1470  for_all(end_paths_, boost::bind(&Path::clearCounters, _1));
1471  for_all(all_workers_, boost::bind(&Worker::clearCounters, _1));
1472  }
1473 
1474  void
1476  for_all(all_workers_, boost::bind(&Worker::reset, _1));
1477  results_->reset();
1478  endpath_results_->reset();
1479  }
1480 
1481  void
1483  if (!search_all(all_workers_, w)) {
1484  if (wantSummary_) {
1485  w->useStopwatch();
1486  }
1487  all_workers_.push_back(w);
1488  }
1489  }
1490 
1491  void
1493  // NOTE: who owns the productdescrption? Just copied by value
1494  unscheduled_->setEventSetup(es);
1496  }
1497 
1498  void
1500  //must be sure we have cleared the count first
1501  for(auto& count:earlyDeleteBranchToCount_) {
1502  count.second = 0;
1503  }
1504  //now reset based on how many helpers use that branch
1506  ++(earlyDeleteBranchToCount_[index].second);
1507  }
1508  for(auto& helper: earlyDeleteHelpers_) {
1509  helper.reset();
1510  }
1511  }
1512 
1513 }
dbl * delta
Definition: mlp_gen.cc:36
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:219
std::vector< PathSummary > endPathSummaries
Definition: TriggerReport.h:65
void initializeEarlyDelete(edm::ParameterSet const &opts, edm::ProductRegistry const &preg, edm::ParameterSet const *subProcPSet)
Definition: Schedule.cc:466
T getUntrackedParameter(std::string const &, T const &) const
dictionary aliases
Definition: autoCond.py:22
int i
Definition: DBlmapReader.cc:9
string rep
Definition: cuy.py:1188
void addException(cms::Exception const &exception)
int timesRun() const
Definition: Path.h:73
std::pair< double, double > timeCpuReal() const
Definition: Schedule.h:169
void fillWorkerSummary(Worker const *pw, WorkerSummary &sum)
Definition: Schedule.cc:1451
int bitPosition() const
Definition: Path.h:57
ModuleDescription const & description() const
Definition: Worker.h:77
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
roAction_t actions[nactions]
Definition: GenABIO.cc:200
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: Schedule.cc:1373
void fillWorkerSummaryAux(Worker const &w, WorkerSummary &sum)
Definition: Schedule.cc:1441
AllOutputWorkers all_output_workers_
Definition: Schedule.h:305
WorkerPtr results_inserter_
Definition: Schedule.h:303
bool endPathsEnabled() const
Definition: Schedule.cc:1404
void respondToCloseInputFile(FileBlock const &fb)
Definition: Schedule.cc:1304
void resetEarlyDelete()
Definition: Schedule.cc:1499
std::vector< std::string > vstring
Definition: Schedule.cc:277
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet)
Definition: Schedule.cc:1337
void writeLumi(LuminosityBlockPrincipal const &lbp)
Definition: Schedule.cc:1289
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
Definition: Schedule.h:324
WorkerRegistry worker_reg_
Definition: Schedule.h:292
ParameterSetID id() const
WorkersInPath::size_type size_type
Definition: Path.h:44
static ThreadSafeRegistry * instance()
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
int timesPassed() const
Definition: Worker.h:104
std::vector< WorkerInPath > PathWorkers
Definition: Schedule.h:115
#define nullptr
TrigPaths trig_paths_
Definition: Schedule.h:306
void respondToOpenOutputFiles(FileBlock const &fb)
Definition: Worker.h:66
void enableEndPaths(bool active)
Definition: Schedule.cc:1399
void clearCounters()
Definition: Worker.h:96
std::string const & moduleName() const
bool getMapped(key_type const &k, value_type &result) const
TrigResPtr endpath_results_
Definition: Schedule.h:301
int timesExcept() const
Definition: Path.h:76
Schedule(ParameterSet &proc_pset, service::TriggerNamesService &tns, ProductRegistry &pregistry, BranchIDListHelper &branchIDListHelper, ActionTable const &actions, boost::shared_ptr< ActivityRegistry > areg, boost::shared_ptr< ProcessConfiguration > processConfiguration, const ParameterSet *subProcPSet)
Definition: Schedule.cc:281
size_type size() const
Definition: Path.h:80
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName, BranchDescription::MatchMode m)
std::vector< WorkerSummary > workerSummaries
Definition: TriggerReport.h:66
int total_passed_
Definition: Schedule.h:328
bool insertMapped(value_type const &v)
std::string const & moduleLabel() const
boost::shared_ptr< HLTGlobalStatus > TrigResPtr
Definition: Schedule.h:108
bool shouldWeCloseFile() const
Definition: OutputWorker.cc:27
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
void writeLumi(LuminosityBlockPrincipal const &lbp)
Definition: OutputWorker.cc:47
int totalEventsFailed() const
Definition: Schedule.h:203
void resetAll()
Definition: Schedule.cc:1475
dictionary map
Definition: Association.py:205
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
Definition: Schedule.cc:878
void eraseOrSetUntrackedParameterSet(std::string const &name)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:16
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:195
boost::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
std::string moduleLabel
Definition: TriggerReport.h:57
void openFile(FileBlock const &fb)
Definition: OutputWorker.cc:37
ProductList const & productList() const
int totalEventsPassed() const
Definition: Schedule.h:197
int timesExcept() const
Definition: Worker.h:106
std::vector< PathSummary > trigPathSummaries
Definition: TriggerReport.h:64
void reset()
Definition: Worker.h:72
EventSummary eventSummary
Definition: TriggerReport.h:63
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
Definition: Schedule.cc:734
const T & max(const T &a, const T &b)
int timesVisited() const
Definition: Worker.h:103
ParameterSet const & getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
void reduceParameterSet(ParameterSet &proc_pset, vstring &modulesInConfig, std::set< std::string > const &modulesInConfigSet, vstring &labelsOnTriggerPaths, vstring &shouldBeUsedLabels, std::map< std::string, std::vector< std::pair< std::string, int > > > &outputModulePathPositions)
Definition: Schedule.cc:616
boost::array< Selections, NumBranchTypes > SelectionsArray
Definition: Selections.h:12
int totalEvents() const
Definition: Schedule.h:191
SelectionsArray const & keptProducts() const
Definition: OutputWorker.cc:57
std::string name
Definition: TriggerReport.h:45
void stdToEDM(std::exception const &e)
std::vector< int > empty_trig_paths_
Definition: Schedule.h:308
Definition: Path.h:39
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:145
void clearCounters()
Clear all the counters in the trigger report.
Definition: Schedule.cc:1467
tuple result
Definition: query.py:137
void useStopwatch()
Definition: Worker.cc:116
int timesPassed() const
Definition: Path.h:74
int timesRun() const
Definition: Worker.h:102
void respondToCloseOutputFiles(FileBlock const &fb)
Definition: Schedule.cc:1312
std::vector< std::string > vstring
Definition: Schedule.h:105
#define end
Definition: vmac.h:38
BranchIDLists const & branchIDLists() const
bool terminate() const
Return whether each output module has reached its maximum count.
Definition: Schedule.cc:774
void eraseSimpleParameter(std::string const &name)
void respondToOpenInputFile(FileBlock const &fb)
Definition: Schedule.cc:1300
vstring trig_name_list_
Definition: Schedule.h:297
ActionTable const * act_table_
Definition: Schedule.h:293
std::vector< Worker * > Workers
Definition: Schedule.h:113
AllWorkers::const_iterator workersBegin() const
Definition: Schedule.h:231
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: Worker.h:70
void getTriggerReport(TriggerReport &rep) const
Definition: Schedule.cc:1456
void setFrozen(bool initializeLookupInfo=true) const
tuple out
Definition: dbtoconf.py:99
virtual Types moduleType() const =0
boost::shared_ptr< Worker > WorkerPtr
Definition: Schedule.h:109
void respondToOpenOutputFiles(FileBlock const &fb)
Definition: Schedule.cc:1308
void respondToCloseOutputFiles(FileBlock const &fb)
Definition: Worker.h:67
void charPtrToEDM(char const *c)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
void stringToEDM(std::string &s)
ParameterSet const & getParameterSet(std::string const &) const
volatile bool endpathsAreActive_
Definition: Schedule.h:333
void respondToOpenInputFile(FileBlock const &fb)
Definition: Worker.h:64
TrigResPtr results_
Definition: Schedule.h:300
void useStopwatch()
Definition: Path.cc:149
bool search_all(ForwardSequence const &s, Datum const &d)
Definition: Algorithms.h:46
void fillModuleInPathSummary(Path const &, ModuleInPathSummary &)
Definition: Schedule.cc:1409
int timesVisited(size_type i) const
Definition: Path.h:81
double b
Definition: hdecay.h:120
int total_events_
Definition: Schedule.h:327
vstring empty_trig_path_names_
Definition: Schedule.h:309
void loadMissingDictionaries()
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:1382
int timesFailed() const
Definition: Worker.h:105
TrigPaths end_paths_
Definition: Schedule.h:307
bool anyProductProduced() const
void respondToCloseInputFile(FileBlock const &fb)
Definition: Worker.h:65
void fillPathSummary(Path const &path, PathSummary &sum)
Definition: Schedule.cc:1424
void preForkReleaseResources()
Definition: Worker.h:69
bool wantSummary_
Definition: Schedule.h:326
std::string const & name() const
Definition: Path.h:58
#define begin
Definition: vmac.h:31
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: Schedule.cc:1333
void updateRegistries(ProductRegistry const &reg)
list key
Definition: combine.py:13
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
Definition: Schedule.h:321
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Definition: Schedule.cc:1358
Worker const * getWorker(size_type i) const
Definition: Path.h:85
void fillTrigPath(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, TrigResPtr, vstring *labelsOnTriggerPaths)
Definition: Schedule.cc:850
void beginJob()
Definition: Worker.cc:72
Worker * getWorker(WorkerParams const &p, std::string const &moduleLabel)
Retrieve the particular instance of the worker.
void openNewFileIfNeeded()
Definition: OutputWorker.cc:32
void beginJob(ProductRegistry const &)
Definition: Schedule.cc:1316
void setUnscheduledHandler(boost::shared_ptr< UnscheduledHandler > iHandler)
std::vector< ModuleInPathSummary > moduleInPathSummaries
Definition: TriggerReport.h:46
T w() const
double pi
void openNewOutputFilesIfNeeded()
Definition: Schedule.cc:1277
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void preForkReleaseResources()
Definition: Schedule.cc:1330
void openOutputFiles(FileBlock &fb)
Definition: Schedule.cc:1281
void writeRun(RunPrincipal const &rp)
Definition: Schedule.cc:1285
std::vector< std::pair< BranchID, unsigned int > > earlyDeleteBranchToCount_
Definition: Schedule.h:314
void endJob(ExceptionCollector &collector)
Definition: Schedule.cc:900
ParameterSet const & registerIt()
bool shouldWeCloseOutput() const
Definition: Schedule.cc:1293
void setupOnDemandSystem(EventPrincipal &principal, EventSetup const &es)
Definition: Schedule.cc:1492
SurfaceDeformation * create(int type, const std::vector< double > &params)
tuple size
Write out results.
void writeRun(RunPrincipal const &rp)
Definition: OutputWorker.cc:42
void fillWorkers(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &name, bool ignoreFilters, PathWorkers &out, vstring *labelsOnPaths)
Definition: Schedule.cc:792
T get(const Candidate &c)
Definition: component.h:56
vstring end_path_name_list_
Definition: Schedule.h:298
void closeOutputFiles()
Definition: Schedule.cc:1273
void clearCounters()
Definition: Path.cc:143
AllWorkers::const_iterator workersEnd() const
Definition: Schedule.h:235
int timesFailed() const
Definition: Path.h:75
void addToAllWorkers(Worker *w)
Definition: Schedule.cc:1482
boost::shared_ptr< ActivityRegistry > actReg_
Definition: Schedule.h:294
ParameterSet * getPSetForUpdate(std::string const &name, bool &isTracked)
AllWorkers all_workers_
Definition: Schedule.h:304
boost::shared_ptr< UnscheduledCallProducer > unscheduled_
Definition: Schedule.h:331