33 return iLHS->
id() < iRHS->
id();
48 std::vector<const ModuleDescription*>
const& iModules,
51 : m_streamEventTimer(iNumStreams),
52 m_streamPathTiming(iNumStreams),
54 m_processContext(iProcessContext),
63 stream.resize(numModuleSlots);
67 std::vector<unsigned int> numModulesInPath;
68 std::vector<unsigned int> numModulesInEndPath;
70 const unsigned int numPaths = iNamesService.
getTrigPaths().size();
71 const unsigned int numEndPaths = iNamesService.
getEndPaths().size();
76 numModulesInPath.reserve(numPaths);
77 numModulesInEndPath.reserve(numEndPaths);
81 for (
unsigned int i = 0;
i < numPaths; ++
i) {
85 for (
unsigned int i = 0;
i < numEndPaths; ++
i) {
93 unsigned int index = 0;
94 stream.resize(numModulesInPath.size() + numModulesInEndPath.size());
95 for (
unsigned int numMods : numModulesInPath) {
99 for (
unsigned int numMods : numModulesInEndPath) {
158 auto& modsOnPath =
timing.m_moduleTiming;
159 for (
unsigned int i = 0;
i < iStatus.
index() + 1; ++
i) {
160 ++modsOnPath[
i].m_timesVisited;
175 auto times =
mod.m_timer.stop();
181 modTiming.m_realTime += times;
188 auto times =
mod.m_timer.stop();
194 modTiming.m_realTime += times;
216 unsigned int iEndIndex,
217 std::vector<std::string>
const& iPathNames,
218 std::vector<std::vector<std::string>>
const& iModulesOnPaths,
219 std::vector<std::vector<SystemTimeKeeper::PathTiming>>
const& iPathTimings,
220 std::vector<PathTimingSummary>& iSummary) {
221 iSummary.resize(iEndIndex - iStartIndex);
223 for (
auto const&
stream : iPathTimings) {
224 auto it = iSummary.begin();
228 it->bitPosition =
index - iStartIndex;
229 if (not pathTiming.m_moduleTiming.empty()) {
230 it->timesRun += pathTiming.m_moduleTiming[0].m_timesVisited;
232 it->realTime += pathTiming.m_timer.realTime();
233 if (
it->moduleInPathSummaries.empty()) {
234 it->moduleInPathSummaries.resize(pathTiming.m_moduleTiming.size());
236 for (
unsigned int modIndex = 0; modIndex < pathTiming.m_moduleTiming.size(); ++modIndex) {
237 auto const& modTiming = pathTiming.m_moduleTiming[modIndex];
238 auto& modSummary =
it->moduleInPathSummaries[modIndex];
239 if (modSummary.moduleLabel.empty()) {
240 modSummary.moduleLabel = iModulesOnPaths[
index][modIndex];
242 modSummary.timesVisited += modTiming.m_timesVisited;
243 modSummary.realTime += modTiming.m_realTime;
252 double sumEventTime = 0.;
254 sumEventTime +=
stream.realTime();
258 rep.eventSummary.sumStreamRealTime = sumEventTime;
266 std::map<std::string, unsigned int>
visited;
268 unsigned int pathIndex = 0;
270 unsigned int modIndex = 0;
271 for (
auto const&
mod :
path.m_moduleTiming) {
279 unsigned int modIndex = 0;
281 auto& outMod =
summary[modIndex];
282 outMod.moduleLabel =
mod->moduleLabel();
283 outMod.realTime = 0.;
288 outMod.realTime +=
timing.m_timer.realTime();
289 outMod.timesRun +=
timing.m_timesRun;
291 outMod.timesVisited =
visited[
mod->moduleLabel()];
292 if (0 == outMod.timesVisited) {
293 outMod.timesVisited = outMod.timesRun;
308 rep.endPathSummaries);
std::vector< std::vector< std::string > > m_modulesOnPaths
unsigned int m_minModuleID
ModuleDescription const * moduleDescription() const
ChildrenCPUTimer m_processingLoopChildrenTimer
void stopEvent(StreamContext const &)
void startProcessingLoop()
std::atomic< unsigned int > m_numberOfEvents
void restartModuleEvent(StreamContext const &, ModuleCallingContext const &)
void startModuleEvent(StreamContext const &, ModuleCallingContext const &)
SystemTimeKeeper(unsigned int iNumStreams, std::vector< const ModuleDescription *> const &iModules, service::TriggerNamesService const &iNameService, ProcessContext const *iProcessContext)
void removeModuleIfExists(ModuleDescription const &module)
unsigned int index() const
std::vector< ModuleInPathTiming > m_moduleTiming
std::vector< std::vector< ModuleTiming > > m_streamModuleTiming
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void stopProcessingLoop()
void startEvent(StreamID)
std::vector< std::string > m_pathNames
Strings const & getTrigPathModules(std::string const &name) const
PlaceInPathContext const * placeInPathContext() const
std::vector< const ModuleDescription * > m_modules
Strings const & getTrigPaths() const
StreamID const & streamID() const
ProcessContext const * m_processContext
static void fillPathSummary(Path const &path, PathSummary &sum)
Strings const & getEndPathModules(std::string const &name) const
ProcessContext const * processContext() const
void stopPath(StreamContext const &, PathContext const &, HLTPathStatus const &)
void stopModuleEvent(StreamContext const &, ModuleCallingContext const &)
unsigned int pathID() const
CPUTimer m_processingLoopTimer
Strings const & getEndPaths() const
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
void startPath(StreamContext const &, PathContext const &)
void fillTriggerTimingReport(TriggerTimingReport &rep) const
void pauseModuleEvent(StreamContext const &, ModuleCallingContext const &)
std::vector< WallclockTimer > m_streamEventTimer
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
PathTiming & pathTiming(StreamContext const &, PathContext const &)
unsigned int m_endPathOffset
unsigned int value() const
bool checkBounds(unsigned int id) const
T mod(const T &a, const T &b)
std::vector< std::vector< PathTiming > > m_streamPathTiming