Commit d4c68c70 authored by Leigh B Stoller's avatar Leigh B Stoller

Add support for specifying packing strategy and pass appropriate option

to the mapper and then to assign.
parent f0f024a6
......@@ -758,6 +758,11 @@ sub GetTicketAuxAux($$$$$$$$$$$)
# max for the node, but in general we set it low here.
#
$virtexperiment->multiplex_factor(GeniXML::MultiplexFactor($rspec) || 10);
#
# The packing strategy is sorta independent; the user can specify either
# pack or balance (load balance).
#
my $packing_option = GeniXML::PackingStrategy($rspec);
#
# Add global vtypes.
......@@ -2471,6 +2476,7 @@ sub GetTicketAuxAux($$$$$$$$$$$)
# (the mapper will pass internal option to assign to prevent fixnode).
#
my $aopts = ($isupdate ? "-u" : "");
$aopts .= " -S $packing_option" if (defined($packing_option));
$output =
GeniUtil::ExecQuiet("$MAPPER -a -d -v $aopts -z -o $tmpfile $pid $eid");
......
......@@ -900,6 +900,19 @@ sub MultiplexFactor($)
return undef;
}
sub PackingStrategy($)
{
my ($rspec) = @_;
my $tmp = FindNodesNS("n:packing_strategy", $rspec, $EMULAB_NS)->pop();
if (defined($tmp)) {
my $strategy = GetText("strategy", $tmp);
return $strategy
if (defined($strategy) && $strategy =~ /^(pack|balance)$/);
}
return undef;
}
sub OpenFlowController($)
{
my ($link) = @_;
......
......@@ -71,7 +71,7 @@ sub usage ()
print STDERR " -A - Tell ptopgen all nodes are free; only with -n\n";
exit($WRAPPER_FAILED);
}
my $optlist = "dvunfprqczxm:ko:altzZACFNL:";
my $optlist = "dvunfprqczxm:ko:altzZACFNL:S:";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
......@@ -85,6 +85,7 @@ my $prepass = 0;
my $alloconly = 0;
my $outfile;
my $mfactor;
my $packoption;
my $regression = 0;
my $noassign = 0; # Only with regression mode, use previous solution.
my $noregfree = 0; # Only with regression mode, leave physical state at end.
......@@ -201,6 +202,11 @@ if (defined($options{"f"})) {
if (defined($options{"F"})) {
$fixlannodes = 1;
}
if (defined($options{"S"})) {
$packoption = $options{"S"};
fatal("Bad -S option; must be pack or balance")
if (! ($packoption eq "balance" || $packoption eq "pack"));
}
if (defined($options{"p"})) {
$precheck = 1;
}
......@@ -706,6 +712,8 @@ sub RunAssign($$)
if ($vtop->virtnodecount() || $vtop->simnodecount());
$args = "-n $args"
if ($precheck);
$args = "-S $packoption $args"
if (defined($packoption));
$args = "-s 123456 $args"
if ($regression);
$args = "-R $args PN=1.0"
......
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