Commit a9ab2bdb authored by Leigh Stoller's avatar Leigh Stoller

Allow ptopgen to set a specific multiplex_factor (virtnode_capacity)

from the command line.
parent 76c37c50
......@@ -11,12 +11,14 @@ use Getopt::Std;
sub usage()
{
print STDOUT "Usage: ptopgen [-s switch] [-e pid/eid] \n" .
print STDOUT "Usage: ptopgen [-s switch] [-e pid/eid] [-m factor]\n" .
" -e include given experiment's resources\n" .
" in the ptopfile (as if they were free)\n";
" in the ptopfile (as if they were free)\n" .
" -m Override multiplex_factor\n";
exit(-1);
}
my $optlist = "s:e:";
my $optlist = "s:e:m:";
my $mfactor;
# Settings - Change these to your particular network.
......@@ -63,6 +65,9 @@ if (@ARGV) {
if (defined($options{"s"})) {
$switchtouse = $options{"s"};
}
if (defined($options{"m"})) {
$mfactor = $options{"m"};
}
if (defined($options{"e"})) {
($exempt_pid, $exempt_eid) = split( /\//, $options{"e"} );
......@@ -172,17 +177,18 @@ foreach $node (keys(%nodes)) {
### and therefore we can support sim nodes
#################################################################
$text .= " sim:100000";
#
# Ditto for jailed nodes
#
$text .= " pcvm:10";
}
if ($virtnode_capacity > 0) {
#
# Ditto for jailed nodes
#
if (defined($mfactor)) {
$text .= " pcvm:$mfactor";
}
else {
$text .= " pcvm:$virtnode_capacity";
}
}
print "$text\n";
}
}
......
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