...
 
Commits (2)
#!/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");
......
......@@ -79,12 +79,13 @@ sub usage()
" -l specifies the location of the type limit file\n" .
" -1 Print an rspec containing only the node component-name\n" .
" -z Randomize node output order\n" .
" -G Omit 10G node-switch links\n" .
" -Z Force old ptopgen\n" .
" -f This is generating an advertisement rather than an internal file\n");
exit(-1);
}
my $optlist = "s:e:m:vp:rSan:c:uxg:h1:l:zZCbf";
my $optlist = "s:e:m:vp:rSan:c:uxg:h1:l:zZCbfG";
my $is_advertisement = 0;
my $mfactor;
my $virtstuff = 0;
......@@ -101,6 +102,7 @@ my $useblockstore = 0;
my $component_name = undef;
my $randomize = 0;
my $usecontrol= 0;
my $printFastLinks = 1;
my $OURDOMAIN = "@OURDOMAIN@";
my $MAINSITE = @TBMAINSITE@;
......@@ -327,6 +329,9 @@ if (defined($options{"z"})) {
if (defined($options{"f"})) {
$is_advertisement = 1;
}
if (defined($options{"G"})) {
$printFastLinks = 0;
}
if ($is_advertisement && !$allnodes)
{
......@@ -2045,9 +2050,11 @@ while (($node1,$card1,$port1,$node2,$card2,$port2) =
}
}
print_simple_link($node1, $iface1,
$node2, $iface2,
$bw, 0, 0, \@types);
if ($bw < 10000000 || $printFastLinks) {
print_simple_link($node1, $iface1,
$node2, $iface2,
$bw, 0, 0, \@types);
}
}
}
}
......