diff --git a/src/V3Graph.h b/src/V3Graph.h index ccc208e97..ad5fb2efb 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -188,13 +188,13 @@ public: // Total cost of evaluating the whole graph. The ratio of m_totalGraphCost to // m_criticalPathCost gives us an estimate of the parallelizability of this graph which is // only as good as the guess returned by vertexCost. - uint32_t m_totalGraphCost = 0; + uint64_t m_totalGraphCost = 0; // Cost of the critical path, in abstract units (the same units returned by the vertexCost) - uint32_t m_criticalPathCost = 0; + uint64_t m_criticalPathCost = 0; - size_t m_vertexCount = 0; // Number of vertexes in the graph - size_t m_edgeCount = 0; // Number of edges in the grap + uint64_t m_vertexCount = 0; // Number of vertexes in the graph + uint64_t m_edgeCount = 0; // Number of edges in the grap ParallelismReport() = default; @@ -203,17 +203,17 @@ public: ParallelismReport(const ParallelismReport&) = default; ParallelismReport& operator=(const ParallelismReport&) = default; - uint32_t totalGraphCost() const { return m_totalGraphCost; } - uint32_t criticalPathCost() const { return m_criticalPathCost; } - size_t vertexCount() const { return m_vertexCount; } - size_t edgeCount() const { return m_edgeCount; } + uint64_t totalGraphCost() const { return m_totalGraphCost; } + uint64_t criticalPathCost() const { return m_criticalPathCost; } + uint64_t vertexCount() const { return m_vertexCount; } + uint64_t edgeCount() const { return m_edgeCount; } double parallelismFactor() const { return (static_cast(m_totalGraphCost) / m_criticalPathCost); } }; ParallelismReport parallelismReport( - std::function vertexCost) const VL_MT_DISABLED; + std::function vertexCost) const VL_MT_DISABLED; // CALLBACKS virtual void loopsMessageCb(V3GraphVertex* vertexp) VL_MT_DISABLED; diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index 5cb058497..d1aa032fb 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -525,21 +525,21 @@ double V3Graph::orderDFSIterate(V3GraphVertex* vertexp) { class GraphAlgParallelismReport final { // MEMBERS const V3Graph& m_graph; // The graph - const std::function m_vertexCost; // vertex cost function + const std::function m_vertexCost; // vertex cost function V3Graph::ParallelismReport m_report; // The result report // CONSTRUCTORS explicit GraphAlgParallelismReport(const V3Graph& graph, - std::function vertexCost) + std::function vertexCost) : m_graph{graph} , m_vertexCost{vertexCost} { // For each node, record the critical path cost from the start // of the graph through the end of the node. - std::unordered_map critPaths; + std::unordered_map critPaths; GraphStreamUnordered serialize{&m_graph}; for (const V3GraphVertex* vertexp; (vertexp = serialize.nextp());) { ++m_report.m_vertexCount; - uint32_t cpCostToHere = 0; + uint64_t cpCostToHere = 0; for (V3GraphEdge* edgep = vertexp->inBeginp(); edgep; edgep = edgep->inNextp()) { ++m_report.m_edgeCount; // For each upstream item, add its critical path cost to @@ -570,6 +570,6 @@ public: }; V3Graph::ParallelismReport -V3Graph::parallelismReport(std::function vertexCost) const { +V3Graph::parallelismReport(std::function vertexCost) const { return GraphAlgParallelismReport::apply(*this, vertexCost); } diff --git a/src/V3OrderParallel.cpp b/src/V3OrderParallel.cpp index 0a4e8a7f7..de09791fa 100644 --- a/src/V3OrderParallel.cpp +++ b/src/V3OrderParallel.cpp @@ -1714,10 +1714,10 @@ private: // Checking exact values here is maybe overly precise. What we're // mostly looking for is a healthy reduction in the number of mTaskGraphp. - UASSERT_SELFTEST(uint32_t, report.criticalPathCost(), 19); - UASSERT_SELFTEST(uint32_t, report.totalGraphCost(), 101); - UASSERT_SELFTEST(uint32_t, report.vertexCount(), 14); - UASSERT_SELFTEST(uint32_t, report.edgeCount(), 13); + UASSERT_SELFTEST(uint64_t, report.criticalPathCost(), 19); + UASSERT_SELFTEST(uint64_t, report.totalGraphCost(), 101); + UASSERT_SELFTEST(uint64_t, report.vertexCount(), 14); + UASSERT_SELFTEST(uint64_t, report.edgeCount(), 13); } public: