27 #include "boost/bind.hpp"
28 #include "boost/ref.hpp"
46 template <
typename InputIterator,
typename ForwardIterator,
typename Func>
48 transform_into(InputIterator
begin, InputIterator
end,
49 ForwardIterator
out, Func func) {
50 for (; begin !=
end; ++
begin, ++
out) func(*begin, *out);
58 template <
typename FROM,
typename TO,
typename FUNC>
60 fill_summary(FROM
const& from, TO&
to, FUNC func) {
62 transform_into(from.begin(), from.end(),
temp.begin(), func);
73 ProductRegistry& preg,
75 boost::shared_ptr<ActivityRegistry> areg,
76 boost::shared_ptr<ProcessConfiguration> processConfiguration,
79 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
80 trig_pset->registerIt();
82 WorkerParams work_args(proc_pset, trig_pset, preg, processConfiguration, actions);
83 ModuleDescription md(trig_pset->id(),
84 "TriggerResultInserter",
86 processConfiguration.get());
88 areg->preModuleConstructionSignal_(md);
89 std::unique_ptr<EDProducer>
producer(
new TriggerResultInserter(*trig_pset, trptr));
90 areg->postModuleConstructionSignal_(md);
93 ptr->setActivityRegistry(areg);
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);
103 ProductRegistry
const& preg,
104 std::multimap<std::string,Worker*>& branchToReadingWorker)
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());
114 auto allBranchNames = preg.allBranchNames();
116 for(
auto &
b:allBranchNames) {
117 b.resize(
b.size()-1);
119 std::sort(allBranchNames.begin(),allBranchNames.end(),std::less<std::string>());
120 std::vector<std::string>
temp;
121 temp.reserve(vBranchesToDeleteEarly.size());
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){
140 for(
auto const& branch:vBranchesToDeleteEarly) {
141 branchToReadingWorker.insert(std::make_pair(branch, static_cast<Worker*>(
nullptr)));
147 checkAndInsertAlias(
std::string const& friendlyClassName,
153 ProductRegistry
const& preg,
154 std::multimap<BranchKey, BranchKey>& aliasMap,
155 std::map<BranchKey, BranchKey>& aliasKeys) {
158 BranchKey
key(friendlyClassName, moduleLabel, productInstanceName, processName);
159 if(preg.productList().find(
key) == preg.productList().end()) {
162 for(
auto const& product : preg.productList()) {
163 if(moduleLabel == product.first.moduleLabel_ && processName == product.first.processName_) {
165 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
166 <<
"with module label '" << moduleLabel <<
"' and instance name '" << productInstanceName <<
"'.\n";
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()) {
175 <<
"A product of type '" << friendlyClassName <<
"'\n"
176 <<
"with module label '" << alias <<
"' and instance name '" << theInstanceAlias <<
"'\n"
177 <<
"already exists.\n";
179 auto iter = aliasKeys.find(aliasKey);
180 if(iter != aliasKeys.end()) {
182 if(iter->second !=
key) {
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";
190 auto prodIter = preg.productList().find(
key);
191 if(prodIter != preg.productList().end()) {
192 if (!prodIter->second.produced()) {
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";
199 aliasMap.insert(std::make_pair(
key, aliasKey));
200 aliasKeys.insert(std::make_pair(aliasKey,
key));
207 std::vector<std::string>
aliases = proc_pset.getParameter<std::vector<std::string> >(
"@all_aliases");
208 if(aliases.empty()) {
215 desc.add<
std::string>(
"fromProductInstance", star);
218 std::multimap<BranchKey, BranchKey> aliasMap;
220 std::map<BranchKey, BranchKey> aliasKeys;
224 ParameterSet const& aliasPSet = proc_pset.getParameterSet(alias);
225 std::vector<std::string> vPSetNames = aliasPSet.getParameterNamesForType<
VParameterSet>();
233 if(productInstanceName == star) {
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;
239 if(it->first.processName_ != processName) {
244 checkAndInsertAlias(friendlyClassName, moduleLabel, it->first.productInstanceName_, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
249 for(
auto const& product : preg.productList()) {
250 if(moduleLabel == product.first.moduleLabel_ && processName == product.first.processName_) {
252 <<
"There are no products of type '" << friendlyClassName <<
"'\n"
253 <<
"with module label '" << moduleLabel <<
"'.\n";
258 checkAndInsertAlias(friendlyClassName, moduleLabel, productInstanceName, processName, alias, instanceAlias, preg, aliasMap, aliasKeys);
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_);
286 boost::shared_ptr<ActivityRegistry> areg,
287 boost::shared_ptr<ProcessConfiguration> processConfiguration,
290 act_table_(&actions),
293 trig_name_list_(tns.getTrigPaths()),
294 end_path_name_list_(tns.getEndPaths()),
299 all_output_workers_(),
307 endpathsAreActive_(
true) {
310 bool hasPath =
false;
318 fillTrigPath(proc_pset, preg, processConfiguration, trig_bitpos, *
i,
results_, &labelsOnTriggerPaths);
336 for (
int bitpos = 0; eib != eie; ++eib, ++bitpos) {
337 fillEndPath(proc_pset, preg, processConfiguration, bitpos, *eib);
341 std::set<std::string> usedWorkerLabels;
345 usedWorkerLabels.insert((*itWorker)->description().moduleLabel());
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));
355 std::set<std::string> unscheduledLabels;
356 std::vector<std::string> shouldBeUsedLabels;
357 if (!unusedLabels.empty()) {
363 for (std::vector<std::string>::iterator itLabel = unusedLabels.begin(), itLabelEnd = unusedLabels.end();
364 itLabel != itLabelEnd;
366 if (allowUnscheduled) {
370 assert(modulePSet != 0);
376 unscheduledLabels.insert(*itLabel);
382 shouldBeUsedLabels.push_back(*itLabel);
386 shouldBeUsedLabels.push_back(*itLabel);
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;
396 unusedStream <<
",'" << *itLabel <<
"'";
399 <<
"The following module labels are not assigned to any path:\n"
400 << unusedStream.str()
404 if (!unscheduledLabels.empty()) {
405 for (ProductRegistry::ProductList::const_iterator it = preg.
productList().begin(),
409 if (it->second.produced() &&
410 it->second.branchType() ==
InEvent &&
411 unscheduledLabels.end() != unscheduledLabels.find(it->second.moduleLabel())) {
412 it->second.setOnDemand();
417 std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
418 reduceParameterSet(proc_pset, modulesInConfig, modulesInConfigSet, labelsOnTriggerPaths, shouldBeUsedLabels, outputModulePathPositions);
420 processEDAliases(proc_pset, processConfiguration->processName(), preg);
424 processConfiguration->setParameterSetID(proc_pset.
id());
453 (*i)->selectProducts(preg);
470 if(subProcPSet)
return;
474 std::multimap<std::string,Worker*> branchToReadingWorker;
475 initializeBranchToReadingWorker(opts,preg,branchToReadingWorker);
478 if(branchToReadingWorker.size()==0) {
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();
491 if(branchToReadingWorker.size()>0) {
495 for(
auto const& item: kept[
InEvent]) {
496 auto found = branchToReadingWorker.equal_range(item->branchName());
498 --nUniqueBranchesToDelete;
499 branchToReadingWorker.erase(
found.first,
found.second);
504 if(branchToReadingWorker.size()>0) {
508 auto branches = pset->getUntrackedParameter<std::vector<std::string>>(
"mightGet",kEmpty);
509 if(not branches.empty()) {
510 ++upperLimitOnReadingWorker;
512 for(
auto const& branch:branches){
513 auto found = branchToReadingWorker.equal_range(branch);
515 ++upperLimitOnIndicies;
516 ++reserveSizeForWorker[*
i];
517 if(
nullptr ==
found.first->second) {
520 branchToReadingWorker.insert(make_pair(
found.first->first,*
i));
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);
537 branchToReadingWorker.erase(temp);
542 if(not unusedBranches.empty()) {
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){
551 if(0!=branchToReadingWorker.size()) {
555 std::map<const Worker*,EarlyDeleteHelper*> alreadySeenWorkers;
557 size_t nextOpenIndex = 0;
559 for(
auto& branchAndWorker:branchToReadingWorker) {
560 if(lastBranchName != branchAndWorker.first) {
562 BranchID bid(branchAndWorker.first+
".");
564 lastBranchName = branchAndWorker.first;
566 auto found = alreadySeenWorkers.find(branchAndWorker.second);
567 if(alreadySeenWorkers.end() ==
found) {
572 size_t index = nextOpenIndex;
573 size_t nIndices = reserveSizeForWorker[branchAndWorker.second];
576 beginAddress+index+1,
579 alreadySeenWorkers.insert(std::make_pair(branchAndWorker.second,&(
earlyDeleteHelpers_.back())));
580 nextOpenIndex +=nIndices;
590 if(itLast->end() != it->begin()) {
592 unsigned int delta = it->begin()- itLast->end();
593 it->shiftIndexPointers(delta);
596 (itLast->end()-beginAddress),
598 (it->begin()-beginAddress));
607 p.setEarlyDeleteHelpers(alreadySeenWorkers);
610 p.setEarlyDeleteHelpers(alreadySeenWorkers);
618 std::set<std::string>
const& modulesInConfigSet,
621 std::map<
std::string, std::vector<std::pair<std::string, int> > >& outputModulePathPositions) {
637 std::string const moduleEdmType(
"@module_edm_type");
643 vstring::const_iterator iLabelsOnTriggerPaths = labelsOnTriggerPaths.begin();
644 vstring::const_iterator endLabelsOnTriggerPaths = labelsOnTriggerPaths.end();
646 vstring::const_iterator iShouldBeUsedLabels = shouldBeUsedLabels.begin();
647 vstring::const_iterator endShouldBeUsedLabels = shouldBeUsedLabels.end();
649 for (std::set<std::string>::const_iterator
i = modulesInConfigSet.begin(),
650 e = modulesInConfigSet.end();
i !=
e; ++
i) {
652 if (edmType == outputModule) {
653 labelsToBeDropped.push_back(*
i);
654 outputModuleLabels.push_back(*
i);
656 else if (edmType == edAnalyzer) {
657 while (iLabelsOnTriggerPaths != endLabelsOnTriggerPaths &&
658 *iLabelsOnTriggerPaths < *
i) {
659 ++iLabelsOnTriggerPaths;
661 if (iLabelsOnTriggerPaths == endLabelsOnTriggerPaths ||
662 *iLabelsOnTriggerPaths != *
i) {
663 labelsToBeDropped.push_back(*
i);
666 else if (edmType == edFilter || edmType == edProducer) {
667 while (iShouldBeUsedLabels != endShouldBeUsedLabels &&
668 *iShouldBeUsedLabels < *
i) {
669 ++iShouldBeUsedLabels;
671 if (iShouldBeUsedLabels != endShouldBeUsedLabels &&
672 *iShouldBeUsedLabels == *
i) {
673 labelsToBeDropped.push_back(*
i);
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());
690 iEndPath != endEndPath;
693 vstring::iterator iSave = labels.begin();
694 vstring::iterator iBegin = labels.begin();
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);
703 if (iSave != iLabel) {
704 iSave->swap(*iLabel);
709 labels.erase(iSave, labels.end());
710 if (labels.empty()) {
713 endPathsToBeDropped.push_back(*iEndPath);
722 endAfterRemove = std::remove_if(scheduledPaths.begin(), scheduledPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
723 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
728 endAfterRemove = std::remove_if(scheduledEndPaths.begin(), scheduledEndPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
729 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
738 int maxEventSpecs = 0;
739 int maxEventsOut = -1;
746 std::vector<std::string> psetNamesE;
753 if (maxEventSpecs > 1) {
755 "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
761 if (vMaxEventsOut != 0 && !vMaxEventsOut->
empty()) {
762 std::string moduleLabel = (*it)->description().moduleLabel();
767 "\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
770 (*it)->configure(desc);
781 if (!(*it)->limitReached()) {
786 LogInfo(
"SuccessfulTermination")
787 <<
"The job is terminating successfully because each output module\n"
788 <<
"has reached its configured limit.\n";
794 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
800 vstring::iterator it(modnames.begin()), ie(modnames.end());
803 for (; it != ie; ++it) {
805 if (labelsOnPaths) labelsOnPaths->push_back(*it);
822 "The unknown module label \"" << moduleLabel <<
823 "\" appears in " << pathType <<
" \"" << name <<
824 "\"\n please check spelling or remove that label from the path.";
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";
844 tmpworkers.emplace_back(worker, filterAction);
847 out.swap(tmpworkers);
852 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
854 vstring* labelsOnTriggerPaths) {
857 fillWorkers(proc_pset, preg, processConfiguration, name,
false, tmpworkers, labelsOnTriggerPaths);
859 for (PathWorkers::iterator wi(tmpworkers.begin()),
860 we(tmpworkers.end()); wi != we; ++wi) {
861 holder.push_back(wi->getWorker());
865 if (!tmpworkers.empty()) {
880 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
883 fillWorkers(proc_pset, preg, processConfiguration, name,
true, tmpworkers, 0);
886 for (PathWorkers::iterator wi(tmpworkers.begin()), we(tmpworkers.end()); wi != we; ++wi) {
887 holder.push_back(wi->getWorker());
890 if (!tmpworkers.empty()) {
901 bool failure =
false;
903 for (; ai != ae; ++ai) {
926 TrigPaths::const_iterator
pi, pe;
931 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Event Summary ------------";
946 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Path Summary ------------";
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" <<
" "
956 for (; pi != pe; ++
pi) {
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() <<
" "
970 for (; epi != epe; ++epi, ++epn) {
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 <<
" "
983 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"-------End-Path Summary ------------";
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" <<
" "
993 for (; pi != pe; ++
pi) {
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() <<
"";
1006 for (; pi != pe; ++
pi) {
1008 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Modules in Path: " << pi->name() <<
" ------------";
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" <<
" "
1017 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
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() <<
"";
1031 for (; pi != pe; ++
pi) {
1033 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"------ Modules in End-Path: " << pi->name() <<
" ------------";
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" <<
" "
1042 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
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() <<
"";
1055 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Module Summary ------------";
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" <<
" "
1065 for (; ai != ae; ++ai) {
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() <<
"";
1079 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Event Summary ---[sec]----";
1081 << std::setprecision(6) << std::fixed
1087 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Path Summary ---[sec]----";
1089 << std::right << std::setw(22) <<
"per event "
1090 << std::right << std::setw(22) <<
"per path-run "
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" <<
" "
1100 for (; pi != pe; ++
pi) {
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() <<
"";
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" <<
" "
1116 << std::right << std::setw(22) <<
"per event "
1117 << std::right << std::setw(22) <<
"per path-run "
1121 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"-------End-Path Summary ---[sec]----";
1123 << std::right << std::setw(22) <<
"per event "
1124 << std::right << std::setw(22) <<
"per endpath-run "
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" <<
" "
1134 for (; pi != pe; ++
pi) {
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() <<
"";
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" <<
" "
1150 << std::right << std::setw(22) <<
"per event "
1151 << std::right << std::setw(22) <<
"per endpath-run "
1156 for (; pi != pe; ++
pi) {
1158 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Modules in Path: " << pi->name() <<
" ---[sec]----";
1160 << std::right << std::setw(22) <<
"per event "
1161 << std::right << std::setw(22) <<
"per module-visit "
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" <<
" "
1169 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
1171 << std::setprecision(6) << std::fixed
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() <<
"";
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" <<
" "
1186 << std::right << std::setw(22) <<
"per event "
1187 << std::right << std::setw(22) <<
"per module-visit "
1192 for (; pi != pe; ++
pi) {
1194 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"------ Modules in End-Path: " << pi->name() <<
" ---[sec]----";
1196 << std::right << std::setw(22) <<
"per event "
1197 << std::right << std::setw(22) <<
"per module-visit "
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" <<
" "
1205 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
1207 << std::setprecision(6) << std::fixed
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() <<
"";
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" <<
" "
1222 << std::right << std::setw(22) <<
"per event "
1223 << std::right << std::setw(22) <<
"per module-visit "
1227 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Module Summary ---[sec]----";
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 "
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" <<
" "
1243 for (; ai != ae; ++ai) {
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() <<
"";
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" <<
" "
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 "
1269 LogVerbatim(
"FwkSummary") <<
"T---Report end!" <<
"";
1321 worker->updateLookup(
InRun,*runLookup);
1322 worker->updateLookup(
InLumi,*lumiLookup);
1323 worker->updateLookup(
InEvent,*eventLookup);
1341 it != itEnd; ++it) {
1342 if ((*it)->description().moduleLabel() == iLabel) {
1352 wm->swapModule(found, iPSet);
1357 std::vector<ModuleDescription const*>
1362 std::vector<ModuleDescription const*>
result;
1365 for (; i !=
e; ++
i) {
1367 result.push_back(p);
1377 std::back_inserter(oLabelsToFill),
1383 std::vector<std::string>& oLabelsToFill)
const {
1384 TrigPaths::const_iterator itFound =
1387 boost::bind(std::equal_to<std::string>(),
1391 oLabelsToFill.reserve(itFound->size());
1392 for (
size_t i = 0;
i < itFound->size(); ++
i) {
1393 oLabelsToFill.push_back(itFound->getWorker(
i)->description().moduleLabel());
1433 std::vector<ModuleInPathSummary>
temp(sz);
1434 for (
size_t i = 0;
i != sz; ++
i) {
1506 ++(earlyDeleteBranchToCount_[
index].second);
T getParameter(std::string const &) const
std::vector< PathSummary > endPathSummaries
void initializeEarlyDelete(edm::ParameterSet const &opts, edm::ProductRegistry const &preg, edm::ParameterSet const *subProcPSet)
T getUntrackedParameter(std::string const &, T const &) const
void addException(cms::Exception const &exception)
std::pair< double, double > timeCpuReal() const
void fillWorkerSummary(Worker const *pw, WorkerSummary &sum)
ModuleDescription const & description() const
std::vector< BranchIDList > BranchIDLists
roAction_t actions[nactions]
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
void fillWorkerSummaryAux(Worker const &w, WorkerSummary &sum)
AllOutputWorkers all_output_workers_
WorkerPtr results_inserter_
bool endPathsEnabled() const
void respondToCloseInputFile(FileBlock const &fb)
std::vector< std::string > vstring
bool changeModule(std::string const &iLabel, ParameterSet const &iPSet)
void writeLumi(LuminosityBlockPrincipal const &lbp)
std::vector< EarlyDeleteHelper > earlyDeleteHelpers_
WorkerRegistry worker_reg_
ParameterSetID id() const
WorkersInPath::size_type size_type
static ThreadSafeRegistry * instance()
std::vector< ParameterSet > VParameterSet
std::vector< WorkerInPath > PathWorkers
void respondToOpenOutputFiles(FileBlock const &fb)
void enableEndPaths(bool active)
std::string const & moduleName() const
bool getMapped(key_type const &k, value_type &result) const
TrigResPtr endpath_results_
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)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName, BranchDescription::MatchMode m)
std::vector< WorkerSummary > workerSummaries
bool insertMapped(value_type const &v)
std::string const & moduleLabel() const
boost::shared_ptr< HLTGlobalStatus > TrigResPtr
bool shouldWeCloseFile() const
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
void writeLumi(LuminosityBlockPrincipal const &lbp)
int totalEventsFailed() const
void fillEndPath(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name)
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
boost::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
void openFile(FileBlock const &fb)
ProductList const & productList() const
int totalEventsPassed() const
std::vector< PathSummary > trigPathSummaries
EventSummary eventSummary
void limitOutput(ParameterSet const &proc_pset, BranchIDLists const &branchIDLists)
const T & max(const T &a, const T &b)
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)
boost::array< Selections, NumBranchTypes > SelectionsArray
SelectionsArray const & keptProducts() const
void stdToEDM(std::exception const &e)
std::vector< int > empty_trig_paths_
void addParameter(std::string const &name, T const &value)
void clearCounters()
Clear all the counters in the trigger report.
void respondToCloseOutputFiles(FileBlock const &fb)
std::vector< std::string > vstring
BranchIDLists const & branchIDLists() const
bool terminate() const
Return whether each output module has reached its maximum count.
void eraseSimpleParameter(std::string const &name)
void respondToOpenInputFile(FileBlock const &fb)
ActionTable const * act_table_
std::vector< Worker * > Workers
AllWorkers::const_iterator workersBegin() const
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void getTriggerReport(TriggerReport &rep) const
void setFrozen(bool initializeLookupInfo=true) const
virtual Types moduleType() const =0
boost::shared_ptr< Worker > WorkerPtr
void respondToOpenOutputFiles(FileBlock const &fb)
void respondToCloseOutputFiles(FileBlock const &fb)
void charPtrToEDM(char const *c)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
void stringToEDM(std::string &s)
ParameterSet const & getParameterSet(std::string const &) const
volatile bool endpathsAreActive_
void respondToOpenInputFile(FileBlock const &fb)
bool search_all(ForwardSequence const &s, Datum const &d)
void fillModuleInPathSummary(Path const &, ModuleInPathSummary &)
int timesVisited(size_type i) const
vstring empty_trig_path_names_
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 ...
bool anyProductProduced() const
void respondToCloseInputFile(FileBlock const &fb)
void fillPathSummary(Path const &path, PathSummary &sum)
void preForkReleaseResources()
std::string const & name() const
void postForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void updateRegistries(ProductRegistry const ®)
std::vector< unsigned int > earlyDeleteHelperToBranchIndicies_
std::vector< ModuleDescription const * > getAllModuleDescriptions() const
Worker const * getWorker(size_type i) const
void fillTrigPath(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, int bitpos, std::string const &name, TrigResPtr, vstring *labelsOnTriggerPaths)
Worker * getWorker(WorkerParams const &p, std::string const &moduleLabel)
Retrieve the particular instance of the worker.
void openNewFileIfNeeded()
void beginJob(ProductRegistry const &)
void setUnscheduledHandler(boost::shared_ptr< UnscheduledHandler > iHandler)
std::vector< ModuleInPathSummary > moduleInPathSummaries
void openNewOutputFilesIfNeeded()
size_t getParameterSetNames(std::vector< std::string > &output, bool trackiness=true) const
void preForkReleaseResources()
void openOutputFiles(FileBlock &fb)
void writeRun(RunPrincipal const &rp)
std::vector< std::pair< BranchID, unsigned int > > earlyDeleteBranchToCount_
void endJob(ExceptionCollector &collector)
ParameterSet const & registerIt()
bool shouldWeCloseOutput() const
void setupOnDemandSystem(EventPrincipal &principal, EventSetup const &es)
tuple size
Write out results.
void writeRun(RunPrincipal const &rp)
void fillWorkers(ParameterSet &proc_pset, ProductRegistry &preg, boost::shared_ptr< ProcessConfiguration const > processConfiguration, std::string const &name, bool ignoreFilters, PathWorkers &out, vstring *labelsOnPaths)
T get(const Candidate &c)
vstring end_path_name_list_
AllWorkers::const_iterator workersEnd() const
void addToAllWorkers(Worker *w)
boost::shared_ptr< ActivityRegistry > actReg_
ParameterSet * getPSetForUpdate(std::string const &name, bool &isTracked)
boost::shared_ptr< UnscheduledCallProducer > unscheduled_