Commit 8613a204 authored by Leigh Stoller's avatar Leigh Stoller

Add parser changes for tb-set-uselatestwadata as Rob requested.

Also add required changes to wanlinkinfo and wanassign.
parent 5d569c2d
......@@ -26,6 +26,7 @@ proc tb-make-soft-vtype {name types} {}
proc tb-make-hard-vtype {name types} {}
proc tb-set-lan-simplex-params {lan node todelay tobw toloss fromdelay frombw fromloss} {}
proc tb-set-link-simplex-params {link src delay bw loss} {}
proc tb-set-uselatestwadata {onoff} {}
Class Program
......
......@@ -284,6 +284,7 @@ Simulator instproc run {} {
var_import ::GLOBALS::DB
var_import ::GLOBALS::impotent
var_import ::GLOBALS::vtypes
var_import ::TBCOMPAT::uselatestwadata
# Fill out IPs
foreach obj [concat [array names lanlink_list]] {
......@@ -347,6 +348,9 @@ Simulator instproc run {} {
foreach prog [array names prog_list] {
$prog updatedb $DB
}
sql exec $DB "update experiments set uselatestwadata=$uselatestwadata where pid='$pid' and eid='$eid'"
sql endquery $DB
foreach event $event_list {
sql exec $DB "insert into eventlist (pid,eid,time,vnode,vname,objecttype,eventtype,arguments,atstring) values (\"$pid\",\"$eid\",[lindex $event 0],\"[lindex $event 1]\",\"[lindex $event 2]\",$objtypes([lindex $event 3]),$eventtypes([lindex $event 4]),\"[lindex $event 5]\",\"[lindex $event 6]\")"
......
......@@ -21,6 +21,9 @@ namespace eval TBCOMPAT {
# This is the default weight for a hard vtype.
variable default_hard_vtype_weight 1.0
# For remote nodes. Use latest info.
variable uselatestwadata 0
# This is a general procedure that takes a node, an object (lan or link)
# it is connected to, and an IP address, and sets the IP address
# for the node on that object. It checks both the validity of the
......@@ -488,4 +491,15 @@ proc tb-set-lan-simplex-params {lan node todelay tobw toloss fromdelay frombw fr
$lan set rloss([list $node $port]) $fromloss
$lan set bandwidth([list $node $port]) $realtobw
$lan set rbandwidth([list $node $port]) $realfrombw
}
\ No newline at end of file
}
proc tb-set-uselatestwadata {onoff} {
var_import ::TBCOMPAT::uselatestwadata
if {$onoff != 0 && $onoff != 1} {
perror "\[tb-set-uselatestwadata] $onoff must be 0/1"
return
}
set uselatestwadata $onoff
}
......@@ -112,6 +112,9 @@ my $remotecount = 0;
my @toreserve;
my %mappings;
# Use latest data flag. From the experiments table.
my $uselatestwadata = 0;
#
# A node record (poor man struct). We create a hashed array of these,
# indexed by the vnode name.
......@@ -158,6 +161,14 @@ sub newvlan ($) {
};
}
#
# Get the flag
#
$query_result =
DBQueryFatal("select uselatestwadata from experiments ".
"where pid='$pid' and eid='$eid'");
($uselatestwadata) = $query_result->fetchrow_array();
#
# Get type map.
#
......@@ -514,6 +525,9 @@ sub runwansolver() {
# the fixed nodes, but I'm not gonna worry about that right now since the
# solver will just croak anyway.
#
if ($uselatestwadata) {
$waninfoargs .= " -l";
}
open(INFO, "$waninfo $waninfoargs | tee wanlinkinfo.output |") or
die("*** $0:\n".
" Could not start $waninfo: $!\n");
......
......@@ -10,12 +10,13 @@ use Getopt::Std;
sub usage()
{
print STDOUT
"Usage: wanlinkinfo [-d] [-m] [-b]\n".
"Usage: wanlinkinfo [-d] [-m] [-b] [-l]\n".
" Use -m to output virtual node counts per phys node.\n".
" Use -b to output bandwidth matrix.\n";
" Use -b to output bandwidth matrix.\n".
" Use -l to use the latest data instead of aged data.\n";
exit(-1);
}
my $optlist = "dmb";
my $optlist = "dmbl";
#
# Configure variables
......@@ -33,6 +34,7 @@ use libtestbed;
my $debug = 0;
my $dobw = 0;
my $dovirt = 0;
my $dolatest = 0;
#
# Turn off line buffering on output
......@@ -63,10 +65,14 @@ if (defined($options{"m"})) {
if (defined($options{"b"})) {
$dobw= 1;
}
if (defined($options{"l"})) {
$dolatest= 1;
}
my $result =
DBQueryFatal("SELECT node_id1,iface1,node_id2,iface2,time,bandwidth " .
"FROM widearea_delays");
"FROM " .
($dolatest ? "widearea_recent" : "widearea_delays"));
my %nodename = ();
my %speeds = ();
......
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