CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
HLTPerformanceInfo Class Reference

#include <HLTPerformanceInfo.h>

Classes

class  Module
 
class  Path
 

Public Types

typedef std::vector< ModuleModules
 
typedef std::vector< cms_uint32_tModulesInPath
 
typedef std::vector< PathPathList
 

Public Member Functions

void addModule (const Module &m)
 
void addModuleToPath (const char *mod, const char *path)
 
void addModuleToPath (const size_t mod, const size_t path)
 
void addPath (const Path &p)
 
Modules::const_iterator beginModules () const
 
PathList::iterator beginPaths ()
 
void clear ()
 
void clearModules ()
 
Modules::const_iterator endModules () const
 
PathList::iterator endPaths ()
 
Modules::iterator findModule (const char *moduleInstanceName)
 
PathList::iterator findPath (const char *pathName)
 
const ModulegetModule (size_t m) const
 
const ModulegetModuleOnPath (size_t m, size_t p) const
 
const PathgetPath (size_t p) const
 
 HLTPerformanceInfo ()
 
double longestModuleCPUTime () const
 
std::string longestModuleCPUTimeName () const
 
double longestModuleTime () const
 
std::string longestModuleTimeName () const
 
int moduleIndexInPath (const char *mod, const char *path)
 
size_t numberOfModules () const
 
size_t numberOfPaths () const
 
void setStatusOfModulesFromPath (const char *pathName)
 
double totalCPUTime () const
 
double totalPathCPUTime (const size_t path)
 
double totalPathTime (const size_t path)
 
double totalTime () const
 
bool uniqueModule (const char *mod) const
 

Private Attributes

Modules modules_
 
PathList paths_
 

Detailed Description

Definition at line 12 of file HLTPerformanceInfo.h.

Member Typedef Documentation

◆ Modules

typedef std::vector<Module> HLTPerformanceInfo::Modules

Definition at line 17 of file HLTPerformanceInfo.h.

◆ ModulesInPath

Definition at line 18 of file HLTPerformanceInfo.h.

◆ PathList

typedef std::vector<Path> HLTPerformanceInfo::PathList

Definition at line 15 of file HLTPerformanceInfo.h.

Constructor & Destructor Documentation

◆ HLTPerformanceInfo()

HLTPerformanceInfo::HLTPerformanceInfo ( )

Definition at line 6 of file HLTPerformanceInfo.cc.

6  {
7  paths_.clear();
8  modules_.clear();
9 }

References modules_, and paths_.

Member Function Documentation

◆ addModule()

void HLTPerformanceInfo::addModule ( const Module m)
inline

Definition at line 90 of file HLTPerformanceInfo.h.

90 { modules_.push_back(m); }

References visualization-live-secondInstance_cfg::m, and modules_.

◆ addModuleToPath() [1/2]

void HLTPerformanceInfo::addModuleToPath ( const char *  mod,
const char *  path 
)
inline

Definition at line 92 of file HLTPerformanceInfo.h.

92  {
93  // first make sure module exists
94  Modules::iterator m = findModule(mod);
95  if (m == endModules()) {
96  // new module - create it and stick it on the end
97  Module newMod(mod, 0, 0); // time (wall and cpu) = 0 since it wasn't run
98  modules_.push_back(newMod);
99  }
100 
101  for (size_t i = 0; i < paths_.size(); ++i) {
102  if (!(paths_[i] == path))
103  continue;
104  // we found the path, add module to the end
105  for (size_t j = 0; j < modules_.size(); ++j) {
106  if (!(modules_[j] == mod))
107  continue;
108  paths_[i].addModuleRef(j);
109  break;
110  }
111  break;
112  }
113  }

References endModules(), findModule(), mps_fire::i, dqmiolumiharvest::j, visualization-live-secondInstance_cfg::m, mod(), modules_, castor_dqm_sourceclient_file_cfg::path, and paths_.

◆ addModuleToPath() [2/2]

void HLTPerformanceInfo::addModuleToPath ( const size_t  mod,
const size_t  path 
)
inline

Definition at line 115 of file HLTPerformanceInfo.h.

115  {
116  assert((path < paths_.size()) && (mod < modules_.size()));
117  paths_[path].addModuleRef(mod);
118  }

References cms::cuda::assert(), mod(), modules_, castor_dqm_sourceclient_file_cfg::path, and paths_.

◆ addPath()

void HLTPerformanceInfo::addPath ( const Path p)
inline

Definition at line 89 of file HLTPerformanceInfo.h.

89 { paths_.push_back(p); }

References AlCaHLTBitMon_ParallelJobs::p, and paths_.

◆ beginModules()

Modules::const_iterator HLTPerformanceInfo::beginModules ( ) const
inline

Definition at line 148 of file HLTPerformanceInfo.h.

148 { return modules_.begin(); }

References modules_.

◆ beginPaths()

PathList::iterator HLTPerformanceInfo::beginPaths ( )
inline

Definition at line 145 of file HLTPerformanceInfo.h.

145 { return paths_.begin(); }

References paths_.

◆ clear()

void HLTPerformanceInfo::clear ( void  )
inline

Definition at line 120 of file HLTPerformanceInfo.h.

120  {
121  modules_.clear();
122  paths_.clear();
123  }

References modules_, and paths_.

Referenced by BeautifulSoup.Tag::setString().

◆ clearModules()

void HLTPerformanceInfo::clearModules ( )
inline

Definition at line 124 of file HLTPerformanceInfo.h.

124  {
125  for (size_t i = 0; i < modules_.size(); ++i) {
126  modules_[i].clear();
127  }
128  }

References mps_fire::i, and modules_.

◆ endModules()

Modules::const_iterator HLTPerformanceInfo::endModules ( ) const
inline

Definition at line 150 of file HLTPerformanceInfo.h.

150 { return modules_.end(); }

References modules_.

Referenced by addModuleToPath().

◆ endPaths()

PathList::iterator HLTPerformanceInfo::endPaths ( )
inline

Definition at line 146 of file HLTPerformanceInfo.h.

146 { return paths_.end(); }

References paths_.

Referenced by moduleIndexInPath(), and setStatusOfModulesFromPath().

◆ findModule()

HLTPerformanceInfo::Modules::iterator HLTPerformanceInfo::findModule ( const char *  moduleInstanceName)

Definition at line 16 of file HLTPerformanceInfo.cc.

16  {
17  return std::find(modules_.begin(), modules_.end(), moduleInstanceName);
18 }

References spr::find(), and modules_.

Referenced by addModuleToPath().

◆ findPath()

HLTPerformanceInfo::PathList::iterator HLTPerformanceInfo::findPath ( const char *  pathName)

Definition at line 11 of file HLTPerformanceInfo.cc.

11  {
12  PathList::iterator l = std::find(paths_.begin(), paths_.end(), pathName);
13  return l;
14 }

References spr::find(), cmsLHEtoEOSManager::l, hltMonBTagIPClient_cfi::pathName, and paths_.

Referenced by moduleIndexInPath(), and setStatusOfModulesFromPath().

◆ getModule()

const Module& HLTPerformanceInfo::getModule ( size_t  m) const
inline

Definition at line 132 of file HLTPerformanceInfo.h.

132 { return modules_.at(m); }

References visualization-live-secondInstance_cfg::m, and modules_.

◆ getModuleOnPath()

const HLTPerformanceInfo::Module & HLTPerformanceInfo::getModuleOnPath ( size_t  m,
size_t  p 
) const

Definition at line 115 of file HLTPerformanceInfo.cc.

115  {
116  // well if this doesn't get your attention....
117  assert(p < paths_.size() && m < paths_[p].numberOfModules());
118  size_t j = paths_[p].getModuleIndex(m);
119  return modules_.at(j);
120 }

References cms::cuda::assert(), dqmiolumiharvest::j, visualization-live-secondInstance_cfg::m, modules_, AlCaHLTBitMon_ParallelJobs::p, and paths_.

◆ getPath()

const Path& HLTPerformanceInfo::getPath ( size_t  p) const
inline

Definition at line 133 of file HLTPerformanceInfo.h.

133 { return paths_.at(p); }

References AlCaHLTBitMon_ParallelJobs::p, and paths_.

◆ longestModuleCPUTime()

double HLTPerformanceInfo::longestModuleCPUTime ( ) const

Definition at line 70 of file HLTPerformanceInfo.cc.

70  {
71  double t = -1;
72  for (Modules::const_iterator i = modules_.begin(); i != modules_.end(); ++i) {
73  t = std::max(i->cputime(), t);
74  }
75  return t;
76 }

References mps_fire::i, SiStripPI::max, modules_, and OrderedSet::t.

◆ longestModuleCPUTimeName()

std::string HLTPerformanceInfo::longestModuleCPUTimeName ( ) const

Definition at line 90 of file HLTPerformanceInfo.cc.

90  {
91  double t = -1;
92  std::string slowpoke("unknown");
93  for (Modules::const_iterator i = modules_.begin(); i != modules_.end(); ++i) {
94  if (i->cputime() > t) {
95  slowpoke = i->name();
96  t = i->cputime();
97  }
98  }
99  return slowpoke;
100 }

References mps_fire::i, modules_, AlCaHLTBitMon_QueryRunRegistry::string, and OrderedSet::t.

◆ longestModuleTime()

double HLTPerformanceInfo::longestModuleTime ( ) const

Definition at line 62 of file HLTPerformanceInfo.cc.

62  {
63  double t = -1;
64  for (Modules::const_iterator i = modules_.begin(); i != modules_.end(); ++i) {
65  t = std::max(i->time(), t);
66  }
67  return t;
68 }

References mps_fire::i, SiStripPI::max, modules_, and OrderedSet::t.

◆ longestModuleTimeName()

std::string HLTPerformanceInfo::longestModuleTimeName ( ) const

Definition at line 78 of file HLTPerformanceInfo.cc.

78  {
79  double t = -1;
80  std::string slowpoke("unknown");
81  for (Modules::const_iterator i = modules_.begin(); i != modules_.end(); ++i) {
82  if (i->time() > t) {
83  slowpoke = i->name();
84  t = i->time();
85  }
86  }
87  return slowpoke;
88 }

References mps_fire::i, modules_, AlCaHLTBitMon_QueryRunRegistry::string, and OrderedSet::t.

◆ moduleIndexInPath()

int HLTPerformanceInfo::moduleIndexInPath ( const char *  mod,
const char *  path 
)

Definition at line 139 of file HLTPerformanceInfo.cc.

139  {
140  PathList::iterator p = findPath(path);
141  if (p == endPaths())
142  return -1; // Path doesn't exist
143  int ctr = 0;
144  for (ModulesInPath::const_iterator j = p->begin(); j != p->end(); ++j) {
145  if (modules_.at(*j) == mod)
146  return ctr;
147  ctr++;
148  }
149  return -2; // module not found on path
150 }

References dqmiodatasetharvest::ctr, endPaths(), findPath(), dqmiolumiharvest::j, mod(), modules_, AlCaHLTBitMon_ParallelJobs::p, and castor_dqm_sourceclient_file_cfg::path.

◆ numberOfModules()

size_t HLTPerformanceInfo::numberOfModules ( ) const
inline

Definition at line 143 of file HLTPerformanceInfo.h.

143 { return modules_.size(); }

References modules_.

◆ numberOfPaths()

size_t HLTPerformanceInfo::numberOfPaths ( ) const
inline

Definition at line 142 of file HLTPerformanceInfo.h.

142 { return paths_.size(); }

References paths_.

◆ setStatusOfModulesFromPath()

void HLTPerformanceInfo::setStatusOfModulesFromPath ( const char *  pathName)

Definition at line 155 of file HLTPerformanceInfo.cc.

155  {
156  PathList::iterator p = findPath(pathName);
157  if (p == endPaths()) {
158  return; // do nothing
159  }
160  unsigned int ctr = 0;
161  for (ModulesInPath::const_iterator j = p->begin(); j != p->end(); ++j) {
163  unsigned int modIndex = 0;
164 
165  // get module in the master list
166  Module& mod = modules_.at(*j);
167 
168  if (!mod.status().wasrun()) {
169  if (p->status().accept()) {
170  modState = edm::hlt::Pass;
171  } else {
172  if (p->status().index() > ctr) {
173  modState = edm::hlt::Pass;
174  } else if (p->status().index() == ctr) {
175  modState = p->status().state();
176  }
177  }
178  mod.setStatus(edm::HLTPathStatus(modState, modIndex));
179  }
180  ctr++;
181  }
182 }

References dqmiodatasetharvest::ctr, endPaths(), findPath(), dqmiolumiharvest::j, mod(), modules_, AlCaHLTBitMon_ParallelJobs::p, edm::hlt::Pass, hltMonBTagIPClient_cfi::pathName, and edm::hlt::Ready.

◆ totalCPUTime()

double HLTPerformanceInfo::totalCPUTime ( ) const

