Commit dc2508d7 authored by Leigh Stoller's avatar Leigh Stoller

Add tb-set-wasolver-weights function. The format of the command is:

	tb-set-wasolver-weights delay bw plr

Where I am told proper defaults are 1, 10, 500. Setting any to zero
effectively drops that metric from consideration when the solver runs.
I've updated the tb_compat files and the documentation.
parent 4fe6e001
......@@ -27,6 +27,7 @@ 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} {}
proc tb-set-wasolver-weights {delay bw plr} {}
Class Program
......
......@@ -179,6 +179,11 @@ namespace eval GLOBALS {
# For remote nodes. Use latest widearea data.
variable uselatestwadata 0
# For remote nodes. The solver weights.
variable wa_delay_solverweight 1
variable wa_bw_solverweight 7
variable wa_plr_solverweight 500
# This is the file handler for the warnings file
variable WARN_FILE [open "$eid.warnings" w]
......
......@@ -287,6 +287,9 @@ Simulator instproc run {} {
var_import ::GLOBALS::impotent
var_import ::GLOBALS::vtypes
var_import ::GLOBALS::uselatestwadata
var_import ::GLOBALS::wa_delay_solverweight
var_import ::GLOBALS::wa_bw_solverweight
var_import ::GLOBALS::wa_plr_solverweight
# Fill out IPs
foreach obj [concat [array names lanlink_list]] {
......@@ -351,7 +354,7 @@ Simulator instproc run {} {
$prog updatedb $DB
}
sql exec $DB "update experiments set uselatestwadata=$uselatestwadata where pid='$pid' and eid='$eid'"
sql exec $DB "update experiments set uselatestwadata=$uselatestwadata,wa_delay_solverweight=$wa_delay_solverweight,wa_bw_solverweight=$wa_bw_solverweight,wa_plr_solverweight=$wa_plr_solverweight where pid='$pid' and eid='$eid'"
sql endquery $DB
foreach event $event_list {
......
......@@ -503,3 +503,22 @@ proc tb-set-uselatestwadata {onoff} {
set uselatestwadata $onoff
}
proc tb-set-wasolver-weights {delay bw plr} {
var_import ::GLOBALS::wa_delay_solverweight
var_import ::GLOBALS::wa_bw_solverweight
var_import ::GLOBALS::wa_plr_solverweight
if {($delay < 0) || ($bw < 0) || ($plr < 0)} {
perror "\[tb-set-wasolver-weights] Weights must be postive integers."
return
}
if {($delay == {}) || ($bw == {}) || ($plr == {})} {
perror "\[tb-set-wasolver-weights] Must provide delay, bw, and plr."
return
}
set wa_delay_solverweight $delay
set wa_bw_solverweight $bw
set wa_plr_solverweight $plr
}
......@@ -718,3 +718,42 @@ tb-fix-node $node0 pc42
done.
<li>Do not use this command on nodes that are a virtual type.
</ul>
<h4>tb-set-uselatestwadata</h4>
<pre>
tb-set-uselatestwadata 0
tb-set-uselatestwadata 1
</pre>
<p>Notes:
<ul>
<li>This command indicates which widearea data to use when mapping
widearea nodes to links. The default is 0, which says to use the aged data.
Setting it to 1 says to use the most recent data.
</ul>
<h4>tb-set-wasolver-weights</h4>
<pre>
tb-set-wasolver-weights <i>delay bw plr</i>
tb-set-wasolver-weights 1 10 500
</pre>
<dl>
<dt><i>delay</i> - The weight to give delay when solving.
<dt><i>bw</i> - The weight to give bandwidth when solving.
<dt><i>plr</i> - The weight to give lossrate when solving.
</dl>
<p>Notes:
<ul>
<li>This command sets the relative weights to us when assigning widearea
nodes to links. Specifying a zero says to ignore that particular
metric when doing the assignment. Setting all three to zero results
in an essentially random selection.
</ul>
......@@ -26,3 +26,5 @@ 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} {}
proc tb-set-wasolver-weights {delay bw plr} {}
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