52 using std::placeholders::_1;
54 bool binary_search_string(std::vector<std::string>
const&
v,
std::string const&
s) {
55 return std::binary_search(v.begin(), v.end(),
s);
61 std::shared_ptr<TriggerResultInserter>
63 PreallocationConfiguration
const& iPrealloc,
64 ProductRegistry& preg,
65 ExceptionToActionTable
const&
actions,
66 std::shared_ptr<ActivityRegistry> areg,
67 std::shared_ptr<ProcessConfiguration> processConfiguration) {
69 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
70 trig_pset->registerIt();
72 WorkerParams work_args(trig_pset, preg, &iPrealloc, processConfiguration, actions);
73 ModuleDescription md(trig_pset->id(),
74 "TriggerResultInserter",
76 processConfiguration.get(),
79 areg->preModuleConstructionSignal_(md);
80 bool postCalled =
false;
81 std::shared_ptr<TriggerResultInserter> returnValue;
83 maker::ModuleHolderT<TriggerResultInserter> holder(std::make_shared<TriggerResultInserter>(*trig_pset, iPrealloc.numberOfStreams()),static_cast<Maker const*>(
nullptr));
84 holder.setModuleDescription(md);
85 holder.registerProductsAndCallbacks(&preg);
86 returnValue =holder.module();
89 areg->postModuleConstructionSignal_(md);
94 areg->postModuleConstructionSignal_(md);
105 template <
typename T>
107 makePathStatusInserters(std::vector<
edm::propagate_const<std::shared_ptr<T>>>& pathStatusInserters,
108 std::vector<std::string>
const& pathNames,
109 PreallocationConfiguration
const& iPrealloc,
110 ProductRegistry& preg,
111 std::shared_ptr<ActivityRegistry> areg,
112 std::shared_ptr<ProcessConfiguration> processConfiguration,
116 pset.addParameter<
std::string>(
"@module_type", moduleTypeName);
117 pset.addParameter<
std::string>(
"@module_edm_type",
"EDProducer");
120 pathStatusInserters.reserve(pathNames.size());
122 for (
auto const& pathName : pathNames) {
124 ModuleDescription md(pset.id(),
127 processConfiguration.get(),
130 areg->preModuleConstructionSignal_(md);
131 bool postCalled =
false;
134 maker::ModuleHolderT<T> holder(std::make_shared<T>(iPrealloc.numberOfStreams()),
135 static_cast<Maker const*>(
nullptr));
136 holder.setModuleDescription(md);
137 holder.registerProductsAndCallbacks(&preg);
138 pathStatusInserters.emplace_back(holder.module());
141 areg->postModuleConstructionSignal_(md);
146 areg->postModuleConstructionSignal_(md);
158 checkAndInsertAlias(
std::string const& friendlyClassName,
164 ProductRegistry
const& preg,
165 std::multimap<BranchKey, BranchKey>& aliasMap,
166 std::map<BranchKey, BranchKey>& aliasKeys) {
169 BranchKey
key(friendlyClassName, moduleLabel, productInstanceName, processName);
170 if(preg.productList().find(
key) == preg.productList().end()) {
173 for(
auto const& product : preg.productList()) {
174 if(moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
176 <<
"There are no products of type '" << friendlyClassName <<
"'\n" 177 <<
"with module label '" << moduleLabel <<
"' and instance name '" << productInstanceName <<
"'.\n";
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()) {
186 <<
"A product of type '" << friendlyClassName <<
"'\n" 187 <<
"with module label '" << alias <<
"' and instance name '" << theInstanceAlias <<
"'\n" 188 <<
"already exists.\n";
190 auto iter = aliasKeys.find(aliasKey);
191 if(iter != aliasKeys.end()) {
193 if(iter->second !=
key) {
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 <<
"',\n" 198 <<
"the other has module label '" << iter->second.moduleLabel() <<
"' and product instance name '" << iter->second.productInstanceName() <<
"'.\n";
201 auto prodIter = preg.productList().find(
key);
202 if(prodIter != preg.productList().end()) {
203 if (!prodIter->second.produced()) {
205 <<
"The module label alias '" << alias <<
"' and product instance alias '" << theInstanceAlias <<
"'\n" 206 <<
"are used for a product of type '" << friendlyClassName <<
"'\n" 207 <<
"with module label '" << moduleLabel <<
"' and product instance name '" << productInstanceName <<
"',\n" 208 <<
"An EDAlias can only be used for products produced in the current process. This one is not.\n";
210 aliasMap.insert(std::make_pair(
key, aliasKey));
211 aliasKeys.insert(std::make_pair(aliasKey,
key));
218 std::vector<std::string> aliases = proc_pset.getParameter<std::vector<std::string> >(
"@all_aliases");
219 if(aliases.empty()) {
226 desc.add<
std::string>(
"fromProductInstance", star);
229 std::multimap<BranchKey, BranchKey> aliasMap;
231 std::map<BranchKey, BranchKey> aliasKeys;
235 ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
236 std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<
VParameterSet>();
244 if(productInstanceName == star) {
246 BranchKey lowerBound(friendlyClassName, moduleLabel,
empty,
empty);
247 for(ProductRegistry::ProductList::const_iterator it = preg.productList().lower_bound(lowerBound);
248 it != preg.productList().end() && it->first.friendlyClassName() == friendlyClassName && it->first.moduleLabel() == moduleLabel;
255 checkAndInsertAlias(friendlyClassName, moduleLabel, it->first.productInstanceName(),
processName,
alias, instanceAlias, preg, aliasMap, aliasKeys);
260 for(
auto const& product : preg.productList()) {
261 if(moduleLabel == product.first.moduleLabel() && processName == product.first.processName()) {
263 <<
"There are no products of type '" << friendlyClassName <<
"'\n" 264 <<
"with module label '" << moduleLabel <<
"'.\n";
269 checkAndInsertAlias(friendlyClassName, moduleLabel, productInstanceName, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
277 for(
auto const& aliasEntry : aliasMap) {
278 ProductRegistry::ProductList::const_iterator it = preg.productList().find(aliasEntry.first);
279 assert(it != preg.productList().end());
280 preg.addLabelAlias(it->second, aliasEntry.second.moduleLabel(), aliasEntry.second.productInstanceName());
285 typedef std::vector<std::string>
vstring;
288 vstring
const& end_path_name_list,
289 vstring& modulesInConfig,
290 std::set<std::string>
const& usedModuleLabels,
291 std::map<
std::string, std::vector<std::pair<std::string, int> > >& outputModulePathPositions) {
303 vstring outputModuleLabels;
305 std::string const moduleEdmType(
"@module_edm_type");
311 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
315 vstring scheduledPaths = proc_pset.getParameter<vstring>(
"@paths");
316 std::set<std::string> modulesOnPaths;
318 std::set<std::string> noEndPaths(scheduledPaths.begin(),scheduledPaths.end());
319 for(
auto const& endPath: end_path_name_list) {
320 noEndPaths.erase(endPath);
324 for(
auto const&
path: noEndPaths) {
325 labels = proc_pset.getParameter<vstring>(
path);
326 modulesOnPaths.insert(labels.begin(),labels.end());
332 std::vector<std::string> labelsToBeDropped;
333 labelsToBeDropped.reserve(modulesInConfigSet.size());
334 std::set_difference(modulesInConfigSet.begin(),modulesInConfigSet.end(),
335 usedModuleLabels.begin(),usedModuleLabels.end(),
336 std::back_inserter(labelsToBeDropped));
338 const unsigned int sizeBeforeOutputModules = labelsToBeDropped.size();
339 for (
auto const& modLabel: usedModuleLabels) {
343 edmType = proc_pset.getParameterSet(modLabel).getParameter<
std::string>(moduleEdmType);
344 if (edmType == outputModule) {
345 outputModuleLabels.push_back(modLabel);
346 labelsToBeDropped.push_back(modLabel);
348 if(edmType == edAnalyzer) {
349 if(modulesOnPaths.end()==modulesOnPaths.find(modLabel)) {
350 labelsToBeDropped.push_back(modLabel);
356 std::inplace_merge(labelsToBeDropped.begin(),
357 labelsToBeDropped.begin()+sizeBeforeOutputModules,
358 labelsToBeDropped.end());
364 vstring::iterator endAfterRemove = std::remove_if(modulesInConfig.begin(), modulesInConfig.end(), std::bind(binary_search_string, std::ref(labelsToBeDropped), _1));
365 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
366 proc_pset.addParameter<vstring>(
std::string(
"@all_modules"), modulesInConfig);
369 vstring endPathsToBeDropped;
371 for (vstring::const_iterator iEndPath = end_path_name_list.begin(), endEndPath = end_path_name_list.end();
372 iEndPath != endEndPath;
374 labels = proc_pset.getParameter<vstring>(*iEndPath);
375 vstring::iterator iSave = labels.begin();
376 vstring::iterator iBegin = labels.begin();
378 for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end();
379 iLabel != iEnd; ++iLabel) {
380 if (binary_search_string(labelsToBeDropped, *iLabel)) {
381 if (binary_search_string(outputModuleLabels, *iLabel)) {
382 outputModulePathPositions[*iLabel].emplace_back(*iEndPath, iSave - iBegin);
385 if (iSave != iLabel) {
386 iSave->swap(*iLabel);
391 labels.erase(iSave, labels.end());
392 if (labels.empty()) {
394 proc_pset.eraseSimpleParameter(*iEndPath);
395 endPathsToBeDropped.push_back(*iEndPath);
397 proc_pset.addParameter<vstring>(*iEndPath,
labels);
403 endAfterRemove = std::remove_if(scheduledPaths.begin(), scheduledPaths.end(), std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
404 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
405 proc_pset.addParameter<vstring>(
std::string(
"@paths"), scheduledPaths);
408 vstring scheduledEndPaths = proc_pset.getParameter<vstring>(
"@end_paths");
409 endAfterRemove = std::remove_if(scheduledEndPaths.begin(), scheduledEndPaths.end(), std::bind(binary_search_string, std::ref(endPathsToBeDropped), _1));
410 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
411 proc_pset.addParameter<vstring>(
std::string(
"@end_paths"), scheduledEndPaths);
415 class RngEDConsumer :
public EDConsumerBase {
417 explicit RngEDConsumer(std::set<TypeID>& typesConsumed) {
419 if(rng.isAvailable()) {
420 rng->consumes(consumesCollector());
421 for (
auto const& consumesInfo : this->consumesInfo()) {
422 typesConsumed.emplace(consumesInfo.type());
441 std::shared_ptr<ActivityRegistry> areg,
442 std::shared_ptr<ProcessConfiguration> processConfiguration,
443 bool hasSubprocesses,
447 resultsInserter_{tns.
getTrigPaths().empty()? std::shared_ptr<TriggerResultInserter>{} :makeInserter(proc_pset,prealloc,preg,actions,areg,processConfiguration)},
461 processConfiguration,
469 processConfiguration,
472 assert(0<prealloc.numberOfStreams());
474 for(
unsigned int i=0;
i<prealloc.numberOfStreams();++
i) {
480 proc_pset,tns,prealloc,preg,
481 branchIDListHelper,actions,
482 areg,processConfiguration,
490 const std::string kTriggerResults(
"TriggerResults");
491 std::vector<std::string> modulesToUse;
494 if(worker->description().moduleLabel() != kTriggerResults) {
495 modulesToUse.push_back(worker->description().moduleLabel());
501 std::vector<std::string>
temp;
502 temp.reserve(modulesToUse.size());
503 auto itBeginUnscheduled = modulesToUse.begin()+modulesToUse.size()-
n;
504 std::copy(itBeginUnscheduled,modulesToUse.end(),
505 std::back_inserter(temp));
506 std::copy(modulesToUse.begin(),itBeginUnscheduled,std::back_inserter(temp));
507 temp.swap(modulesToUse);
517 proc_pset, preg, prealloc,
518 actions,areg,processConfiguration,processContext);
522 std::set<std::string> usedModuleLabels;
524 if(worker->description().moduleLabel() != kTriggerResults) {
525 usedModuleLabels.insert(worker->description().moduleLabel());
528 std::vector<std::string> modulesInConfig(proc_pset.getParameter<std::vector<std::string> >(
"@all_modules"));
529 std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
530 reduceParameterSet(proc_pset, tns.getEndPaths(), modulesInConfig, usedModuleLabels,
531 outputModulePathPositions);
532 processEDAliases(proc_pset, processConfiguration->processName(), preg);
533 proc_pset.registerIt();
534 processConfiguration->setParameterSetID(proc_pset.id());
535 processConfiguration->setProcessConfigurationID();
539 size_t all_workers_count =
allWorkers().size();
548 limitOutput(proc_pset, branchIDListHelper.branchIDLists(), subProcessParentageHelper);
554 branchIDListHelper.updateFromRegistry(preg);
557 worker->registerThinnedAssociations(preg, thinnedAssociationsHelper);
559 thinnedAssociationsHelper.sort();
564 c->selectProducts(preg, thinnedAssociationsHelper);
569 std::set<TypeID> productTypesConsumed;
570 std::set<TypeID> elementTypesConsumed;
573 for (
auto const& consumesInfo : worker->consumesInfo()) {
575 productTypesConsumed.emplace(consumesInfo.type());
577 elementTypesConsumed.emplace(consumesInfo.type());
582 if(hasSubprocesses) {
587 RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed);
589 preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
592 for (
auto&
c : all_output_communicators_) {
593 c->setEventSelectionInfo(outputModulePathPositions, preg.anyProductProduced());
597 std::vector<const ModuleDescription*> modDesc;
599 modDesc.reserve(workers.size());
602 std::back_inserter(modDesc),
604 return iWorker->descPtr();
609 prealloc.numberOfStreams(),
613 auto timeKeeperPtr = summaryTimeKeeper_.get();
643 int maxEventSpecs = 0;
644 int maxEventsOut = -1;
651 std::vector<std::string> psetNamesE;
658 if (maxEventSpecs > 1) {
660 "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
665 if (vMaxEventsOut !=
nullptr && !vMaxEventsOut->
empty()) {
666 std::string const& moduleLabel =
c->description().moduleLabel();
671 "\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
683 if (!
c->limitReached()) {
688 LogInfo(
"SuccessfulTermination")
689 <<
"The job is terminating successfully because each output module\n" 690 <<
"has reached its configured limit.\n";
711 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Event Summary ------------";
726 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Path Summary ------------";
728 << std::right << std::setw(10) <<
"Trig Bit#" <<
" " 729 << std::right << std::setw(10) <<
"Executed" <<
" " 730 << std::right << std::setw(10) <<
"Passed" <<
" " 731 << std::right << std::setw(10) <<
"Failed" <<
" " 732 << std::right << std::setw(10) <<
"Error" <<
" " 736 << std::right << std::setw(5) << 1
737 << std::right << std::setw(5) <<
p.bitPosition <<
" " 738 << std::right << std::setw(10) <<
p.timesRun <<
" " 739 << std::right << std::setw(10) <<
p.timesPassed <<
" " 740 << std::right << std::setw(10) <<
p.timesFailed <<
" " 741 << std::right << std::setw(10) <<
p.timesExcept <<
" " 763 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"-------End-Path Summary ------------";
765 << std::right << std::setw(10) <<
"Trig Bit#" <<
" " 766 << std::right << std::setw(10) <<
"Executed" <<
" " 767 << std::right << std::setw(10) <<
"Passed" <<
" " 768 << std::right << std::setw(10) <<
"Failed" <<
" " 769 << std::right << std::setw(10) <<
"Error" <<
" " 773 << std::right << std::setw(5) << 0
774 << std::right << std::setw(5) <<
p.bitPosition <<
" " 775 << std::right << std::setw(10) <<
p.timesRun <<
" " 776 << std::right << std::setw(10) <<
p.timesPassed <<
" " 777 << std::right << std::setw(10) <<
p.timesFailed <<
" " 778 << std::right << std::setw(10) <<
p.timesExcept <<
" " 784 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Modules in Path: " <<
p.name <<
" ------------";
786 << std::right << std::setw(10) <<
"Trig Bit#" <<
" " 787 << std::right << std::setw(10) <<
"Visited" <<
" " 788 << std::right << std::setw(10) <<
"Passed" <<
" " 789 << std::right << std::setw(10) <<
"Failed" <<
" " 790 << std::right << std::setw(10) <<
"Error" <<
" " 793 unsigned int bitpos = 0;
794 for (
auto const&
mod:
p.moduleInPathSummaries) {
796 << std::right << std::setw(5) << 1
797 << std::right << std::setw(5) << bitpos <<
" " 798 << std::right << std::setw(10) <<
mod.timesVisited <<
" " 799 << std::right << std::setw(10) <<
mod.timesPassed <<
" " 800 << std::right << std::setw(10) <<
mod.timesFailed <<
" " 801 << std::right << std::setw(10) <<
mod.timesExcept <<
" " 802 <<
mod.moduleLabel <<
"";
809 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"------ Modules in End-Path: " <<
p.name <<
" ------------";
811 << std::right << std::setw(10) <<
"Trig Bit#" <<
" " 812 << std::right << std::setw(10) <<
"Visited" <<
" " 813 << std::right << std::setw(10) <<
"Passed" <<
" " 814 << std::right << std::setw(10) <<
"Failed" <<
" " 815 << std::right << std::setw(10) <<
"Error" <<
" " 818 unsigned int bitpos=0;
819 for (
auto const&
mod:
p.moduleInPathSummaries) {
821 << std::right << std::setw(5) << 0
822 << std::right << std::setw(5) << bitpos <<
" " 823 << std::right << std::setw(10) <<
mod.timesVisited <<
" " 824 << std::right << std::setw(10) <<
mod.timesPassed <<
" " 825 << std::right << std::setw(10) <<
mod.timesFailed <<
" " 826 << std::right << std::setw(10) <<
mod.timesExcept <<
" " 827 <<
mod.moduleLabel <<
"";
833 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Module Summary ------------";
835 << std::right << std::setw(10) <<
"Visited" <<
" " 836 << std::right << std::setw(10) <<
"Executed" <<
" " 837 << std::right << std::setw(10) <<
"Passed" <<
" " 838 << std::right << std::setw(10) <<
"Failed" <<
" " 839 << std::right << std::setw(10) <<
"Error" <<
" " 843 << std::right << std::setw(10) << worker.timesVisited <<
" " 844 << std::right << std::setw(10) << worker.timesRun <<
" " 845 << std::right << std::setw(10) << worker.timesPassed <<
" " 846 << std::right << std::setw(10) << worker.timesFailed <<
" " 847 << std::right << std::setw(10) << worker.timesExcept <<
" " 848 << worker.moduleLabel <<
"";
858 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Event Summary ---[sec]----";
876 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Path Summary ---[Real sec]----";
878 << std::right << std::setw(kColumn1Size) <<
"per event"<<
" " 879 << std::right << std::setw(kColumn2Size) <<
"per exec" 882 const int timesRun =
std::max(1,
p.timesRun);
885 << std::right << std::setw(kColumn1Size) <<
p.realTime/totalEvents <<
" " 886 << std::right << std::setw(kColumn2Size) <<
p.realTime/timesRun <<
" " 890 << std::right << std::setw(kColumn1Size) <<
"per event"<<
" " 891 << std::right << std::setw(kColumn2Size) <<
"per exec" 895 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"-------End-Path Summary ---[Real sec]----";
897 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 898 << std::right << std::setw(kColumn2Size) <<
"per exec" 901 const int timesRun =
std::max(1,
p.timesRun);
905 << std::right << std::setw(kColumn1Size) <<
p.realTime/totalEvents <<
" " 906 << std::right << std::setw(kColumn2Size) <<
p.realTime/timesRun <<
" " 910 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 911 << std::right << std::setw(kColumn2Size) <<
"per exec" 916 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Modules in Path: " <<
p.name <<
" ---[Real sec]----";
918 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 919 << std::right << std::setw(kColumn2Size) <<
"per visit" 921 for (
auto const&
mod:
p.moduleInPathSummaries) {
924 << std::right << std::setw(kColumn1Size) <<
mod.realTime/totalEvents <<
" " 925 << std::right << std::setw(kColumn2Size) <<
mod.realTime/
std::max(1,
mod.timesVisited) <<
" " 926 <<
mod.moduleLabel <<
"";
931 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 932 << std::right << std::setw(kColumn2Size) <<
"per visit" 937 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"------ Modules in End-Path: " <<
p.name <<
" ---[Real sec]----";
939 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 940 << std::right << std::setw(kColumn2Size) <<
"per visit" 942 for (
auto const&
mod:
p.moduleInPathSummaries) {
945 << std::right << std::setw(kColumn1Size) <<
mod.realTime/totalEvents <<
" " 946 << std::right << std::setw(kColumn2Size) <<
mod.realTime/
std::max(1,
mod.timesVisited) <<
" " 947 <<
mod.moduleLabel <<
"";
952 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 953 << std::right << std::setw(kColumn2Size) <<
"per visit" 957 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Module Summary ---[Real sec]----";
959 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 960 << std::right << std::setw(kColumn2Size) <<
"per exec" <<
" " 961 << std::right << std::setw(kColumn3Size) <<
"per visit" 966 << std::right << std::setw(kColumn1Size) << worker.realTime/totalEvents <<
" " 967 << std::right << std::setw(kColumn2Size) << worker.realTime/
std::max(1, worker.timesRun) <<
" " 968 << std::right << std::setw(kColumn3Size) << worker.realTime/
std::max(1, worker.timesVisited) <<
" " 969 << worker.moduleLabel <<
"";
972 << std::right << std::setw(kColumn1Size) <<
"per event" <<
" " 973 << std::right << std::setw(kColumn2Size) <<
"per exec" <<
" " 974 << std::right << std::setw(kColumn3Size) <<
"per visit" 978 LogVerbatim(
"FwkSummary") <<
"T---Report end!" <<
"";
983 using std::placeholders::_1;
988 using std::placeholders::_1;
993 using std::placeholders::_1;
998 using std::placeholders::_1;
1003 using std::placeholders::_1;
1011 using std::placeholders::_1;
1016 using std::placeholders::_1;
1035 unsigned int iStreamID,
1047 if (worker->description().moduleLabel() == iLabel) {
1052 if (
nullptr == found) {
1061 s->replaceModule(newMod,iLabel);
1073 auto const& processName = newMod->moduleDescription().processName();
1074 auto const& runModuleToIndicies = runLookup->indiciesForModulesInProcess(processName);
1075 auto const& lumiModuleToIndicies = lumiLookup->indiciesForModulesInProcess(processName);
1076 auto const& eventModuleToIndicies = eventLookup->indiciesForModulesInProcess(processName);
1087 std::vector<ModuleDescription const*>
1089 std::vector<ModuleDescription const*>
result;
1094 result.push_back(p);
1106 worker->convertCurrentProcessAlias(processName);
1128 std::vector<std::string>& oLabelsToFill)
const {
1134 std::vector<ModuleDescription const*>& descriptions,
1135 unsigned int hint)
const {
1136 streamSchedules_[0]->moduleDescriptionsInPath(iPathLabel, descriptions, hint);
1141 std::vector<ModuleDescription const*>& descriptions,
1142 unsigned int hint)
const {
1143 streamSchedules_[0]->moduleDescriptionsInEndPath(iEndPathLabel, descriptions, hint);
1148 std::vector<std::pair<unsigned int, unsigned int> >& moduleIDToIndex,
1149 std::vector<std::vector<ModuleDescription const*> >& modulesWhoseProductsAreConsumedBy,
1151 allModuleDescriptions.clear();
1152 moduleIDToIndex.clear();
1153 modulesWhoseProductsAreConsumedBy.clear();
1159 std::map<std::string, ModuleDescription const*> labelToDesc;
1163 allModuleDescriptions.push_back(p);
1164 moduleIDToIndex.push_back(std::pair<unsigned int, unsigned int>(p->
id(),
i));
1172 std::vector<ModuleDescription const*>&
modules = modulesWhoseProductsAreConsumedBy.at(i);
1173 worker->modulesWhoseProductsAreConsumed(modules, preg, labelToDesc);
1182 s->enableEndPaths(active);
1197 s->getTriggerReport(rep);
1212 int returnValue = 0;
1214 returnValue += s->totalEvents();
1221 int returnValue = 0;
1223 returnValue += s->totalEventsPassed();
1230 int returnValue = 0;
1232 returnValue += s->totalEventsFailed();
std::vector< PathSummary > endPathSummaries
T getUntrackedParameter(std::string const &, T const &) const
std::vector< PathTimingSummary > endPathSummaries
void stopEvent(StreamContext const &)
void startProcessingLoop()
std::vector< BranchIDList > BranchIDLists
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
virtual void openFile(FileBlock const &fb)=0
AllWorkers const & allWorkers() const
returns the collection of pointers to workers
roAction_t actions[nactions]
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
virtual void writeRun(RunPrincipal const &rp, ProcessContext const *)=0
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
bool endPathsEnabled() const
void respondToCloseInputFile(FileBlock const &fb)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ModuleRegistry const > moduleRegistry() const
std::vector< Worker * > AllWorkers
std::vector< ParameterSet > VParameterSet
std::vector< std::string > const * pathNames_
void convertCurrentProcessAlias(std::string const &processName)
Convert "@currentProcess" in InputTag process names to the actual current process name...
virtual bool shouldWeCloseFile() const =0
void writeRun(RunPrincipal const &rp, ProcessContext const *)
void endStream(unsigned int)
void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)
void enableEndPaths(bool active)
unsigned int numberOfThreads() const
ParameterSet getUntrackedParameterSet(std::string const &name, ParameterSet const &defaultValue) const
virtual void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &)=0
void moduleDescriptionsInEndPath(std::string const &iEndPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
std::vector< WorkerSummary > workerSummaries
edm::propagate_const< std::unique_ptr< SystemTimeKeeper > > summaryTimeKeeper_
std::string const & moduleLabel() const
void stopProcessingLoop()
void startEvent(StreamID)
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription's constructor's modI...
int totalEventsFailed() const
edm::propagate_const< std::unique_ptr< GlobalSchedule > > globalSchedule_
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet, const ProductRegistry &iRegistry)
void eraseOrSetUntrackedParameterSet(std::string const &name)
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
int totalEventsPassed() const
void triggerPaths(std::vector< std::string > &oLabelsToFill) const
std::vector< PathSummary > trigPathSummaries
EventSummary eventSummary
std::vector< edm::propagate_const< std::shared_ptr< PathStatusInserter > > > pathStatusInserters_
virtual void resolvePutIndicies(BranchType iBranchType, std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, edm::ProductResolverIndex >> const &iIndicies)=0
EventTimingSummary eventSummary
void clearCounters()
Clear all the counters in the trigger report.
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)
std::vector< PathTimingSummary > trigPathSummaries
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists, SubProcessParentageHelper const *subProcessParentageHelper)
bool terminate() const
Return whether each output module has reached its maximum count.
void respondToOpenInputFile(FileBlock const &fb)
edm::propagate_const< std::shared_ptr< ModuleRegistry > > moduleRegistry_
virtual void writeLumi(LuminosityBlockPrincipal const &lbp, ProcessContext const *)=0
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
void getTriggerReport(TriggerReport &rep) const
PreallocationConfiguration preallocConfig_
std::vector< edm::propagate_const< std::shared_ptr< StreamSchedule > > > streamSchedules_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
volatile bool endpathsAreActive_
void respondToOpenInputFile(FileBlock const &fb)
std::shared_ptr< TriggerResultInserter const > resultsInserter() const
void startPath(StreamContext const &, PathContext const &)
bool search_all(ForwardSequence const &s, Datum const &d)
std::vector< edm::propagate_const< std::shared_ptr< EndPathStatusInserter > > > endPathStatusInserters_
virtual std::unique_ptr< OutputModuleCommunicator > createOutputModuleCommunicator()=0
AllOutputModuleCommunicators all_output_communicators_
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 ...
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
void beginStream(unsigned int)
void respondToCloseInputFile(FileBlock const &fb)
std::vector< std::string > const * endPathNames_
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Strings const & getTrigPaths() const
void processOneEventAsync(WaitingTaskHolder iTask, unsigned int iStreamID, EventPrincipal &principal, EventSetup const &eventSetup)
void beginJob(ProductRegistry const &)
virtual void closeFile()=0
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void openOutputFiles(FileBlock &fb)
std::vector< WorkerTimingSummary > workerSummaries
T mod(const T &a, const T &b)
void endJob(ExceptionCollector &collector)
void getTriggerTimingReport(TriggerTimingReport &rep) const
bool shouldWeCloseOutput() const
std::vector< std::string > vstring
void endPaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all end paths in the process
void moduleDescriptionsInPath(std::string const &iPathLabel, std::vector< ModuleDescription const * > &descriptions, unsigned int hint) const
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)