Commit f904b554 authored by Leigh Stoller's avatar Leigh Stoller

Some minor fixes so that wanassign respects the collocate factor

set by the user. This was added for local jails, but is applicable to
widearea assignment too.
parent 2202fc5a
......@@ -120,6 +120,7 @@ my $uselatestwadata = 0;
my $wa_delay_solverweight = 1.0;
my $wa_bw_solverweight = 7.0;
my $wa_plr_solverweight = 500.0;
my $multiplex_factor;
# The BOSS name in the widearea info tables.
my $boss = TBDB_WIDEAREA_LOCALNODE;
......@@ -176,11 +177,12 @@ sub newvlan ($) {
#
$query_result =
DBQueryFatal("select uselatestwadata,wa_delay_solverweight, ".
" wa_bw_solverweight,wa_plr_solverweight ".
" wa_bw_solverweight,wa_plr_solverweight,multiplex_factor ".
" from experiments ".
"where pid='$pid' and eid='$eid'");
($uselatestwadata,$wa_delay_solverweight,
$wa_bw_solverweight,$wa_plr_solverweight) = $query_result->fetchrow_array();
$wa_bw_solverweight,$wa_plr_solverweight,$multiplex_factor)
= $query_result->fetchrow_array();
if ($uselatestwadata) {
printdb("Using latest widearea data.\n");
}
......@@ -270,6 +272,7 @@ foreach my $vnode (keys(%virtnodes)) {
my $type = $virtnode->{TYPE};
my $fixed = $virtnode->{FIXED};
# See above, type=class for classes!
if ($typemap{$type} eq $type) {
$classcount++;
}
......@@ -556,6 +559,9 @@ sub runwansolver() {
if (! $seenboss) {
$waninfoargs .= " -r";
}
if (defined($multiplex_factor)) {
$waninfoargs .= " -c $multiplex_factor";
}
open(INFO, "$waninfo $waninfoargs |") or
die("*** $0:\n".
" Could not start $waninfo: $!\n");
......
......@@ -17,7 +17,7 @@ use Getopt::Std;
sub usage()
{
print STDOUT
"Usage: wanlinkinfo [-d] [-m] [-b] [-l] [-p] [-r]\n".
"Usage: wanlinkinfo [-d] [-m [-c <count>]] [-b] [-l] [-p] [-r]\n".
" Use -m to output virtual node counts per phys node.\n".
" Use -b to output bandwidth matrix.\n".
" Use -p to output plr matrix.\n".
......@@ -25,7 +25,7 @@ sub usage()
" Use -l to use the latest data instead of aged data.\n";
exit(-1);
}
my $optlist = "dmblrp";
my $optlist = "dmc:blrp";
#
# Configure variables
......@@ -44,6 +44,7 @@ my $debug = 0;
my $dobw = 0;
my $doplr = 0;
my $dovirt = 0;
my $collocate = 10000;
my $dolatest = 0;
my $noboss = 0;
......@@ -72,6 +73,9 @@ if (defined($options{"d"})) {
}
if (defined($options{"m"})) {
$dovirt = 1;
if (defined($options{"c"})) {
$collocate = $options{"c"};
}
}
if (defined($options{"b"})) {
$dobw= 1;
......@@ -142,8 +146,12 @@ $result =
while (my ($node_id, $phys_nodeid, $count) = $result->fetchrow) {
if ($dovirt) {
#
# In dovirt mode, we care about how many free vnodes per real node.
# In dovirt mode, we care about how many free vnodes per real node,
# limited by the requested collocate factor.
#
$count = $collocate
if ($count > $collocate);
if ($node_id ne $phys_nodeid) {
$freenodes{$phys_nodeid} = $count;
}
......
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