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

First attempt at kludging the mix of 1GB and 10G link problem. Use -G

option to the mapper, which passes along a -G option to ptopgen when
it should remove all 10G links.
parent 1bcc428f
#!/usr/bin/perl -w
#
# Copyright (c) 2005-2015 University of Utah and the Flux Group.
# Copyright (c) 2005-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -268,6 +268,8 @@ sub simnodecount($) { return $_[0]->counter("simcount"); }
sub remotenodecount($) { return $_[0]->counter("remotecount"); }
sub sharednodecount($) { return $_[0]->counter("sharedcount"); }
sub bstorecount($) { return $_[0]->counter("bstorecount"); }
sub gblinks($) { return $_[0]->counter("Gblinks"); }
sub mgblinks($) { return $_[0]->counter("MGblinks"); }
sub createLink($$$$$$$$$)
{
......@@ -2613,6 +2615,8 @@ sub PrintSummaryStats($)
if ($reserved_physcount) {
print "Reserved pnodes = $reserved_physcount\n";
}
print "<= 1G links = " . $self->counters()->{'Gblinks'} . "\n";
print " > 1G links = " . $self->counters()->{'MGblinks'} . "\n";
}
return 0;
}
......@@ -3316,6 +3320,23 @@ sub GenVirtLans($)
$errors++;
}
#
# Lets see how many <=1Gb and >1Gb links we have. HACK!
#
if (!$emulated && ($bandwidth > 0 || $rbandwidth)) {
# Must convert this to kbps like everything else is.
my $OneGb = 1000 * 1000;
my $maxbw = max($bw, $rbw);
if ($maxbw <= $OneGb) {
$self->counters()->{'Gblinks'}++;
}
elsif ($maxbw > $OneGb) {
$self->counters()->{'MGblinks'}++;
}
}
#
# See if the link is really being shaped, or if just need
# a delay node cause of tracing/monitoring.
......@@ -3735,6 +3756,22 @@ sub GenVirtLans($)
my $bandwidth = $self->getbandwidth($member,$vlan,$bw);
my $rbandwidth = $self->getbandwidth($member,$vlan,$rbw);
#
# Lets see how many <=1Gb and >1Gb links we have. HACK!
#
if (!$emulated && ($bandwidth > 0 || $rbandwidth)) {
# Must convert this to kbps like everything else is.
my $OneGb = 1000 * 1000;
my $maxbw = max($bw, $rbw);
if ($maxbw <= $OneGb) {
$self->counters()->{'Gblinks'}++;
}
elsif ($maxbw > $OneGb) {
$self->counters()->{'MGblinks'}++;
}
}
if (($shaped || ($traced && !$trace_endnode)) &&
# Ignore for bridged links.
!$vlan->_bridged() &&
......@@ -4107,6 +4144,8 @@ sub CreateVtop($)
$self->{'COUNTERS'}->{'sharedcount'} = 0;
$self->{'COUNTERS'}->{'bstorecount'} = 0;
$self->{'COUNTERS'}->{'physcount'} = 0;
$self->{'COUNTERS'}->{'Gblinks'} = 0;
$self->{'COUNTERS'}->{'MGblinks'} = 0;
#
# Experiment wide options.
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -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:S:";
my $optlist = "dvunfprqczxm:ko:altzZACFNL:S:G";
my $verbose = 0;
my $debug = 0;
my $fixmode = 0;
......@@ -83,6 +83,7 @@ my $allnodesfree = 0;
my $toponly = 0;
my $prepass = 0;
my $alloconly = 0;
my $gblinkcheck= 0;
my $outfile;
my $mfactor;
my $packoption;
......@@ -202,6 +203,9 @@ if (defined($options{"f"})) {
if (defined($options{"F"})) {
$fixlannodes = 1;
}
if (defined($options{"G"})) {
$gblinkcheck = 1;
}
if (defined($options{"S"})) {
$packoption = $options{"S"};
fatal("Bad -S option; must be pack or balance")
......@@ -679,7 +683,12 @@ sub RunAssign($$)
}
$ptopargs .= "-z "
if ($project->IsNonLocal() || $vtop->sharednodecount());
$ptopargs .= "-l $typelimitfile"
if ($gblinkcheck) {
if ($vtop->mgblinks() == 0) {
$ptopargs .= "-G ";
}
}
$ptopargs .= "-l $typelimitfile "
if (scalar(keys(%admission_control)));
chat("ptopargs: '$ptopargs'\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