Commit 4a4d3391 authored by Robert Ricci's avatar Robert Ricci

Use BigInts to represent inter-switch bandwidth, so that we can have

> 4Gbps trunks.
parent 37c89b7d
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
use English; use English;
use Getopt::Std; use Getopt::Std;
use Math::BigInt;
sub usage() sub usage()
{ {
...@@ -757,7 +758,7 @@ while (($node1,$card1,$port1,$node2,$card2,$port2) = ...@@ -757,7 +758,7 @@ while (($node1,$card1,$port1,$node2,$card2,$port2) =
if (defined($interconnects{"$node1:$node2"})) { if (defined($interconnects{"$node1:$node2"})) {
$interconnects{"$node1:$node2"} += $bw; $interconnects{"$node1:$node2"} += $bw;
} else { } else {
$interconnects{"$node1:$node2"} = $bw; $interconnects{"$node1:$node2"} = new Math::BigInt $bw;
} }
} else { } else {
# !!! - Here we use our knowledge that in the wires table links # !!! - Here we use our knowledge that in the wires table links
...@@ -819,8 +820,11 @@ if ($TRACK_INTERSWITCH_BANDWIDTH) { ...@@ -819,8 +820,11 @@ if ($TRACK_INTERSWITCH_BANDWIDTH) {
foreach $interconnect (keys(%interconnects)) { foreach $interconnect (keys(%interconnects)) {
($src,$dst) = split(":",$interconnect); ($src,$dst) = split(":",$interconnect);
print "link link-$interconnect $src $dst $interconnects{$interconnect} " . my $speed = $interconnects{$interconnect};
"0 0 1 ethernet\n"; # This is really dumb - BigInts like to print out with a leading '+',
# which we don't want. Stript it off.
$speed =~ s/^\+|-//;
print "link link-$interconnect $src $dst $speed 0 0 1 ethernet\n";
} }
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment