12 #pragma GCC diagnostic push 13 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" 14 #include <boost/graph/depth_first_search.hpp> 15 #pragma GCC diagnostic pop 43 using std::pair<I, I>::pair;
83 boost::get_property(graph, boost::graph_name) = context.
processName();
87 for (
size_t i = 0;
i <
size; ++
i)
88 boost::add_vertex(graph);
91 std::vector<unsigned int>
modules;
92 modules.reserve(size);
94 modules.push_back(
module->id());
110 size = pathsAndConsumes.
paths().size();
111 assert (tns.getTrigPaths().size() ==
size);
112 std::vector<PathType> paths;
114 for (
unsigned int i = 0;
i <
size; ++
i) {
115 std::vector<unsigned int>
modules;
117 modules.push_back(
module->id());
124 size = pathsAndConsumes.
endPaths().size();
125 std::vector<PathType> endPaths;
126 endPaths.reserve(size);
127 for (
unsigned int i = 0;
i <
size; ++
i) {
128 std::vector<unsigned int>
modules;
130 modules.push_back(
module->id());
159 return boost::num_vertices(
graph_);
188 std::vector<unsigned int>
191 std::vector<unsigned int>
colors(boost::num_vertices(
graph_));
192 auto colormap = boost::make_container_vertex_map(colors);
195 boost::default_dfs_visitor visitor;
196 boost::depth_first_visit(
graph_, module, visitor, colormap);
200 unsigned int size = 0;
201 for (
unsigned int i = 0;
i < colors.size(); ++
i)
202 if (boost::black_color == colors[
i])
206 for (
unsigned int i = 0; i < colors.size(); ++
i)
207 if (boost::black_color == colors[i])
208 dependencies[j++] =
i;
219 std::pair<std::vector<unsigned int>, std::vector<unsigned int>>
222 std::vector<unsigned int>
colors(boost::num_vertices(
graph_));
223 auto colormap = boost::make_container_vertex_map(colors);
226 boost::default_dfs_visitor visitor;
227 for (
unsigned int module: path)
228 boost::depth_first_visit(
graph_,
module, visitor, colormap);
230 unsigned int size = 0;
231 for (
unsigned int i = 0;
i < colors.size(); ++
i)
237 dependencies.resize(0);
238 std::vector<unsigned int> indices(path.size());
242 for (
unsigned int i = 0;
i < colors.size(); ++
i)
246 struct record_vertices : boost::default_dfs_visitor {
247 record_vertices(std::vector<unsigned int> &
vertices) :
248 vertices_(vertices) { }
250 void discover_vertex(
unsigned int vertex,
GraphType const&
graph) {
251 vertices_.push_back(vertex);
254 std::vector<unsigned int> & vertices_;
256 record_vertices recorder(dependencies);
258 for (
unsigned int module: path) {
260 if (colors[
module] != boost::black_color)
261 boost::depth_first_visit(
graph_,
module, recorder, colormap);
262 indices.push_back(dependencies.size());
265 return std::make_pair(dependencies, indices);
273 static unsigned int s_id = 0;
278 <<
"ProcessCallGraph::preBeginJob(): called for subprocess \"" << context.
processName() <<
"\"" 286 <<
"ProcessCallGraph::preBeginJob(): called twice for the same " 302 <<
"ProcessCallGraph::processId(): unexpected " << (context.
isSubProcess() ?
"subprocess" :
"process") <<
" " << context.
processName();
314 <<
"ProcessCallGraph::processId(): unexpected (sub)process " <<
processName;
unsigned int registerProcess(edm::ProcessContext const &)
std::string const & processName() const
unsigned int processId(edm::ProcessContext const &) const
std::unordered_map< std::string, unsigned int > process_id_
std::vector< ModuleDescription const * > const & modulesOnEndPath(unsigned int endPathIndex) const
std::vector< ModuleDescription const * > const & modulesOnPath(unsigned int pathIndex) const
edm::ModuleDescription const & source() const
ProcessContext const & parentProcessContext() const
std::vector< ModuleDescription const * > const & allModules() const
EDMModuleType edmModuleTypeEnum(edm::ModuleDescription const &module)
std::vector< std::string > const & endPaths() const
U second(std::pair< T, U > const &p)
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
std::vector< ProcessType > const & processes() const
ProcessType const & processDescription(unsigned int) const
const std::complex< double > I
void preSourceConstruction(edm::ModuleDescription const &)
boost::subgraph< boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, NodeType, boost::property< boost::edge_index_t, int >, boost::property< boost::graph_name_t, std::string > >> GraphType
std::vector< ProcessType > process_description_
std::vector< unsigned int > depends(unsigned int module) const
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy(unsigned int moduleID) const
std::vector< std::string > const & paths() const
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > dependencies(std::vector< unsigned int > const &path)
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
iterator_pair_as_a_range< I > make_range(std::pair< I, I > p)
bool isSubProcess() const
NodeType const & operator[](unsigned int module) const