From 3f4d73bc97aec33158dc659c8791e3f5f08b2250 Mon Sep 17 00:00:00 2001 From: D4VID Date: Mon, 3 Mar 2025 21:59:07 +0100 Subject: [PATCH] Check for clusters connected via relays in starting clusters --- .../src/server/tool/ServerPathTracer.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs index bc5732a..156f670 100644 --- a/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs +++ b/CriticalPathAnalyzer/CriticalPathAnalyzer/src/server/tool/ServerPathTracer.cs @@ -71,7 +71,7 @@ namespace CriticalPathAnalyzer.Server.Tool { int index = clusterNodes.Count; var node = new ClusterNode() { Index = index, - Clusters = new HashSet() {startingCluster}, + Clusters = GetClustersConnectedThroughRelays(startingCluster), Time = 0, PrevNodeIndexes = new HashSet(), NextNodes = new Dictionary(), @@ -127,7 +127,12 @@ namespace CriticalPathAnalyzer.Server.Tool { private static void PropagateTimeDelay(List clusterNodes, List startingNodeIndexes) { var queue = new Queue(startingNodeIndexes); + int iterations = 0; while (queue.TryDequeue(out int index)) { + iterations++; + if (iterations % 1000 == 0) { + CriticalPathAnalyzerServer.LoggerInstance.Info($"{iterations} propagation iterations"); + } ClusterNode node = clusterNodes[index]; foreach ((int nextNodeIndex, int delay) in node.NextNodes) { clusterNodes[nextNodeIndex].Time = node.Time + delay; @@ -158,7 +163,12 @@ namespace CriticalPathAnalyzer.Server.Tool { } } + int iterations = 0; while (queue.TryDequeue(out ClusterNode node)) { + iterations++; + if (iterations % 1000 == 0) { + CriticalPathAnalyzerServer.LoggerInstance.Info($"{iterations} loop iterations"); + } foreach ((int nextNodeIndex, int _) in node.NextNodes) { ClusterNode nextNode = clusterNodes[nextNodeIndex]; nextNode.PrevNodeIndexes.Remove(node.Index); @@ -253,6 +263,7 @@ namespace CriticalPathAnalyzer.Server.Tool { // Collect all next clusters connected via a relay (from the control input side) if (inputPeg.Address == component.Inputs[1].Address) { // one of the sides + // TODO: need to recursively check for further relays CollectPegClusters(component.Inputs[2].Address, clusters); } else if (inputPeg.Address == component.Inputs[2].Address) { // the other side