26 #include "boost/bind.hpp"
27 #include "boost/ref.hpp"
44 template <
typename InputIterator,
typename ForwardIterator,
typename Func>
46 transform_into(InputIterator
begin, InputIterator
end,
47 ForwardIterator
out, Func func) {
48 for (; begin !=
end; ++
begin, ++
out) func(*begin, *out);
56 template <
typename FROM,
typename TO,
typename FUNC>
58 fill_summary(FROM
const&
from, TO&
to, FUNC func) {
60 transform_into(from.begin(), from.end(),
temp.begin(), func);
71 ProductRegistry& preg,
73 boost::shared_ptr<ActivityRegistry> areg,
74 boost::shared_ptr<ProcessConfiguration> processConfiguration,
77 ParameterSet* trig_pset = proc_pset.getPSetForUpdate(
"@trigger_paths");
78 trig_pset->registerIt();
80 WorkerParams work_args(proc_pset, trig_pset, preg, processConfiguration, actions);
81 ModuleDescription md(trig_pset->id(),
82 "TriggerResultInserter",
84 processConfiguration.get());
86 areg->preModuleConstructionSignal_(md);
87 std::auto_ptr<EDProducer>
producer(
new TriggerResultInserter(*trig_pset, trptr));
88 areg->postModuleConstructionSignal_(md);
91 ptr->setActivityRegistry(areg);
95 bool binary_search_string(std::vector<std::string>
const&
v, std::string
const&
s) {
96 return std::binary_search(v.begin(), v.end(),
s);
101 ProductRegistry
const& preg,
102 std::multimap<std::string,Worker*>& branchToReadingWorker)
105 auto vBranchesToDeleteEarly = opts.getUntrackedParameter<std::vector<std::string>>(
"canDeleteEarly",std::vector<std::string>());
106 if(not vBranchesToDeleteEarly.empty()) {
107 std::sort(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),std::less<std::string>());
108 vBranchesToDeleteEarly.erase(std::unique(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end()),
109 vBranchesToDeleteEarly.end());
112 auto allBranchNames = preg.allBranchNames();
114 for(
auto &
b:allBranchNames) {
115 b.resize(
b.size()-1);
117 std::sort(allBranchNames.begin(),allBranchNames.end(),std::less<std::string>());
118 std::vector<std::string>
temp;
119 temp.reserve(vBranchesToDeleteEarly.size());
121 std::set_intersection(vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),
122 allBranchNames.begin(),allBranchNames.end(),
123 std::back_inserter(temp));
124 vBranchesToDeleteEarly.swap(temp);
125 if(temp.size() != vBranchesToDeleteEarly.size()) {
126 std::vector<std::string> missingProducts;
127 std::set_difference(temp.begin(),temp.end(),
128 vBranchesToDeleteEarly.begin(),vBranchesToDeleteEarly.end(),
129 std::back_inserter(missingProducts));
130 LogInfo
l(
"MissingProductsForCanDeleteEarly");
131 l<<
"The following products in the 'canDeleteEarly' list are not available in this job and will be ignored.";
132 for(
auto const&
n:missingProducts){
138 for(
auto const& branch:vBranchesToDeleteEarly) {
139 branchToReadingWorker.insert(make_pair(branch,
nullptr));
155 boost::shared_ptr<ActivityRegistry> areg,
156 boost::shared_ptr<ProcessConfiguration> processConfiguration,
159 act_table_(&actions),
162 trig_name_list_(tns.getTrigPaths()),
163 end_path_name_list_(tns.getEndPaths()),
168 all_output_workers_(),
174 stopwatch_(wantSummary_? new
RunStopwatch::StopwatchPointer::element_type : static_cast<
RunStopwatch::StopwatchPointer::element_type*> (0)),
176 endpathsAreActive_(
true) {
179 bool hasPath =
false;
187 fillTrigPath(proc_pset, preg, processConfiguration, trig_bitpos, *
i,
results_, &labelsOnTriggerPaths);
205 for (
int bitpos = 0; eib != eie; ++eib, ++bitpos) {
206 fillEndPath(proc_pset, preg, processConfiguration, bitpos, *eib);
210 std::set<std::string> usedWorkerLabels;
214 usedWorkerLabels.insert((*itWorker)->description().moduleLabel());
216 std::vector<std::string> modulesInConfig(proc_pset.
getParameter<std::vector<std::string> >(
"@all_modules"));
217 std::set<std::string> modulesInConfigSet(modulesInConfig.begin(), modulesInConfig.end());
218 std::vector<std::string> unusedLabels;
219 set_difference(modulesInConfigSet.begin(), modulesInConfigSet.end(),
220 usedWorkerLabels.begin(), usedWorkerLabels.end(),
221 back_inserter(unusedLabels));
224 std::set<std::string> unscheduledLabels;
225 std::vector<std::string> shouldBeUsedLabels;
226 if (!unusedLabels.empty()) {
232 for (std::vector<std::string>::iterator itLabel = unusedLabels.begin(), itLabelEnd = unusedLabels.end();
233 itLabel != itLabelEnd;
235 if (allowUnscheduled) {
239 assert(modulePSet != 0);
245 unscheduledLabels.insert(*itLabel);
251 shouldBeUsedLabels.push_back(*itLabel);
255 shouldBeUsedLabels.push_back(*itLabel);
258 if (!shouldBeUsedLabels.empty()) {
259 std::ostringstream unusedStream;
260 unusedStream <<
"'" << shouldBeUsedLabels.front() <<
"'";
261 for (std::vector<std::string>::iterator itLabel = shouldBeUsedLabels.begin() + 1,
262 itLabelEnd = shouldBeUsedLabels.end();
263 itLabel != itLabelEnd;
265 unusedStream <<
",'" << *itLabel <<
"'";
268 <<
"The following module labels are not assigned to any path:\n"
269 << unusedStream.str()
273 if (!unscheduledLabels.empty()) {
274 for (ProductRegistry::ProductList::const_iterator it = preg.
productList().begin(),
278 if (it->second.produced() &&
279 it->second.branchType() ==
InEvent &&
280 unscheduledLabels.end() != unscheduledLabels.find(it->second.moduleLabel())) {
281 it->second.setOnDemand();
286 std::map<std::string, std::vector<std::pair<std::string, int> > > outputModulePathPositions;
287 reduceParameterSet(proc_pset, modulesInConfig, modulesInConfigSet, labelsOnTriggerPaths, shouldBeUsedLabels, outputModulePathPositions);
291 processConfiguration->setParameterSetID(proc_pset.
id());
335 if(subProcPSet)
return;
339 std::multimap<std::string,Worker*> branchToReadingWorker;
340 initializeBranchToReadingWorker(opts,preg,branchToReadingWorker);
343 if(branchToReadingWorker.size()==0) {
346 const std::vector<std::string> kEmpty;
347 std::map<Worker*,unsigned int> reserveSizeForWorker;
348 unsigned int upperLimitOnReadingWorker =0;
349 unsigned int upperLimitOnIndicies = 0;
350 unsigned int nUniqueBranchesToDelete=branchToReadingWorker.size();
356 if(branchToReadingWorker.size()>0) {
360 for(
auto const& item: kept[
InEvent]) {
361 auto found = branchToReadingWorker.equal_range(item->branchName());
363 --nUniqueBranchesToDelete;
364 branchToReadingWorker.erase(
found.first,
found.second);
369 if(branchToReadingWorker.size()>0) {
373 auto branches = pset->getUntrackedParameter<std::vector<std::string>>(
"mightGet",kEmpty);
374 if(not branches.empty()) {
375 ++upperLimitOnReadingWorker;
377 for(
auto const& branch:branches){
378 auto found = branchToReadingWorker.equal_range(branch);
380 ++upperLimitOnIndicies;
381 ++reserveSizeForWorker[*
i];
382 if(
nullptr ==
found.first->second) {
385 branchToReadingWorker.insert(make_pair(
found.first->first,*
i));
394 auto it = branchToReadingWorker.begin();
395 std::vector<std::string> unusedBranches;
396 while(it !=branchToReadingWorker.end()) {
397 if(it->second ==
nullptr) {
398 unusedBranches.push_back(it->first);
402 branchToReadingWorker.erase(temp);
407 if(not unusedBranches.empty()) {
409 l<<
"The following products in the 'canDeleteEarly' list are not used in this job and will be ignored.\n"
410 " If possible, remove the producer from the job or add the product to the producer's own 'mightGet' list.";
411 for(
auto const&
n:unusedBranches){
416 if(0!=branchToReadingWorker.size()) {
420 std::map<const Worker*,EarlyDeleteHelper*> alreadySeenWorkers;
421 std::string lastBranchName;
422 size_t nextOpenIndex = 0;
424 for(
auto& branchAndWorker:branchToReadingWorker) {
425 if(lastBranchName != branchAndWorker.first) {
427 BranchID bid(branchAndWorker.first+
".");
429 lastBranchName = branchAndWorker.first;
431 auto found = alreadySeenWorkers.find(branchAndWorker.second);
432 if(alreadySeenWorkers.end() ==
found) {
437 size_t index = nextOpenIndex;
438 size_t nIndices = reserveSizeForWorker[branchAndWorker.second];
441 beginAddress+index+1,
444 alreadySeenWorkers.insert(std::make_pair(branchAndWorker.second,&(
earlyDeleteHelpers_.back())));
445 nextOpenIndex +=nIndices;
455 if(itLast->end() != it->begin()) {
457 unsigned int delta = it->begin()- itLast->end();
458 it->shiftIndexPointers(delta);
461 (itLast->end()-beginAddress),
463 (it->begin()-beginAddress));
472 p.setEarlyDeleteHelpers(alreadySeenWorkers);
475 p.setEarlyDeleteHelpers(alreadySeenWorkers);
483 std::set<std::string>
const& modulesInConfigSet,
486 std::map<std::string, std::vector<std::pair<std::string, int> > >& outputModulePathPositions) {
502 std::string
const moduleEdmType(
"@module_edm_type");
503 std::string
const outputModule(
"OutputModule");
504 std::string
const edAnalyzer(
"EDAnalyzer");
505 std::string
const edFilter(
"EDFilter");
506 std::string
const edProducer(
"EDProducer");
508 vstring::const_iterator iLabelsOnTriggerPaths = labelsOnTriggerPaths.begin();
509 vstring::const_iterator endLabelsOnTriggerPaths = labelsOnTriggerPaths.end();
511 vstring::const_iterator iShouldBeUsedLabels = shouldBeUsedLabels.begin();
512 vstring::const_iterator endShouldBeUsedLabels = shouldBeUsedLabels.end();
514 for (std::set<std::string>::const_iterator
i = modulesInConfigSet.begin(),
515 e = modulesInConfigSet.end();
i !=
e; ++
i) {
517 if (edmType == outputModule) {
518 labelsToBeDropped.push_back(*
i);
519 outputModuleLabels.push_back(*
i);
521 else if (edmType == edAnalyzer) {
522 while (iLabelsOnTriggerPaths != endLabelsOnTriggerPaths &&
523 *iLabelsOnTriggerPaths < *
i) {
524 ++iLabelsOnTriggerPaths;
526 if (iLabelsOnTriggerPaths == endLabelsOnTriggerPaths ||
527 *iLabelsOnTriggerPaths != *
i) {
528 labelsToBeDropped.push_back(*
i);
531 else if (edmType == edFilter || edmType == edProducer) {
532 while (iShouldBeUsedLabels != endShouldBeUsedLabels &&
533 *iShouldBeUsedLabels < *
i) {
534 ++iShouldBeUsedLabels;
536 if (iShouldBeUsedLabels != endShouldBeUsedLabels &&
537 *iShouldBeUsedLabels == *
i) {
538 labelsToBeDropped.push_back(*
i);
547 vstring::iterator endAfterRemove = std::remove_if(modulesInConfig.begin(), modulesInConfig.end(), boost::bind(binary_search_string, boost::ref(labelsToBeDropped), _1));
548 modulesInConfig.erase(endAfterRemove, modulesInConfig.end());
555 iEndPath != endEndPath;
558 vstring::iterator iSave = labels.begin();
559 vstring::iterator iBegin = labels.begin();
561 for (vstring::iterator iLabel = labels.begin(), iEnd = labels.end();
562 iLabel != iEnd; ++iLabel) {
563 if (binary_search_string(labelsToBeDropped, *iLabel)) {
564 if (binary_search_string(outputModuleLabels, *iLabel)) {
565 outputModulePathPositions[*iLabel].push_back(std::pair<std::string, int>(*iEndPath, iSave - iBegin));
568 if (iSave != iLabel) {
569 iSave->swap(*iLabel);
574 labels.erase(iSave, labels.end());
575 if (labels.empty()) {
578 endPathsToBeDropped.push_back(*iEndPath);
587 endAfterRemove = std::remove_if(scheduledPaths.begin(), scheduledPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
588 scheduledPaths.erase(endAfterRemove, scheduledPaths.end());
593 endAfterRemove = std::remove_if(scheduledEndPaths.begin(), scheduledEndPaths.end(), boost::bind(binary_search_string, boost::ref(endPathsToBeDropped), _1));
594 scheduledEndPaths.erase(endAfterRemove, scheduledEndPaths.end());
600 std::string
const output(
"output");
603 int maxEventSpecs = 0;
604 int maxEventsOut = -1;
611 std::vector<std::string> psetNamesE;
618 if (maxEventSpecs > 1) {
620 "\nAt most, one form of 'output' may appear in the 'maxEvents' parameter set";
623 if (maxEventSpecs == 0) {
630 if (vMaxEventsOut != 0 && !vMaxEventsOut->
empty()) {
631 std::string moduleLabel = (*it)->description().moduleLabel();
636 "\nNo entry in 'maxEvents' for output module label '" << moduleLabel <<
"'.\n";
639 (*it)->configure(desc);
650 if (!(*it)->limitReached()) {
655 LogInfo(
"SuccessfulTermination")
656 <<
"The job is terminating successfully because each output module\n"
657 <<
"has reached its configured limit.\n";
663 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
664 std::string
const&
name,
669 vstring::iterator it(modnames.begin()), ie(modnames.end());
672 for (; it != ie; ++it) {
674 if (labelsOnPaths) labelsOnPaths->push_back(*it);
680 std::string moduleLabel = *it;
686 std::string pathType(
"endpath");
688 pathType = std::string(
"path");
691 "The unknown module label \"" << moduleLabel <<
692 "\" appears in " << pathType <<
" \"" << name <<
693 "\"\n please check spelling or remove that label from the path.";
707 <<
"The EDFilter '" << worker->
description().
moduleName() <<
"' with module label '" << moduleLabel <<
"' appears on EndPath '" << name <<
"'.\n"
708 <<
"The return value of the filter will be ignored.\n"
709 <<
"To suppress this warning, either remove the filter from the endpath,\n"
710 <<
"or explicitly ignore it in the configuration by using cms.ignore().\n";
714 tmpworkers.push_back(w);
717 out.swap(tmpworkers);
722 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
724 vstring* labelsOnTriggerPaths) {
727 fillWorkers(proc_pset, preg, processConfiguration, name,
false, tmpworkers, labelsOnTriggerPaths);
729 for (PathWorkers::iterator wi(tmpworkers.begin()),
730 we(tmpworkers.end()); wi != we; ++wi) {
731 holder.push_back(wi->getWorker());
735 if (!tmpworkers.empty()) {
747 boost::shared_ptr<ProcessConfiguration const> processConfiguration,
748 int bitpos, std::string
const&
name) {
750 fillWorkers(proc_pset, preg, processConfiguration, name,
true, tmpworkers, 0);
753 for (PathWorkers::iterator wi(tmpworkers.begin()), we(tmpworkers.end()); wi != we; ++wi) {
754 holder.push_back(wi->getWorker());
757 if (!tmpworkers.empty()) {
768 bool failure =
false;
770 for (; ai != ae; ++ai) {
793 TrigPaths::const_iterator
pi, pe;
798 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Event Summary ------------";
806 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Path Summary ------------";
808 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
809 << std::right << std::setw(10) <<
"Run" <<
" "
810 << std::right << std::setw(10) <<
"Passed" <<
" "
811 << std::right << std::setw(10) <<
"Failed" <<
" "
812 << std::right << std::setw(10) <<
"Error" <<
" "
816 for (; pi != pe; ++
pi) {
818 << std::right << std::setw(5) << 1
819 << std::right << std::setw(5) << pi->bitPosition() <<
" "
820 << std::right << std::setw(10) << pi->timesRun() <<
" "
821 << std::right << std::setw(10) << pi->timesPassed() <<
" "
822 << std::right << std::setw(10) << pi->timesFailed() <<
" "
823 << std::right << std::setw(10) << pi->timesExcept() <<
" "
828 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"-------End-Path Summary ------------";
830 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
831 << std::right << std::setw(10) <<
"Run" <<
" "
832 << std::right << std::setw(10) <<
"Passed" <<
" "
833 << std::right << std::setw(10) <<
"Failed" <<
" "
834 << std::right << std::setw(10) <<
"Error" <<
" "
838 for (; pi != pe; ++
pi) {
840 << std::right << std::setw(5) << 0
841 << std::right << std::setw(5) << pi->bitPosition() <<
" "
842 << std::right << std::setw(10) << pi->timesRun() <<
" "
843 << std::right << std::setw(10) << pi->timesPassed() <<
" "
844 << std::right << std::setw(10) << pi->timesFailed() <<
" "
845 << std::right << std::setw(10) << pi->timesExcept() <<
" "
851 for (; pi != pe; ++
pi) {
853 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Modules in Path: " << pi->name() <<
" ------------";
855 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
856 << std::right << std::setw(10) <<
"Visited" <<
" "
857 << std::right << std::setw(10) <<
"Passed" <<
" "
858 << std::right << std::setw(10) <<
"Failed" <<
" "
859 << std::right << std::setw(10) <<
"Error" <<
" "
862 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
864 << std::right << std::setw(5) << 1
865 << std::right << std::setw(5) << pi->bitPosition() <<
" "
866 << std::right << std::setw(10) << pi->timesVisited(
i) <<
" "
867 << std::right << std::setw(10) << pi->timesPassed(
i) <<
" "
868 << std::right << std::setw(10) << pi->timesFailed(
i) <<
" "
869 << std::right << std::setw(10) << pi->timesExcept(
i) <<
" "
870 << pi->getWorker(
i)->description().moduleLabel() <<
"";
876 for (; pi != pe; ++
pi) {
878 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"------ Modules in End-Path: " << pi->name() <<
" ------------";
880 << std::right << std::setw(10) <<
"Trig Bit#" <<
" "
881 << std::right << std::setw(10) <<
"Visited" <<
" "
882 << std::right << std::setw(10) <<
"Passed" <<
" "
883 << std::right << std::setw(10) <<
"Failed" <<
" "
884 << std::right << std::setw(10) <<
"Error" <<
" "
887 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
889 << std::right << std::setw(5) << 0
890 << std::right << std::setw(5) << pi->bitPosition() <<
" "
891 << std::right << std::setw(10) << pi->timesVisited(
i) <<
" "
892 << std::right << std::setw(10) << pi->timesPassed(
i) <<
" "
893 << std::right << std::setw(10) << pi->timesFailed(
i) <<
" "
894 << std::right << std::setw(10) << pi->timesExcept(
i) <<
" "
895 << pi->getWorker(
i)->description().moduleLabel() <<
"";
900 LogVerbatim(
"FwkSummary") <<
"TrigReport " <<
"---------- Module Summary ------------";
902 << std::right << std::setw(10) <<
"Visited" <<
" "
903 << std::right << std::setw(10) <<
"Run" <<
" "
904 << std::right << std::setw(10) <<
"Passed" <<
" "
905 << std::right << std::setw(10) <<
"Failed" <<
" "
906 << std::right << std::setw(10) <<
"Error" <<
" "
910 for (; ai != ae; ++ai) {
912 << std::right << std::setw(10) << (*ai)->timesVisited() <<
" "
913 << std::right << std::setw(10) << (*ai)->timesRun() <<
" "
914 << std::right << std::setw(10) << (*ai)->timesPassed() <<
" "
915 << std::right << std::setw(10) << (*ai)->timesFailed() <<
" "
916 << std::right << std::setw(10) << (*ai)->timesExcept() <<
" "
917 << (*ai)->description().moduleLabel() <<
"";
924 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Event Summary ---[sec]----";
926 << std::setprecision(6) << std::fixed
932 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Path Summary ---[sec]----";
934 << std::right << std::setw(22) <<
"per event "
935 << std::right << std::setw(22) <<
"per path-run "
938 << std::right << std::setw(10) <<
"CPU" <<
" "
939 << std::right << std::setw(10) <<
"Real" <<
" "
940 << std::right << std::setw(10) <<
"CPU" <<
" "
941 << std::right << std::setw(10) <<
"Real" <<
" "
945 for (; pi != pe; ++
pi) {
947 << std::setprecision(6) << std::fixed
948 << std::right << std::setw(10) << pi->timeCpuReal().first/
std::max(1,
totalEvents()) <<
" "
949 << std::right << std::setw(10) << pi->timeCpuReal().second/
std::max(1,
totalEvents()) <<
" "
950 << std::right << std::setw(10) << pi->timeCpuReal().first/
std::max(1, pi->timesRun()) <<
" "
951 << std::right << std::setw(10) << pi->timeCpuReal().second/
std::max(1, pi->timesRun()) <<
" "
955 << std::right << std::setw(10) <<
"CPU" <<
" "
956 << std::right << std::setw(10) <<
"Real" <<
" "
957 << std::right << std::setw(10) <<
"CPU" <<
" "
958 << std::right << std::setw(10) <<
"Real" <<
" "
961 << std::right << std::setw(22) <<
"per event "
962 << std::right << std::setw(22) <<
"per path-run "
966 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"-------End-Path Summary ---[sec]----";
968 << std::right << std::setw(22) <<
"per event "
969 << std::right << std::setw(22) <<
"per endpath-run "
972 << std::right << std::setw(10) <<
"CPU" <<
" "
973 << std::right << std::setw(10) <<
"Real" <<
" "
974 << std::right << std::setw(10) <<
"CPU" <<
" "
975 << std::right << std::setw(10) <<
"Real" <<
" "
979 for (; pi != pe; ++
pi) {
981 << std::setprecision(6) << std::fixed
982 << std::right << std::setw(10) << pi->timeCpuReal().first/
std::max(1,
totalEvents()) <<
" "
983 << std::right << std::setw(10) << pi->timeCpuReal().second/
std::max(1,
totalEvents()) <<
" "
984 << std::right << std::setw(10) << pi->timeCpuReal().first/
std::max(1, pi->timesRun()) <<
" "
985 << std::right << std::setw(10) << pi->timeCpuReal().second/
std::max(1, pi->timesRun()) <<
" "
989 << std::right << std::setw(10) <<
"CPU" <<
" "
990 << std::right << std::setw(10) <<
"Real" <<
" "
991 << std::right << std::setw(10) <<
"CPU" <<
" "
992 << std::right << std::setw(10) <<
"Real" <<
" "
995 << std::right << std::setw(22) <<
"per event "
996 << std::right << std::setw(22) <<
"per endpath-run "
1001 for (; pi != pe; ++
pi) {
1003 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Modules in Path: " << pi->name() <<
" ---[sec]----";
1005 << std::right << std::setw(22) <<
"per event "
1006 << std::right << std::setw(22) <<
"per module-visit "
1009 << std::right << std::setw(10) <<
"CPU" <<
" "
1010 << std::right << std::setw(10) <<
"Real" <<
" "
1011 << std::right << std::setw(10) <<
"CPU" <<
" "
1012 << std::right << std::setw(10) <<
"Real" <<
" "
1014 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
1016 << std::setprecision(6) << std::fixed
1019 << std::right << std::setw(10) << pi->timeCpuReal(
i).first/
std::max(1, pi->timesVisited(
i)) <<
" "
1020 << std::right << std::setw(10) << pi->timeCpuReal(
i).second/
std::max(1, pi->timesVisited(
i)) <<
" "
1021 << pi->getWorker(
i)->description().moduleLabel() <<
"";
1025 << std::right << std::setw(10) <<
"CPU" <<
" "
1026 << std::right << std::setw(10) <<
"Real" <<
" "
1027 << std::right << std::setw(10) <<
"CPU" <<
" "
1028 << std::right << std::setw(10) <<
"Real" <<
" "
1031 << std::right << std::setw(22) <<
"per event "
1032 << std::right << std::setw(22) <<
"per module-visit "
1037 for (; pi != pe; ++
pi) {
1039 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"------ Modules in End-Path: " << pi->name() <<
" ---[sec]----";
1041 << std::right << std::setw(22) <<
"per event "
1042 << std::right << std::setw(22) <<
"per module-visit "
1045 << std::right << std::setw(10) <<
"CPU" <<
" "
1046 << std::right << std::setw(10) <<
"Real" <<
" "
1047 << std::right << std::setw(10) <<
"CPU" <<
" "
1048 << std::right << std::setw(10) <<
"Real" <<
" "
1050 for (
unsigned int i = 0;
i < pi->size(); ++
i) {
1052 << std::setprecision(6) << std::fixed
1055 << std::right << std::setw(10) << pi->timeCpuReal(
i).first/
std::max(1, pi->timesVisited(
i)) <<
" "
1056 << std::right << std::setw(10) << pi->timeCpuReal(
i).second/
std::max(1, pi->timesVisited(
i)) <<
" "
1057 << pi->getWorker(
i)->description().moduleLabel() <<
"";
1061 << std::right << std::setw(10) <<
"CPU" <<
" "
1062 << std::right << std::setw(10) <<
"Real" <<
" "
1063 << std::right << std::setw(10) <<
"CPU" <<
" "
1064 << std::right << std::setw(10) <<
"Real" <<
" "
1067 << std::right << std::setw(22) <<
"per event "
1068 << std::right << std::setw(22) <<
"per module-visit "
1072 LogVerbatim(
"FwkSummary") <<
"TimeReport " <<
"---------- Module Summary ---[sec]----";
1074 << std::right << std::setw(22) <<
"per event "
1075 << std::right << std::setw(22) <<
"per module-run "
1076 << std::right << std::setw(22) <<
"per module-visit "
1079 << std::right << std::setw(10) <<
"CPU" <<
" "
1080 << std::right << std::setw(10) <<
"Real" <<
" "
1081 << std::right << std::setw(10) <<
"CPU" <<
" "
1082 << std::right << std::setw(10) <<
"Real" <<
" "
1083 << std::right << std::setw(10) <<
"CPU" <<
" "
1084 << std::right << std::setw(10) <<
"Real" <<
" "
1088 for (; ai != ae; ++ai) {
1090 << std::setprecision(6) << std::fixed
1091 << std::right << std::setw(10) << (*ai)->timeCpuReal().first/
std::max(1,
totalEvents()) <<
" "
1092 << std::right << std::setw(10) << (*ai)->timeCpuReal().second/
std::max(1,
totalEvents()) <<
" "
1093 << std::right << std::setw(10) << (*ai)->timeCpuReal().first/
std::max(1, (*ai)->timesRun()) <<
" "
1094 << std::right << std::setw(10) << (*ai)->timeCpuReal().second/
std::max(1, (*ai)->timesRun()) <<
" "
1095 << std::right << std::setw(10) << (*ai)->timeCpuReal().first/
std::max(1, (*ai)->timesVisited()) <<
" "
1096 << std::right << std::setw(10) << (*ai)->timeCpuReal().second/
std::max(1, (*ai)->timesVisited()) <<
" "
1097 << (*ai)->description().moduleLabel() <<
"";
1100 << std::right << std::setw(10) <<
"CPU" <<
" "
1101 << std::right << std::setw(10) <<
"Real" <<
" "
1102 << std::right << std::setw(10) <<
"CPU" <<
" "
1103 << std::right << std::setw(10) <<
"Real" <<
" "
1104 << std::right << std::setw(10) <<
"CPU" <<
" "
1105 << std::right << std::setw(10) <<
"Real" <<
" "
1108 << std::right << std::setw(22) <<
"per event "
1109 << std::right << std::setw(22) <<
"per module-run "
1110 << std::right << std::setw(22) <<
"per module-visit "
1114 LogVerbatim(
"FwkSummary") <<
"T---Report end!" <<
"";
1177 it != itEnd; ++it) {
1178 if ((*it)->description().moduleLabel() == iLabel) {
1188 wm->swapModule(found, iPSet);
1193 std::vector<ModuleDescription const*>
1198 std::vector<ModuleDescription const*>
result;
1201 for (; i !=
e; ++
i) {
1203 result.push_back(p);
1213 std::back_inserter(oLabelsToFill),
1219 std::vector<std::string>& oLabelsToFill)
const {
1220 TrigPaths::const_iterator itFound =
1223 boost::bind(std::equal_to<std::string>(),
1227 oLabelsToFill.reserve(itFound->size());
1228 for (
size_t i = 0;
i < itFound->size(); ++
i) {
1229 oLabelsToFill.push_back(itFound->getWorker(
i)->description().moduleLabel());
1269 std::vector<ModuleInPathSummary>
temp(sz);
1270 for (
size_t i = 0;
i != sz; ++
i) {
1342 ++(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
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)
void limitOutput(ParameterSet const &proc_pset)
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
std::vector< WorkerInPath > PathWorkers
void respondToOpenOutputFiles(FileBlock const &fb)
void enableEndPaths(bool active)
std::string const & moduleName() const
static ThreadSafeRegistry * instance()
TrigResPtr endpath_results_
std::vector< WorkerSummary > workerSummaries
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
void openFile(FileBlock const &fb)
ProductList const & productList() const
int totalEventsPassed() const
bool getMapped(key_type const &k, value_type &result) const
std::vector< PathSummary > trigPathSummaries
EventSummary eventSummary
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)
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
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
Schedule(ParameterSet &proc_pset, service::TriggerNamesService &tns, ProductRegistry &pregistry, ActionTable const &actions, boost::shared_ptr< ActivityRegistry > areg, boost::shared_ptr< ProcessConfiguration > processConfiguration, const ParameterSet *subProcPSet)
static std::string from(" from ")
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
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)
static void updateRegistries(ProductRegistry const ®)
author Stefano ARGIRO author Bill Tanenbaum
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 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)
bool insertMapped(value_type const &v)
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_