diff --git a/db/VirtExperiment.pm.in b/db/VirtExperiment.pm.in index ca176013b40c22f008a02a0fe526c79863336e46..3b8090a7f5d9264f5345e6e3fbde493d4e533e21 100644 --- a/db/VirtExperiment.pm.in +++ b/db/VirtExperiment.pm.in @@ -112,6 +112,7 @@ my $debug = 0; # be updated. # %experiment_fields = ("multiplex_factor" => 1, + "packing_strategy" => 1, "forcelinkdelays" => 1, "uselinkdelays" => 1, "usewatunnels" => 1, diff --git a/tbsetup/mapper.in b/tbsetup/mapper.in index 450575d01ede80380b799b37e4be0e7ce827d7af..05620c190802751c6096c7391eff45725cc6ee8b 100644 --- a/tbsetup/mapper.in +++ b/tbsetup/mapper.in @@ -288,6 +288,8 @@ my $real_user = User->RealUser(); # multiplex_factor default. $mfactor = $experiment->multiplex_factor() if (!defined($mfactor) && defined($experiment->multiplex_factor())); +$packoption = $experiment->packing_strategy() + if (!defined($packoption) && defined($experiment->packing_strategy())); # NS file can say to run the prepass. my $useprepass = $experiment->useprepass(); diff --git a/tbsetup/ns2ir/parse.tcl.in b/tbsetup/ns2ir/parse.tcl.in index 5e4910428edf9d72f2b15a91bac837141ae68929..7625f7c69434b1ebef81bd4210bb25ccd34bbad0 100644 --- a/tbsetup/ns2ir/parse.tcl.in +++ b/tbsetup/ns2ir/parse.tcl.in @@ -1,7 +1,7 @@ #!/usr/local/bin/otclsh # -# Copyright (c) 2000-2014 University of Utah and the Flux Group. +# Copyright (c) 2000-2016 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -227,6 +227,9 @@ namespace eval GLOBALS { # Control multiplex_factor for the experiment. Crude. variable multiplex_factor {} + # Control packing strategy for the experiment. pack or balance. + variable packing_strategy {} + # The name of the sync_server variable sync_server {} diff --git a/tbsetup/ns2ir/sim.tcl.in b/tbsetup/ns2ir/sim.tcl.in index a52c347089222149110bc8b3a8efdd783065d6e7..5ef7d4fb02597c43e6970ec61755ef6cb5f051c6 100644 --- a/tbsetup/ns2ir/sim.tcl.in +++ b/tbsetup/ns2ir/sim.tcl.in @@ -1,6 +1,6 @@ # -*- tcl -*- # -# Copyright (c) 2000-2015 University of Utah and the Flux Group. +# Copyright (c) 2000-2016 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -501,6 +501,7 @@ Simulator instproc run {} { var_import ::GLOBALS::uselinkdelays var_import ::GLOBALS::forcelinkdelays var_import ::GLOBALS::multiplex_factor + var_import ::GLOBALS::packing_strategy var_import ::GLOBALS::sync_server var_import ::GLOBALS::use_ipassign var_import ::GLOBALS::ipassign_args @@ -742,6 +743,10 @@ Simulator instproc run {} { lappend fields "multiplex_factor" lappend values $multiplex_factor } + if { $packing_strategy != {} } { + lappend fields "packing_strategy" + lappend values $packing_strategy + } if { $sync_server != {} } { lappend fields "sync_server" diff --git a/tbsetup/ns2ir/tb_compat.tcl.in b/tbsetup/ns2ir/tb_compat.tcl.in index de25585ebc99b4debe06d0aab396c8f4b5f17e6b..17cabb70b69694df8ef477f94107c2feccece0ca 100644 --- a/tbsetup/ns2ir/tb_compat.tcl.in +++ b/tbsetup/ns2ir/tb_compat.tcl.in @@ -1,6 +1,6 @@ # -*- tcl -*- # -# Copyright (c) 2000-2014 University of Utah and the Flux Group. +# Copyright (c) 2000-2016 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # @@ -1541,6 +1541,20 @@ proc tb-set-colocate-factor {factor} { set multiplex_factor $factor } +# +# Set the packing strategy assign uses. +# +proc tb-set-packing-strategy {strategy} { + var_import ::GLOBALS::packing_strategy + + if {$strategy != "pack" && $strategy != "balance"} { + perror "\[tb-set-packing-strategy] strategy must be pack|balance" + return + } + + set packing_strategy $strategy +} + # # Set the sync server for the experiment. Must a vnode name that has been # allocated.