Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Links Routing issue for huge amount of elements. (Read 2142 times)
PiotrMakowiec
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jul 26th, 2017
Links Routing issue for huge amount of elements.
Apr 15th, 2021 at 2:21pm
Print Post  
Good morning,
I’m writing here to ask about diagrams with a huge amount of links.
I’ve got one big diagram “Diagram A” which contains many nested diagrams “Diagram B”,
“Diagram C” and so on…
Inside those diagrams, I’ve got Nodes that contain other nodes and links as drawn on the picture.
“Node A” has inside “Node B”, two times “Node C” and links between them.
During loading diagrams, we route links inside, with LinkRouter set to GridRouter.
Just before the routing, we set “Node A” isObstacle to false.

The first several diagrams are loaded correctly and the links are routed, but after processing several dozen diagrams and nodes, which look the same, we’re facing an issue in a Link.Route() method. After being called already several dozen or even hundreds of times, it stops in that method call, CPU shows continuous load, and memory consumption seems to increase in small steps up to 20 GB of RAM (I didn’t wait longer, but it was still increasing).

Originally we were thinking that a specific routing situation causes the issue. E.g. When processing a list of Diagrams 1-150, it always got stuck, say, at diagram 119.
However, after some testing, it seems more like an overflow; i.e. when in the above situation e.g. removing diagram 119, it now gets stuck at diagram 120 etc.
At some time earlier, we discovered that Mindfusion had issues with processing too many objects by the same method, but then it was throwing an exception (which we caught and logged). Here no exception is thrown.

Have you ever faced that kind of routing issue?
Do you have any idea why is that happening?

Thanks for your time.
Piotr M.
  

MindFusionDiagram.png ( 46 KB | 91 Downloads )
MindFusionDiagram.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Links Routing issue for huge amount of elements.
Reply #1 - Apr 15th, 2021 at 3:38pm
Print Post  
Hi,

It could overflow if link / node coordinates at that location divided by RoutingOptions.GridSize don't fit within an Int32. What GridSize are you using, and what values does the debugger show for link's StartPoint and EndPoint if you break execution when that happens?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
PiotrMakowiec
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jul 26th, 2017
Re: Links Routing issue for huge amount of elements.
Reply #2 - Apr 20th, 2021 at 10:30am
Print Post  
Hi,
It took a bit time to check that link, we are setting options automatically for each link itself.
Eg. in this case:
StartPoint = {11248; 19178,6}
EndPoint = {11248; 19212}
GridSize = 6.0810234541577826
Parent NodeVicinityCost = 0

Do you suggest, to have location and GridSize values, that when we divide them, they are Integer, not Double ?

Thanks for your time
Piotr Makowiec
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Links Routing issue for huge amount of elements.
Reply #3 - Apr 20th, 2021 at 2:00pm
Print Post  
Hi,

No, I meant it would overflow for sure if your double-value coordinates divided by grid size are larger than 2^32. Our developer will test with these ones.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
PiotrMakowiec
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 12
Joined: Jul 26th, 2017
Re: Links Routing issue for huge amount of elements.
Reply #4 - Apr 20th, 2021 at 3:53pm
Print Post  
Okay, so in that case, for sure they are not larger than 2^32.

Thank you so much.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Links Routing issue for huge amount of elements.
Reply #5 - Apr 21st, 2021 at 11:35am
Print Post  
Hi,

We could not reproduce with this -

Code
Select All
void TestGridRouterCrash()
{
	var nodeSize = 50;
	var startPoint = new Point(11248, 19178.6);
	var endPoint = new Point(11248, 19212);
	diagram.Bounds = new Rect(0, 0, 20000, 20000);

	var startNode = diagram.Factory.CreateShapeNode(
		startPoint.X - nodeSize / 2, startPoint.Y - nodeSize, nodeSize, nodeSize);
	var endNode = diagram.Factory.CreateShapeNode(
		endPoint.X - nodeSize / 2, endPoint.Y, nodeSize, nodeSize);
	startNode.AnchorPattern = AnchorPattern.TopInBottomOut;
	endNode.AnchorPattern = AnchorPattern.TopInBottomOut;

	var link = diagram.Factory.CreateDiagramLink(startNode, endNode);
	diagram.BringIntoView(link);
	diagram.LinkRouter = new GridRouter();
	diagram.RoutingOptions.GridSize = 6.0810234541577826;
	diagram.RoutingOptions.NodeVicinityCost = 0;
	link.Route();

	Debug.WriteLine(link.StartPoint);
	Debug.WriteLine(startPoint == link.StartPoint);
	Debug.WriteLine(link.EndPoint);
	Debug.WriteLine(endPoint == link.EndPoint);
} 



Could you post all of your routing initialization code (e.g. any other RoutingOptions property assignments) and attach the diagram file?

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint