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 36 using std::pair<I, I>::pair;
73 boost::get_property(graph, boost::graph_name) =
context.processName();
77 for (
size_t i = 0;
i <
size; ++
i)
78 boost::add_vertex(graph);
81 std::vector<unsigned int>
modules;
102 std::vector<PathType>
paths;
104 for (
unsigned int i = 0;
i <
size; ++
i) {
105 std::vector<unsigned int>
modules;
115 std::vector<PathType> endPaths;
116 endPaths.reserve(
size);
117 for (
unsigned int i = 0;
i <
size; ++
i) {
118 std::vector<unsigned int>
modules;
157 std::vector<unsigned int>
colors(boost::num_vertices(
graph_));
158 auto colormap = boost::make_container_vertex_map(
colors);
161 boost::default_dfs_visitor visitor;
162 boost::depth_first_visit(
graph_,
module, visitor, colormap);
166 unsigned int size = 0;
167 for (
unsigned int color :
colors)
168 if (boost::black_color == color)
172 for (
unsigned int i = 0;
i <
colors.size(); ++
i)
173 if (boost::black_color ==
colors[
i])
186 std::vector<unsigned int>
const&
path) {
187 std::vector<unsigned int>
colors(boost::num_vertices(
graph_));
188 auto colormap = boost::make_container_vertex_map(
colors);
191 boost::default_dfs_visitor visitor;
193 boost::depth_first_visit(
graph_,
module, visitor, colormap);
195 unsigned int size = 0;
196 for (
unsigned int color :
colors)
207 for (
unsigned int& color :
colors)
211 struct record_vertices : boost::default_dfs_visitor {
212 record_vertices(std::vector<unsigned int>&
vertices) : vertices_(
vertices) {}
216 std::vector<unsigned int>& vertices_;
223 boost::depth_first_visit(
graph_,
module, recorder, colormap);
236 <<
"ProcessCallGraph::preBeginJob(): called for subprocess \"" <<
context.processName() <<
"\"" 237 <<
" before being called for its parent process \"" <<
context.parentProcessContext().processName() <<
"\"";
244 <<
"ProcessCallGraph::preBeginJob(): called twice for the same " 245 << (
context.isSubProcess() ?
"subprocess" :
"process") <<
" " <<
context.processName();
260 <<
"ProcessCallGraph::processId(): unexpected " << (
context.isSubProcess() ?
"subprocess" :
"process") <<
" " 271 <<
"ProcessCallGraph::processId(): unexpected (sub)process " <<
processName;
unsigned int registerProcess(edm::ProcessContext const &)
std::vector< ModuleDescription const * > const & allModules() const
unsigned int largestModuleID() const
edm::ModuleDescription const & source() const
std::vector< ModuleDescription const * > const & modulesOnPath(unsigned int pathIndex) const
std::unordered_map< std::string, unsigned int > process_id_
std::vector< std::string > const & endPaths() const
EDMModuleType edmModuleTypeEnum(edm::ModuleDescription const &module)
edm::ModuleDescription const & module(unsigned int module) const
std::vector< ModuleDescription const * > const & modulesOnEndPath(unsigned int endPathIndex) const
U second(std::pair< T, U > const &p)
std::vector< ProcessType > const & processes() const
Strings const & getTrigPaths() const
std::string const & getEndPath(size_type const i) const
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
const std::complex< double > I
unsigned int processId(edm::ProcessContext const &) const
void preSourceConstruction(edm::ModuleDescription const &)
static constexpr unsigned int invalidID()
Returns a value identifying an invalid id (the max unsigned int value)
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_
unsigned int size() const
std::vector< unsigned int > depends(unsigned int module) const
NodeType const & operator[](unsigned int module) const
std::pair< std::vector< unsigned int >, std::vector< unsigned int > > dependencies(std::vector< unsigned int > const &path)
std::vector< ModuleDescription const * > const & modulesWhoseProductsAreConsumedBy(unsigned int moduleID, BranchType branchType=InEvent) const
std::string const & getTrigPath(size_type const i) const
ProcessType const & processDescription(unsigned int) const
iterator_pair_as_a_range< I > make_range(std::pair< I, I > p)
std::vector< std::string > const & paths() const