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; ...@@ -11,12 +11,14 @@ use Getopt::Std;
sub usage() 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" . " -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); exit(-1);
} }
my $optlist = "s:e:"; my $optlist = "s:e:m:";
my $mfactor;
# Settings - Change these to your particular network. # Settings - Change these to your particular network.
...@@ -63,6 +65,9 @@ if (@ARGV) { ...@@ -63,6 +65,9 @@ if (@ARGV) {
if (defined($options{"s"})) { if (defined($options{"s"})) {
$switchtouse = $options{"s"}; $switchtouse = $options{"s"};
} }
if (defined($options{"m"})) {
$mfactor = $options{"m"};
}
if (defined($options{"e"})) { if (defined($options{"e"})) {
($exempt_pid, $exempt_eid) = split( /\//, $options{"e"} ); ($exempt_pid, $exempt_eid) = split( /\//, $options{"e"} );
...@@ -172,16 +177,17 @@ foreach $node (keys(%nodes)) { ...@@ -172,16 +177,17 @@ foreach $node (keys(%nodes)) {
### and therefore we can support sim nodes ### and therefore we can support sim nodes
################################################################# #################################################################
$text .= " sim:100000"; $text .= " sim:100000";
#
# Ditto for jailed nodes
#
$text .= " pcvm:10";
} }
if ($virtnode_capacity > 0) { if ($virtnode_capacity > 0) {
# #
# Ditto for jailed nodes # Ditto for jailed nodes
# #
$text .= " pcvm:$virtnode_capacity"; if (defined($mfactor)) {
$text .= " pcvm:$mfactor";
}
else {
$text .= " pcvm:$virtnode_capacity";
}
} }
print "$text\n"; 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