Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
8613a204
Commit
8613a204
authored
May 17, 2002
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add parser changes for tb-set-uselatestwadata as Rob requested.
Also add required changes to wanlinkinfo and wanassign.
parent
5d569c2d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
5 deletions
+44
-5
tbsetup/ns2ir/nstb_compat.tcl
tbsetup/ns2ir/nstb_compat.tcl
+1
-0
tbsetup/ns2ir/sim.tcl.in
tbsetup/ns2ir/sim.tcl.in
+4
-0
tbsetup/ns2ir/tb_compat.tcl.in
tbsetup/ns2ir/tb_compat.tcl.in
+15
-1
tbsetup/wanassign.in
tbsetup/wanassign.in
+14
-0
tbsetup/wanlinkinfo.in
tbsetup/wanlinkinfo.in
+10
-4
No files found.
tbsetup/ns2ir/nstb_compat.tcl
View file @
8613a204
...
...
@@ -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
...
...
tbsetup/ns2ir/sim.tcl.in
View file @
8613a204
...
...
@@ -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]\")"
...
...
tbsetup/ns2ir/tb_compat.tcl.in
View file @
8613a204
...
...
@@ -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
}
tbsetup/wanassign.in
View file @
8613a204
...
...
@@ -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
");
...
...
tbsetup/wanlinkinfo.in
View file @
8613a204
...
...
@@ -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
=
"
dmb
l
";
#
# 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
=
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment