Skip to content

Commit 546826d

Browse files
authored
Merge pull request #48218 from wddgit/removeSubProcessFromFastTimerService
Remove SubProcess related code from FastTimerService
2 parents 4f4f524 + 53098ed commit 546826d

File tree

6 files changed

+265
-376
lines changed

6 files changed

+265
-376
lines changed
Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
#ifndef HLTrigger_Timer_interface_ProcessCallGraph_h
22
#define HLTrigger_Timer_interface_ProcessCallGraph_h
33

4-
/*
5-
*
6-
*/
7-
8-
#include <iostream>
4+
#include <memory>
95
#include <utility>
106
#include <vector>
117
#include <string>
12-
#include <type_traits>
138

149
// boost optional (used by boost graph) results in some false positives with -Wmaybe-uninitialized
1510
#pragma GCC diagnostic push
@@ -20,15 +15,14 @@
2015
#pragma GCC diagnostic pop
2116

2217
#include "DataFormats/Provenance/interface/ModuleDescription.h"
23-
#include "FWCore/ServiceRegistry/interface/PathsAndConsumesOfModulesBase.h"
24-
#include "FWCore/ServiceRegistry/interface/ProcessContext.h"
18+
#include "FWCore/ServiceRegistry/interface/ServiceRegistryfwd.h"
2519
#include "HLTrigger/Timer/interface/EDMModuleType.h"
2620

2721
class ProcessCallGraph {
2822
public:
2923
struct NodeType {
3024
edm::ModuleDescription module_;
31-
edm::EDMModuleType type_;
25+
edm::EDMModuleType type_ = edm::EDMModuleType::kUnknown;
3226
bool scheduled_ = false;
3327
};
3428

@@ -64,61 +58,28 @@ class ProcessCallGraph {
6458
modules_on_path_(std::move(mop)),
6559
modules_and_dependencies_(std::move(mad)),
6660
last_dependency_of_module_(std::move(ldom)) {}
67-
68-
PathType(PathType const &other) = default;
69-
70-
PathType(PathType &&other) = default;
71-
72-
~PathType() = default;
73-
74-
PathType &operator=(PathType const &other) = default;
7561
};
7662

77-
// store the details of each process: name, modules call subgraph, modules, paths and endpaths, subprocess pids
63+
// store the details of the process: name, modules call subgraph, modules, paths and endpaths
7864
struct ProcessType {
7965
std::string name_;
8066
GraphType const &graph_;
8167
std::vector<unsigned int> modules_;
8268
std::vector<PathType> paths_;
8369
std::vector<PathType> endPaths_;
84-
std::vector<unsigned int> subprocesses_;
85-
86-
ProcessType() = delete;
8770

8871
ProcessType(std::string name,
8972
GraphType const &graph,
9073
std::vector<unsigned int> modules,
9174
std::vector<PathType> paths,
92-
std::vector<PathType> endPaths,
93-
std::vector<unsigned int> subprocesses = {})
94-
: name_(std::move(name)),
95-
graph_(graph),
96-
modules_(std::move(modules)),
97-
paths_(std::move(paths)),
98-
endPaths_(std::move(endPaths)),
99-
subprocesses_(std::move(subprocesses)) {}
100-
101-
ProcessType(std::string &&name,
102-
GraphType const &graph,
103-
std::vector<unsigned int> &&modules,
104-
std::vector<PathType> &&paths,
105-
std::vector<PathType> &&endPaths,
106-
std::vector<unsigned int> &&subprocesses = {})
75+
std::vector<PathType> endPaths)
10776
: name_(std::move(name)),
10877
graph_(graph),
10978
modules_(std::move(modules)),
11079
paths_(std::move(paths)),
111-
endPaths_(std::move(endPaths)),
112-
subprocesses_(std::move(subprocesses)) {}
113-
114-
ProcessType(ProcessType const &other) = default;
115-
ProcessType(ProcessType &&other) = default;
116-
117-
ProcessType &operator=(ProcessType const &other) = delete;
118-
ProcessType &operator=(ProcessType &&other) = delete;
80+
endPaths_(std::move(endPaths)) {}
11981
};
12082

121-
public:
12283
// default c'tor
12384
ProcessCallGraph() = default;
12485

@@ -146,39 +107,17 @@ class ProcessCallGraph {
146107
// find the dependencies of all modules in the given path
147108
std::pair<std::vector<unsigned int>, std::vector<unsigned int>> dependencies(std::vector<unsigned int> const &path);
148109

149-
// retrieve the "process id" of a process, given its ProcessContex
150-
unsigned int processId(edm::ProcessContext const &) const;
151-
152-
// retrieve the "process id" of a process, given its name
153-
unsigned int processId(std::string const &) const;
154-
155-
// retrieve the processes
156-
std::vector<ProcessType> const &processes() const;
157-
158-
// retrieve information about a process, given its "process id"
159-
ProcessType const &processDescription(unsigned int) const;
160-
161-
// retrieve information about a process, given its ProcessContex
162-
ProcessType const &processDescription(edm::ProcessContext const &) const;
163-
164-
// retrieve information about a process, given its name
165-
ProcessType const &processDescription(std::string const &) const;
166-
167-
private:
168-
// register a (sub)process and assigns it a "process id"
169-
unsigned int registerProcess(edm::ProcessContext const &);
110+
// retrieve information about the process
111+
ProcessType const &processDescription() const;
170112

171113
private:
172114
GraphType graph_;
173115

174116
// module id of the Source
175117
unsigned int source_ = edm::ModuleDescription::invalidID();
176118

177-
// map each (sub)process name to a "process id"
178-
std::unordered_map<std::string, unsigned int> process_id_;
179-
180-
// description of each process
181-
std::vector<ProcessType> process_description_;
119+
// description of the process
120+
std::unique_ptr<ProcessType> process_description_;
182121
};
183122

184123
#endif // not defined HLTrigger_Timer_interface_ProcessCallGraph_h

0 commit comments

Comments
 (0)