Commit 7c453f88 authored by Robert Ricci's avatar Robert Ricci

Pull the speed limit for trivial links from the database instead of

hardwiring it in this script.
parent 6f9742ae
...@@ -115,10 +115,10 @@ if (defined($options{"e"})) { ...@@ -115,10 +115,10 @@ if (defined($options{"e"})) {
my $result = my $result =
DBQueryFatal("select class,type,delay_capacity,". DBQueryFatal("select class,type,delay_capacity,".
" virtnode_capacity,isvirtnode,simnode_capacity, " . " virtnode_capacity,isvirtnode,simnode_capacity, " .
" speed, RAM ". " speed, RAM, trivlink_maxspeed ".
"from node_types"); "from node_types");
while (($class,$type,$delaycapacity, while (($class,$type,$delaycapacity,
$virtcapacity,$isvirt,$simcapacity, $speed, $ram) $virtcapacity,$isvirt,$simcapacity, $speed, $ram, $trivspeed)
= $result->fetchrow_array) { = $result->fetchrow_array) {
$map = {}; $map = {};
$map->{'CLASS'} = $class; $map->{'CLASS'} = $class;
...@@ -128,6 +128,7 @@ while (($class,$type,$delaycapacity, ...@@ -128,6 +128,7 @@ while (($class,$type,$delaycapacity,
$map->{'ISVIRT'} = $isvirt; $map->{'ISVIRT'} = $isvirt;
$map->{'SPEED'} = $speed; $map->{'SPEED'} = $speed;
$map->{'RAM'} = $ram; $map->{'RAM'} = $ram;
$map->{'TRIVSPEED'}= $trivspeed;
$map->{'FEATURES'} = []; $map->{'FEATURES'} = [];
$map->{'AUXTYPES'} = {}; $map->{'AUXTYPES'} = {};
$typemap{$type} = $map; $typemap{$type} = $map;
...@@ -279,6 +280,7 @@ foreach $node (keys(%nodes)) { ...@@ -279,6 +280,7 @@ foreach $node (keys(%nodes)) {
my $simnode_capacity = $typemap{$type}->{'SIMCAP'}; my $simnode_capacity = $typemap{$type}->{'SIMCAP'};
my $cpu_speed = $typemap{$type}->{'SPEED'}; my $cpu_speed = $typemap{$type}->{'SPEED'};
my $ram = $typemap{$type}->{'RAM'}; my $ram = $typemap{$type}->{'RAM'};
my $trivspeed = $typemap{$type}->{'TRIVSPEED'};
my @types = ("$type:1"); my @types = ("$type:1");
my @features; my @features;
...@@ -340,8 +342,10 @@ foreach $node (keys(%nodes)) { ...@@ -340,8 +342,10 @@ foreach $node (keys(%nodes)) {
# #
if ($needvirtgoo) { if ($needvirtgoo) {
push @types, "*lan:*"; push @types, "*lan:*";
# Add trivial bw spec. # Add trivial bw spec., but only if the node type has it
push @flags, "trivial_bw:400000"; if ($trivspeed) {
push @flags, "trivial_bw:$trivspeed";
}
# Add CPU and RAM information # Add CPU and RAM information
$cpu_ram_features_present++; $cpu_ram_features_present++;
# This number can be use for fine-tuning packing # This number can be use for fine-tuning packing
......
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