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.

References modules_, and paths_.

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

Member Function Documentation

◆ addModule()

void HLTPerformanceInfo::addModule ( const Module m)
inline

◆ addModuleToPath() [1/2]

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

Definition at line 92 of file HLTPerformanceInfo.h.

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

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  }
Modules::const_iterator endModules() const
Modules::iterator findModule(const char *moduleInstanceName)
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ addModuleToPath() [2/2]

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

Definition at line 115 of file HLTPerformanceInfo.h.

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

115  {
116  assert((path < paths_.size()) && (mod < modules_.size()));
117  paths_[path].addModuleRef(mod);
118  }
assert(be >=bs)
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ addPath()

void HLTPerformanceInfo::addPath ( const Path p)
inline

Definition at line 89 of file HLTPerformanceInfo.h.

References AlCaHLTBitMon_ParallelJobs::p, and paths_.

◆ beginModules()

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

Definition at line 148 of file HLTPerformanceInfo.h.

References modules_.

148 { return modules_.begin(); }

◆ beginPaths()

PathList::iterator HLTPerformanceInfo::beginPaths ( )
inline

Definition at line 145 of file HLTPerformanceInfo.h.

References paths_.

145 { return paths_.begin(); }

◆ clear()

void HLTPerformanceInfo::clear ( void  )
inline

Definition at line 120 of file HLTPerformanceInfo.h.

References modules_, and paths_.

Referenced by BeautifulSoup.Tag::setString().

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

◆ clearModules()

void HLTPerformanceInfo::clearModules ( )
inline

Definition at line 124 of file HLTPerformanceInfo.h.

References mps_fire::i, and modules_.

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

◆ endModules()

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

Definition at line 150 of file HLTPerformanceInfo.h.

References modules_.

Referenced by addModuleToPath().

150 { return modules_.end(); }

◆ endPaths()

PathList::iterator HLTPerformanceInfo::endPaths ( )
inline

Definition at line 146 of file HLTPerformanceInfo.h.

References paths_.

Referenced by moduleIndexInPath(), and setStatusOfModulesFromPath().

146 { return paths_.end(); }

◆ findModule()

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

Definition at line 16 of file HLTPerformanceInfo.cc.

References spr::find(), and modules_.

Referenced by addModuleToPath().

16  {
17  return std::find(modules_.begin(), modules_.end(), moduleInstanceName);
18 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ findPath()

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

Definition at line 11 of file HLTPerformanceInfo.cc.

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

Referenced by moduleIndexInPath(), and setStatusOfModulesFromPath().

11  {
12  PathList::iterator l = std::find(paths_.begin(), paths_.end(), pathName);
13  return l;
14 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ getModule()

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

◆ getModuleOnPath()

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

Definition at line 115 of file HLTPerformanceInfo.cc.

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

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 }
assert(be >=bs)

◆ getPath()

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

Definition at line 133 of file HLTPerformanceInfo.h.

References AlCaHLTBitMon_ParallelJobs::p, and paths_.

◆ longestModuleCPUTime()

double HLTPerformanceInfo::longestModuleCPUTime ( ) const

Definition at line 70 of file HLTPerformanceInfo.cc.

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

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 }

◆ longestModuleCPUTimeName()

std::string HLTPerformanceInfo::longestModuleCPUTimeName ( ) const

Definition at line 90 of file HLTPerformanceInfo.cc.

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

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 }

◆ longestModuleTime()

double HLTPerformanceInfo::longestModuleTime ( ) const

Definition at line 62 of file HLTPerformanceInfo.cc.

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

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 }

◆ longestModuleTimeName()

std::string HLTPerformanceInfo::longestModuleTimeName ( ) const

Definition at line 78 of file HLTPerformanceInfo.cc.

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

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 }

◆ moduleIndexInPath()

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

Definition at line 139 of file HLTPerformanceInfo.cc.

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

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 }
PathList::iterator findPath(const char *pathName)
PathList::iterator endPaths()
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ numberOfModules()

size_t HLTPerformanceInfo::numberOfModules ( ) const
inline

Definition at line 143 of file HLTPerformanceInfo.h.

References modules_.

143 { return modules_.size(); }

◆ numberOfPaths()

size_t HLTPerformanceInfo::numberOfPaths ( ) const
inline

Definition at line 142 of file HLTPerformanceInfo.h.

References paths_.

142 { return paths_.size(); }

◆ setStatusOfModulesFromPath()

void HLTPerformanceInfo::setStatusOfModulesFromPath ( const char *  pathName)

Definition at line 155 of file HLTPerformanceInfo.cc.

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

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 }
PathList::iterator findPath(const char *pathName)
not [yet] run
Definition: HLTenums.h:17
HLTState
status of a trigger path
Definition: HLTenums.h:16
accept
Definition: HLTenums.h:18
PathList::iterator endPaths()
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ totalCPUTime()

double HLTPerformanceInfo::totalCPUTime ( ) const

Definition at line 28 of file HLTPerformanceInfo.cc.

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

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 }

◆ totalPathCPUTime()

double HLTPerformanceInfo::totalPathCPUTime ( const size_t  path)

Definition at line 49 of file HLTPerformanceInfo.cc.

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

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 }

◆ totalPathTime()

double HLTPerformanceInfo::totalPathTime ( const size_t  path)

Definition at line 36 of file HLTPerformanceInfo.cc.

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

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 }

◆ totalTime()

double HLTPerformanceInfo::totalTime ( ) const

Definition at line 20 of file HLTPerformanceInfo.cc.

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

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 }

◆ uniqueModule()

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

Definition at line 122 of file HLTPerformanceInfo.cc.

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

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 }
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

Member Data Documentation

◆ modules_

Modules HLTPerformanceInfo::modules_
private

◆ paths_

PathList HLTPerformanceInfo::paths_
private