Commit 7f62a685 authored by Weibin Sun's avatar Weibin Sun

Merge remote branch 'central/master'

parents 835ce9d2 00f687e7
......@@ -37,6 +37,14 @@ if [ ! -d $dir/iperf-$version/src ]; then
echo "ERROR: iperf-fetch.sh: tar failed"
exit 1
}
# XXX hack to deal with relative paths...argh!
case $srcdir in
/*)
;;
*)
srcdir="../$srcdir"
;;
esac
cd iperf-$version && patch -p0 < $srcdir/iperf-patch || {
echo "ERROR: iperf-fetch.sh: patch failed"
exit 1
......
......@@ -40,6 +40,15 @@ if [ ! -d $dir/rude-$version/src ]; then
if [ -d rude -a ! -d rude-$version ]; then
mv rude rude-$version
fi
# XXX hack to deal with relative paths...argh!
case $srcdir in
/*)
;;
*)
srcdir="../$srcdir"
;;
esac
cd rude-$version && patch -p0 < $srcdir/rude-patch || {
echo "ERROR: rude-fetch.sh: patch failed"
exit 1
......
......@@ -11,3 +11,5 @@ if ! [ -f "$target_dir/bin/tcsh" ]; then
ln -sf /bin/tcsh.fake "$target_dir/bin/tcsh"
ln -sf /bin/tcsh.fake "$target_dir/bin/csh"
fi
touch "$target_dir/etc/mtab"
......@@ -17,6 +17,7 @@ require "@prefix@/etc/node_usage.conf";
chdir "@prefix@/data/node_usage";
my $TOLERANCE = 0.05;
#my $TOLERANCE = 0.10;
my $TOLERANCE_INTERVAL = 1/3;
my $interval = 60*60;
......@@ -26,12 +27,21 @@ my $start = ceil($START / $interval) * $interval;
my @idxs = (0 .. $#to_plot);
my @start;
foreach (@idxs) {
if (defined $to_plot[$_][2]) {
$start[$_] = ceil($to_plot[$_][2] / $interval) * $interval;
} else {
$start[$_] = $start;
}
}
my $prev_time = 0;
my @prev_data = map {0} @idxs;
my @total_so_far = map {0} @idxs;
my $next_cutoff = $start;
my $error_frac = 0;
my @error_frac = map {0} @idxs;
open F, "node_usage.raw";
open O, ">node_usage-$interval_name.dat";
......@@ -52,6 +62,11 @@ sub sum_usage_stats ($) {
return @res;
}
sub filter_w_start ($@) {
my $time = shift @_;
return map {$time >= $start[$_] ? $_[$_] : 'NaN'} @idxs;
}
while (<F>) {
chop;
s/^(\d+) (\d+) // or die;
......@@ -67,19 +82,20 @@ while (<F>) {
my @data = sum_usage_stats(1);
my @error = sum_usage_stats(2);
@data = map {$data[$_] + $error[$_]/2} @idxs;
if (any map {$error[$_] > $num[$_]*$TOLERANCE} @idxs) {
#print STDERR "ERROR $time: $error\n";
@data = map {'NaN'} @idxs;
}
@data = map {$error[$_] > $num[$_]*$TOLERANCE
? 'NaN' : $data[$_]} @idxs;
# if (any map {$error[$_] > $num[$_]*$TOLERANCE} @idxs) {
# print STDERR "ERROR $time: ", join (' ', map {"$error[$_] > ".$num[$_]*$TOLERANCE} @idxs), "\n";
# }
use warnings;
my $combine = sub {
my ($t) = (@_);
my $frac = ($t - $prev_time)/$interval;
if ($prev_data[0] != $prev_data[0]) { # ie NaN
$error_frac += $frac;
} else {
foreach my $i (@idxs) {
foreach my $i (@idxs) {
if ($prev_data[$i] != $prev_data[$i]) { # ie NaN
$error_frac[$i] += $frac;
} else {
$total_so_far[$i] += $prev_data[$i] * $frac;
}
}
......@@ -88,20 +104,20 @@ while (<F>) {
while ($time >= $next_cutoff) {
&$combine($next_cutoff);
my @free = @total_so_far;
if ($error_frac > $TOLERANCE_INTERVAL) {
foreach my $i (@idxs) {
$free[0] = 'NaN';
}
} else {
foreach my $i (@idxs) {
$free[$i] /= (1 - $error_frac);
foreach my $i (@idxs) {
if ($error_frac[$i] > $TOLERANCE_INTERVAL) {
$free[$i] = 'NaN';
} else {
$free[$i] /= (1 - $error_frac[$i]);
}
}
my @alloc = map {$num[$_] - $free[$_]} @idxs;
my $dtime = $next_cutoff - $interval;
@free = filter_w_start $dtime, @free;
@alloc = filter_w_start $dtime, @alloc;
print O join(' ', $dtime, map {sprintf("%.1f", $_)} (@free, @alloc)),"\n"
if $dtime >= $start;
$error_frac = 0;
@error_frac = map {0} @idxs;
@total_so_far = map {0} @idxs;
$prev_time = $next_cutoff;
$next_cutoff += $interval;
......
......@@ -25,11 +25,11 @@ my %res;
sub tally ($$@) {
my ($str, $what, @d) = @_;
if ($d[0] != $d[0]) { # ie NaN
$res{$what}{data}{$str}{invalid}++;
} else {
$res{$what}{data}{$str}{count}++;
foreach my $i (@idxs) {
foreach my $i (@idxs) {
if ($d[$i] != $d[$i]) { # ie NaN
$res{$what}{data}{$str}{invalid}[$i]++;
} else {
$res{$what}{data}{$str}{count}[$i]++;
$res{$what}{data}{$str}{data}[$i] += $d[$i];
}
}
......@@ -37,9 +37,9 @@ sub tally ($$@) {
sub tally_mod ($$@) {
my ($bin, $what, @d) = @_;
return if $d[0] != $d[0]; # ie NaN
$res{$what}{data}[$bin]{count}++;
foreach my $i (@idxs) {
next if $d[$i] != $d[$i]; # ie NaN
$res{$what}{data}[$bin]{count}[$i]++;
$res{$what}{data}[$bin]{data}[$i] += $d[$i];
}
}
......@@ -91,13 +91,14 @@ foreach my $k (keys %res) {
foreach my $i (sort keys %{$res{$k}{data}}) {
my @r;
my $d = $res{$k}{data}{$i};
my $invalid = $d->{invalid};
my $count = $d->{count};
if ($invalid / ($invalid + $count) > $TOLERANCE_INTERVAL) {
@r = map {'NaN'} @idxs;
} else {
foreach my $j (@idxs) {
foreach my $j (@idxs) {
my $invalid = $d->{invalid}[$j];
my $count = $d->{count}[$j];
if ($invalid / ($invalid + $count) > $TOLERANCE_INTERVAL) {
$r[$j] = 'NaN';
} else {
$r[$j] = $d->{data}[$j]/$count;
die "Unexpected NaN" if $r[$j] != $r[$j];
}
}
print F join(' ', "$i ", map {sprintf("%5.1f", $_)} @r),"\n"
......@@ -108,9 +109,8 @@ foreach my $k (keys %res) {
foreach my $i (0 .. $#{$res{$k}{data}}) {
my @r;
my $d = $res{$k}{data}[$i];
my $count = $d->{count};
foreach my $j (@idxs) {
$r[$j] = $d->{data}[$j]/$count;
$r[$j] = $d->{data}[$j] ? $d->{data}[$j]/$d->{count}[$j] : 0;
}
print F join(' ', sprintf("%6.3f ", $i/$div), map {sprintf("%5.1f", $_)} @r),"\n"
}
......
......@@ -10,6 +10,8 @@ use POSIX qw(strftime floor ceil);
use Data::Dumper;
use Carp;
my $LIMIT = 3000000;
$Data::Dumper::Indent = 1;
use strict;
......@@ -54,6 +56,8 @@ our $prev;
our $prev_line;
our $last_history_id = -1;
my $again = 0;
if ($prep) {
if ($fresh) {
......@@ -81,7 +85,11 @@ if ($prep) {
do "gather.state.1";
}
$qr = DBQueryFatal("select history_id,node_id,op,stamp from $NODE_USAGE_DB.node_history_copy where history_id > $last_history_id order by history_id");
$qr = DBQueryFatal("select history_id,node_id,op,stamp from $NODE_USAGE_DB.node_history_copy where history_id > $last_history_id order by history_id limit $LIMIT");
if ($qr->num_rows() == $LIMIT) {
$again = 1;
}
my $prev_history_id = $last_history_id;
......@@ -162,13 +170,7 @@ if ($results) {
close F;
}
if ($again) {
printf STDERR "Too many rows to handle at once, running again...\n";
exec "@prefix@/libexec/node_usage/gather";
}
......@@ -23,8 +23,11 @@ $NODE_USAGE_DB = 'node_usage';
# ...
#
@to_plot = (
["pc600 pc850 pc2000 pc3000s", [qw(pc600 pc850 pc2000 pc3000)]],
["pc3000s", [qw(pc3000)]]
["pc600 pc850 pc2000 pc3000s d710s", [qw(pc600 pc850 pc2000 pc3000 d710)]],
["pc3000s", [qw(pc3000)]],
# ["d710s", [qw(d710)], 1282575600] # latter start data:
# # when nodes were announced
["d710s", [qw(d710)], 1269466000]
);
#
......@@ -34,19 +37,16 @@ $avail_header = <<'---';
<p>
These graphs show the average number of free nodes over various time
periods. Nodes are broken down into two classes: The first class are the
<a href="http://users.emulab.net/trac/emulab/wiki/pc3000">pc3000</a>s,
which are the most numerous, and are fairly modern. They are
most experimenters' nodes of choice. For many experimenters, the number of
free pc3000s limits the size of the experiments they can run.
The second class includes other, older PCs (along with the pc3000s) to give
a sense for how many nodes are available if one is willing to use some
slower nodes.
</p>
<p>
Emulab currently includes around 350 PC nodes. As you can see, most of those
are in use even during our periods of &quot;light&quot; usage.
periods. Nodes are broken down into three classes: The first class includes
all "pc" node types, from the slowest to the fastest. The other two classes
show the most numerous and desirable node types, the
<a href="http://users.emulab.net/trac/emulab/wiki/pc3000">pc3000</a>s
and the
<a href="http://users.emulab.net/trac/emulab/wiki/d710">d710</a>s
which both have Gb Ethernet interfaces.
For many experimenters, the number of
free pc3000s and d710s limit the size of the experiments they can run.
Emulab currently includes around 500 PC nodes.
</p>
<p>
......@@ -58,6 +58,11 @@ years), it may not reflect recent
trends.
</p>
---
# Note removed:
# As you can see, most of those are in use even during our
# periods of "light" usage.
# After "Emulab currently includes around 500 PC nodes"
# from above for now since it probably not true.
$avail_footer = <<'---';
<p align=center>
......
......@@ -449,6 +449,10 @@ sub LightUpNodes($@)
my $op = $node->_setupoperation();
my $action;
# Nothing to do.
next
if ($op == $NOSTATE);
if ($op == $RELOAD) {
my $image = $node->_loadimage();
......
......@@ -1276,6 +1276,9 @@ sub LoadVirtNodes($)
my $vnode = $self->vnodes()->{$vname};
my $osid;
next
if ($vnode->_isgeninode());
next
if (! ($vnode->_isvirtnode() && $vnode->_fixedvm()));
......@@ -4173,8 +4176,10 @@ sub InterpNodes($)
my $vnode = $self->vnodes()->{$vname};
my $fixed = $self->fixednodes()->{$vname};
# Delay and internal nodes do not have an entry in vnodes().
next
if (! ($vnode->_isvirtnode() && $vnode->_fixedvm()));
if (! (defined($vnode) &&
$vnode->_isvirtnode() && $vnode->_fixedvm()));
$self->AddNodeToSolution($vname, $self->solution()->{'V2P'}->{$fixed})
if (!exists($self->solution()->{'V2P'}->{$vname}));
......@@ -5443,7 +5448,7 @@ sub InterpLinksAux($)
#
#
if (!$virtlan->_sharednodes() ||
$virtlan->_sharednodes() != $virtlan->memberlist() ||
$virtlan->_sharednodes() ||
$virtlan->_needvlan()) {
my $lanid = "v" . "$lan" . $vlanid++;
......@@ -5613,7 +5618,7 @@ sub InterpLinksAux($)
my $protovlan;
if (!$virtlan->_sharednodes() ||
$virtlan->_sharednodes() != $virtlan->memberlist() ||
$virtlan->_sharednodes() ||
$virtlan->_needvlan()) {
if (exists($protovlans{$lan})) {
$protovlan = $protovlans{$lan};
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -181,7 +181,7 @@ elsif (defined($options{"e"})) {
die("*** $0:\n".
" You not have permission to reboot nodes in $experiment!\n");
}
my @nodelist = $experiment->NodeList();
my @nodelist = $experiment->NodeList(0, 1);
if (! @nodelist) {
die("*** $0:\n".
" There are no nodes reserved in $experiment\n");
......
......@@ -746,7 +746,7 @@ foreach $node (keys(%nodes)) {
my $uuid = $nodetouuid{$node};
my @types = ("$type:1");
my @features;
my @features = ();
my @flags;
my $needvirtgoo = 0;
......@@ -924,8 +924,10 @@ foreach $node (keys(%nodes)) {
}
if ($cpu_ram_features_present) {
# Add CPU and RAM information
push @features, "?+cpu:$cpu_speed";
push @features, "?+ram:$ram";
push @features, "?+cpu:$cpu_speed"
if (defined($cpu_speed));
push @features, "?+ram:$ram"
if (defined($ram));
push @features, "?+cpupercent:92"; # XXX Hack
push @features, "?+rampercent:80"; # XXX Hack
}
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2009 University of Utah and the Flux Group.
# Copyright (c) 2009-2010 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
require("Sajax.php");
include_once("node_defs.php");
#sajax_init();
#sajax_export("GetExpState", "Show", "ModifyAnno", "FreeNodeHtml");
#
# Only known and logged in users can look at experiments.
......@@ -17,8 +13,6 @@ $this_user = CheckLoginOrDie();
$uid = $this_user->uid();
$isadmin = ISADMIN();
PAGEHEADER("Shared Pool");
#
# Verify page arguments.
#
......@@ -28,6 +22,8 @@ if (!isset($sortby)) {
$sortby = "";
}
PAGEHEADER("Shared Pool");
$experiment = Experiment::LookupByPidEid("emulab-ops", "shared-nodes");
if (!$experiment) {
$experiment = Experiment::LookupByPidEid("emulab-ops", "shared-node");
......@@ -69,7 +65,9 @@ $query_result =
"where r.eid='$eid' and r.pid='$pid' ".
"order BY rsrvtime");
echo "These are the nodes in the shared pool. ";
$url = CreateURL("showexp", $experiment);
echo "These are the nodes in the <a href='$url'>shared pool</a>. ";
echo "Please see the <a href='$WIKIDOCURL/SharedNodes'>documentation</a> ";
echo "on how to use shared nodes in your experiment.<br>";
......
......@@ -4619,7 +4619,7 @@ class subboss:
# has permission to load the image in libosload so we don't need to
# check again in frisbeelauncher. Only a subboss can make this request
# anyway.
(exitval, output) = runcommand(TBDIR + "/sbin/subboss_wrapper frisbee_launcher " + argstr)
(exitval, output) = runcommand(TBDIR + "/sbin/subboss_wrapper frisbeelauncher " + argstr)
if exitval:
return EmulabResponse(RESPONSE_ERROR, exitval >> 8, output=output)
......
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