Definition at line 28 of file HLTPerformanceInfo.cc.

28  {
29  double t = 0;
30  for (size_t i = 0; i < modules_.size(); ++i) {
31  t += modules_[i].cputime();
32  }
33  return t;
34 }

References mps_fire::i, modules_, and OrderedSet::t.

◆ totalPathCPUTime()

double HLTPerformanceInfo::totalPathCPUTime ( const size_t  path)

Definition at line 49 of file HLTPerformanceInfo.cc.

49  {
50  double t = 0;
51  unsigned int cnt = 0;
52  ModulesInPath::const_iterator i = paths_[pathnumber].begin();
53  for (; i != paths_[pathnumber].end(); ++i) {
54  if (cnt > paths_[pathnumber].status().index())
55  break;
56  ++cnt;
57  t += modules_[*i].cputime();
58  }
59  return t;
60 }

References mps_fire::i, modules_, paths_, mps_update::status, and OrderedSet::t.

◆ totalPathTime()

double HLTPerformanceInfo::totalPathTime ( const size_t  path)

Definition at line 36 of file HLTPerformanceInfo.cc.

36  {
37  double t = 0;
38  unsigned int cnt = 0;
39  ModulesInPath::const_iterator i = paths_[pathnumber].begin();
40  for (; i != paths_[pathnumber].end(); ++i) {
41  if (cnt > paths_[pathnumber].status().index())
42  break;
43  ++cnt;
44  t += modules_[*i].time();
45  }
46  return t;
47 }

References mps_fire::i, modules_, paths_, mps_update::status, and OrderedSet::t.

◆ totalTime()

double HLTPerformanceInfo::totalTime ( ) const

Definition at line 20 of file HLTPerformanceInfo.cc.

20  {
21  double t = 0;
22  for (size_t i = 0; i < modules_.size(); ++i) {
23  t += modules_[i].time();
24  }
25  return t;
26 }

References mps_fire::i, modules_, and OrderedSet::t.

◆ uniqueModule()

bool HLTPerformanceInfo::uniqueModule ( const char *  mod) const

Definition at line 122 of file HLTPerformanceInfo.cc.

122  {
123  int mCtr = 0;
124  for (size_t p = 0; p < paths_.size(); ++p) {
125  for (size_t m = 0; m < paths_[p].numberOfModules(); ++m) {
126  size_t modIndex = paths_[p].getModuleIndex(m);
127  if (modules_[modIndex].name() == std::string(mod))
128  ++mCtr;
129  if (mCtr > 1)
130  return false;
131  }
132  }
133 
134  if (mCtr == 0)
135  return false;
136  return true;
137 }

References visualization-live-secondInstance_cfg::m, mod(), modules_, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, paths_, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ modules_

Modules HLTPerformanceInfo::modules_
private

◆ paths_

PathList HLTPerformanceInfo::paths_
private
edm::hlt::HLTState
HLTState
status of a trigger path
Definition: HLTenums.h:16
mps_fire.i
i
Definition: mps_fire.py:355
Module
#define Module(md)
Definition: vmac.h:203
mps_update.status
status
Definition: mps_update.py:69
HLTPerformanceInfo::endPaths
PathList::iterator endPaths()
Definition: HLTPerformanceInfo.h:146
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
cms::cuda::assert
assert(be >=bs)
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HLTPerformanceInfo::findPath
PathList::iterator findPath(const char *pathName)
Definition: HLTPerformanceInfo.cc:11
hltMonBTagIPClient_cfi.pathName
pathName
Definition: hltMonBTagIPClient_cfi.py:5
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
OrderedSet.t
t
Definition: OrderedSet.py:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqmiodatasetharvest.ctr
ctr
Definition: dqmiodatasetharvest.py:191
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
edm::hlt::Ready
not [yet] run
Definition: HLTenums.h:17
HLTPerformanceInfo::findModule
Modules::iterator findModule(const char *moduleInstanceName)
Definition: HLTPerformanceInfo.cc:16
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:193
HLTPerformanceInfo::modules_
Modules modules_
Definition: HLTPerformanceInfo.h:86
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
HLTPerformanceInfo::paths_
PathList paths_
Definition: HLTPerformanceInfo.h:85
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::hlt::Pass
accept
Definition: HLTenums.h:18
HLTPerformanceInfo::endModules
Modules::const_iterator endModules() const
Definition: HLTPerformanceInfo.h:150