A ref change was pushed to the repository containing the project "Grayskull Repository". The branch, master has been updated via 6fa0ca9882e0715ff02ad41d983ee41517359f50 (commit) from c8f14d3064e343d526eb94b82b1c892e24e4846e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6fa0ca9882e0715ff02ad41d983ee41517359f50 Author: Justin Wozniak <[email protected]> Date: Fri Aug 21 15:25:41 2009 -0500 Checking in to run some tests on more processors. New plotters. New experiments. Improved placement framework. New sweep inputs and outputs for wiki reference. ----------------------------------------------------------------------- Summary of changes: sim/gobs/build.xml | 2 +- sim/gobs/{gobs.cfg => debug.cfg} | 10 +- sim/gobs/gobs/plot/AsciiPlot.java | 2 +- .../gobs/plot/{SimplePlot.java => LogPlot.java} | 21 ++- .../plot/{MultiplePlot.java => MultiLogXPlot.java} | 30 ++++- sim/gobs/gobs/plot/MultiplePlot.java | 4 + sim/gobs/gobs/sim/Addressable.java | 2 +- sim/gobs/gobs/sim/Kademlia.java | 39 ++---- sim/gobs/gobs/sim/Nearest.java | 59 ++++++++- sim/gobs/gobs/sim/Node.java | 7 +- sim/gobs/gobs/sim/PlacementScheme.java | 62 ++++++--- sim/gobs/gobs/sim/Simulator.java | 55 ++++++-- sim/gobs/gobs/sweep/Balance01.java | 2 +- sim/gobs/gobs/sweep/Balance02.java | 31 ++++- sim/gobs/gobs/sweep/Decluster01.java | 14 +-- sim/gobs/gobs/sweep/Decluster02.java | 35 +++-- .../sweep/{Decluster02.java => Decluster03.java} | 40 +++--- sim/gobs/gobs/sweep/Sweep.java | 115 ++++++++++++++++- sim/gobs/gobs/util/BoundedSortedValues.java | 144 ++++++++++++++++++++ .../gobs/{sim => util}/EnhancedLinkedHashSet.java | 15 +-- sim/gobs/gobs/util/Tools.java | 15 ++ sim/gobs/params.cfg | 21 ++-- sim/gobs/{params.cfg => sweeps/kp01.cfg} | 38 ++++-- sim/gobs/{params.cfg => sweeps/kp02.cfg} | 45 ++++-- sim/gobs/{params.cfg => sweeps/kp03.cfg} | 41 ++++-- sim/gobs/{params.cfg => sweeps/kp04.cfg} | 43 ++++-- sim/gobs/sweeps/nodes.cfg | 2 +- sim/gobs/wiki/dc03kp01.png | Bin 0 -> 16918 bytes sim/gobs/{params.cfg => wiki/kp01.cfg} | 38 ++++-- sim/gobs/wiki/kp01.png | Bin 0 -> 19030 bytes sim/gobs/wiki/kp02.png | Bin 0 -> 18170 bytes 31 files changed, 724 insertions(+), 208 deletions(-) copy sim/gobs/{gobs.cfg => debug.cfg} (67%) copy sim/gobs/gobs/plot/{SimplePlot.java => LogPlot.java} (84%) copy sim/gobs/gobs/plot/{MultiplePlot.java => MultiLogXPlot.java} (79%) copy sim/gobs/gobs/sweep/{Decluster02.java => Decluster03.java} (52%) create mode 100644 sim/gobs/gobs/util/BoundedSortedValues.java rename sim/gobs/gobs/{sim => util}/EnhancedLinkedHashSet.java (73%) copy sim/gobs/{params.cfg => sweeps/kp01.cfg} (56%) copy sim/gobs/{params.cfg => sweeps/kp02.cfg} (50%) copy sim/gobs/{params.cfg => sweeps/kp03.cfg} (54%) copy sim/gobs/{params.cfg => sweeps/kp04.cfg} (52%) create mode 100644 sim/gobs/wiki/dc03kp01.png copy sim/gobs/{params.cfg => wiki/kp01.cfg} (56%) create mode 100644 sim/gobs/wiki/kp01.png create mode 100644 sim/gobs/wiki/kp02.png Diff of changes: diff --git a/sim/gobs/build.xml b/sim/gobs/build.xml index e51e214..fd9c937 100644 --- a/sim/gobs/build.xml +++ b/sim/gobs/build.xml @@ -7,7 +7,7 @@ basedir="."> <property name="prereqs" - value=".:./prereqs/commons-io-1.4.jar:./prereqs/jfreechart-1.0.13.jar:./prereqs/xmlgraphics-commons-1.4svn.jar" /> + value=".:./prereqs/jcommon-1.0.16.jar:./prereqs/commons-io-1.4.jar:./prereqs/jfreechart-1.0.13.jar:./prereqs/xmlgraphics-commons-1.4svn.jar" /> <target name="all" depends="jar" /> diff --git a/sim/gobs/gobs.cfg b/sim/gobs/debug.cfg similarity index 67% copy from sim/gobs/gobs.cfg copy to sim/gobs/debug.cfg index a1a41f7..7600a77 100644 --- a/sim/gobs/gobs.cfg +++ b/sim/gobs/debug.cfg @@ -2,12 +2,12 @@ # Simulator configuration # Print nodes and objects at startup (true/false) -printInitialNodes = false +printInitialNodes = true # Print nodes and objects after each rebuild (true/false) -printNodes = false +printNodes = true # Print object tranfers during rebuilds (true/false) -printRebuilds = false +printRebuilds = true # Print file information (true/false) -printFiles = false +printFiles = true # Print load change statistics (true/false) -printLoadDiffs = false +printLoadDiffs = true diff --git a/sim/gobs/gobs/plot/AsciiPlot.java b/sim/gobs/gobs/plot/AsciiPlot.java index 073687b..d57b2ab 100644 --- a/sim/gobs/gobs/plot/AsciiPlot.java +++ b/sim/gobs/gobs/plot/AsciiPlot.java @@ -9,7 +9,7 @@ import org.jfree.data.xy.XYSeries; * Will be easy to tie in gnuplot. * */ -class AsciiPlot +public class AsciiPlot extends Plot { public static void plot(XYSeries series, diff --git a/sim/gobs/gobs/plot/SimplePlot.java b/sim/gobs/gobs/plot/LogPlot.java similarity index 84% copy from sim/gobs/gobs/plot/SimplePlot.java copy to sim/gobs/gobs/plot/LogPlot.java index e704bc9..68be179 100644 --- a/sim/gobs/gobs/plot/SimplePlot.java +++ b/sim/gobs/gobs/plot/LogPlot.java @@ -17,6 +17,7 @@ import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D; import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.*; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYDotRenderer; @@ -29,7 +30,7 @@ import org.jfree.data.xy.XYSeriesCollection; * Simple abstraction over JFreeChart with EPS output. * */ -public class SimplePlot +public class LogPlot { /** Generate simple plot. @@ -85,12 +86,22 @@ public class SimplePlot XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.WHITE); + XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); - renderer.setBaseOutlinePaint(Color.BLACK); - renderer.setBasePaint(Color.BLACK); - renderer.setBaseFillPaint(Color.BLACK); - plot.setRenderer(renderer); + renderer.setSeriesPaint(0,Color.BLACK); + //renderer.setSeriesLinesVisible(0,false); + plot.setRenderer(renderer); + + Font font; + LogarithmicAxis domainAxis = new LogarithmicAxis(xlabel); + ValueAxis rangeAxis = plot.getRangeAxis(); + font = rangeAxis.getLabelFont(); + domainAxis.setLabelFont(font); + font = plot.getRangeAxis().getTickLabelFont(); + font = font.deriveFont(36.0f); + domainAxis.setTickLabelFont(font); + plot.setDomainAxis(domainAxis); chart.draw(g2d, rectangle); diff --git a/sim/gobs/gobs/plot/MultiplePlot.java b/sim/gobs/gobs/plot/MultiLogXPlot.java similarity index 79% copy from sim/gobs/gobs/plot/MultiplePlot.java copy to sim/gobs/gobs/plot/MultiLogXPlot.java index a1600ea..90f6e06 100644 --- a/sim/gobs/gobs/plot/MultiplePlot.java +++ b/sim/gobs/gobs/plot/MultiLogXPlot.java @@ -1,7 +1,7 @@ package gobs.plot; -import java.awt.Color; +import java.awt.*; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; @@ -17,9 +17,11 @@ import org.apache.xmlgraphics.java2d.ps.EPSDocumentGraphics2D; import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.*; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYDotRenderer; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; @@ -30,7 +32,7 @@ import gobs.util.Bits; * Simple abstraction over JFreeChart with EPS output. * */ -public class MultiplePlot +public class MultiLogXPlot { /** Generate simple plot. @@ -65,9 +67,6 @@ public class MultiplePlot g2d.setGraphicContext (new org.apache.xmlgraphics.java2d.GraphicContext()); g2d.setupDocument(out, w, h); - - //Paint a bounding box - // g2d.drawRect(20, 20, 40, 40); } catch (IOException e) { @@ -84,8 +83,27 @@ public class MultiplePlot XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.WHITE); + + // Turn on shapes... + XYLineAndShapeRenderer renderer = + new XYLineAndShapeRenderer(); + plot.setRenderer(renderer); + + // Cache default fonts... + ValueAxis rangeAxis = plot.getRangeAxis(); + Font labelFont = rangeAxis.getLabelFont(); + Font tickFont = rangeAxis.getTickLabelFont(); + + // Correct fonts... + LogarithmicAxis domainAxis = new LogarithmicAxis(xlabel); + domainAxis.setLabelFont(labelFont); + domainAxis.setTickLabelFont(tickFont); + plot.setDomainAxis(domainAxis); + chart.draw(g2d, rectangle); + System.out.println("plotted"); + try { g2d.finish(); @@ -112,7 +130,7 @@ public class MultiplePlot for (int j = 0; j < 3; j++) { XYSeries series = new XYSeries("data: " + count++); - for (int i = 0; i < 9; i++) + for (int i = 1; i < 9; i++) { series.add(i, j*3+Bits.nextInt(3)); } diff --git a/sim/gobs/gobs/plot/MultiplePlot.java b/sim/gobs/gobs/plot/MultiplePlot.java index a1600ea..9d3ffa9 100644 --- a/sim/gobs/gobs/plot/MultiplePlot.java +++ b/sim/gobs/gobs/plot/MultiplePlot.java @@ -20,6 +20,7 @@ import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYDotRenderer; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; @@ -82,8 +83,11 @@ public class MultiplePlot (title, xlabel, ylabel, collection, PlotOrientation.VERTICAL, withLegend, false, false); + XYLineAndShapeRenderer renderer = + new XYLineAndShapeRenderer(); XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.WHITE); + plot.setRenderer(renderer); chart.draw(g2d, rectangle); try diff --git a/sim/gobs/gobs/sim/Addressable.java b/sim/gobs/gobs/sim/Addressable.java index 4d20785..500fd18 100644 --- a/sim/gobs/gobs/sim/Addressable.java +++ b/sim/gobs/gobs/sim/Addressable.java @@ -9,7 +9,7 @@ import java.math.BigInteger; class Addressable { - int B; + int B; BigInteger id; // Cached result of bitArray(): diff --git a/sim/gobs/gobs/sim/Kademlia.java b/sim/gobs/gobs/sim/Kademlia.java index 45292aa..33730d6 100644 --- a/sim/gobs/gobs/sim/Kademlia.java +++ b/sim/gobs/gobs/sim/Kademlia.java @@ -10,7 +10,7 @@ import gobs.util.Tools; * Places objects on the nearest node using the XOR distance metric. * */ -class Kademlia +public class Kademlia extends PlacementScheme { Kademlia(int B) @@ -18,26 +18,6 @@ class Kademlia super(B); } - public void place(Collection<Obj> objects, List<Node> nodes) - { - System.out.println("placing: " + objects.size()); - for (Obj object : objects) - placeObject(object, nodes); - } - - /** - Allocate replicas for object and place all on nodes. - */ - void placeObject(Obj object, List<Node> nodes) - { - List<Node> closest = closestNodes(object, nodes); - Primary primary = object.toPrimary(); - closest.remove(0).add(primary); - for (Node node : closest) - { - node.add(object.toSecondary(primary)); - } - } /** Place this object to rebuild. @@ -76,7 +56,7 @@ class Kademlia destination.bitString()); } */ - + /* List<Node> closestNodes(Obj object, List<Node> nodes) { List<Node> closest = new ArrayList<Node>(object.replicas*2); @@ -87,7 +67,9 @@ class Kademlia Node closestNode = null; for (Node node : nodes) { - BigInteger d = node.id.xor(object.id); + BigInteger d = node.id.xor(object.id); + if (d.compareTo(BigInteger.ZERO) < 0) + System.out.println("NEGATIVE!"); if ((closestDiff == null || closestDiff.compareTo(d) > 0) && ! closest.contains(node)) @@ -100,7 +82,14 @@ class Kademlia } return closest; } - + */ + + public BigInteger distance(Addressable address1, + Addressable address2) + { + return address1.id.xor(address2.id); + } + /** XOR calculator. */ @@ -112,6 +101,6 @@ class Kademlia BigInteger i1 = new BigInteger(args[0], 2); BigInteger i2 = new BigInteger(args[1], 2); - System.out.println(i2.subtract(i1).abs()); + System.out.println(i2.xor(i1)); } } diff --git a/sim/gobs/gobs/sim/Nearest.java b/sim/gobs/gobs/sim/Nearest.java index a388575..5a7d4ad 100644 --- a/sim/gobs/gobs/sim/Nearest.java +++ b/sim/gobs/gobs/sim/Nearest.java @@ -4,18 +4,21 @@ package gobs.sim; import java.math.BigInteger; import java.util.*; +import gobs.util.Tools; + /** * Places objects on the nearest node using the XOR distance metric. * */ -class Nearest +public class Nearest extends PlacementScheme { Nearest(int B) { super(B); } - + + /* public void place(Collection<Obj> objects, List<Node> nodes) { System.out.println("placing: " + objects.size()); @@ -25,7 +28,7 @@ class Nearest /** Allocate replicas for object and place all on nodes. - */ + * void placeObject(Obj object, List<Node> nodes) { List<Node> closest = closestNodes(object, nodes); @@ -36,7 +39,37 @@ class Nearest node.add(object.toSecondary(primary)); } } + */ + + public BigInteger distance(Addressable address1, + Addressable address2) + { + return difference(Simulator.current.M, address1.id, address2.id); + } + + public BigInteger difference(BigInteger M, + BigInteger i1, BigInteger i2) + { + BigInteger a,b; + + if (i1.compareTo(i2) < 0) + { + a = i1; + b = i2; + } + else + { + a = i2; + b = i1; + } + + BigInteger d1 = b.subtract(a); + BigInteger d2 = M.subtract(b).add(a); + + return (d2.compareTo(d1) < 0) ? d2 : d1; + } + /* List<Node> closestNodes(Obj object, List<Node> nodes) { List<Node> closest = new ArrayList<Node>(object.replicas*2); @@ -66,4 +99,24 @@ class Nearest return closest; } + */ + + /** + Wrap-around calculator. + */ + public static void main(String[] args) + { + if (args.length < 2) + Tools.bail("Need 2 binary numbers!"); + + int B = 10; + BigInteger M = new BigInteger("10"); + + Nearest nearest = new Nearest(B); + + BigInteger i1 = new BigInteger(args[0]); + BigInteger i2 = new BigInteger(args[1]); + + System.out.println(nearest.difference(M,i1,i2)); + } } diff --git a/sim/gobs/gobs/sim/Node.java b/sim/gobs/gobs/sim/Node.java index 3264b5f..05f0224 100644 --- a/sim/gobs/gobs/sim/Node.java +++ b/sim/gobs/gobs/sim/Node.java @@ -88,7 +88,7 @@ public class Node return bitString() + " " + objects.size(); } - public String toString() + public String display() { StringBuffer result = new StringBuffer(objects.size()*10); result.append(name()); @@ -100,4 +100,9 @@ public class Node result.append("\n"); return result.toString(); } + + public String toString() + { + return name(); + } } diff --git a/sim/gobs/gobs/sim/PlacementScheme.java b/sim/gobs/gobs/sim/PlacementScheme.java index bd5fb2a..9ffa9b1 100644 --- a/sim/gobs/gobs/sim/PlacementScheme.java +++ b/sim/gobs/gobs/sim/PlacementScheme.java @@ -10,7 +10,7 @@ import gobs.util.*; * Interface to place a list of objects on a set of nodes. * */ -abstract class PlacementScheme +public abstract class PlacementScheme { int B; BigInteger M; @@ -30,16 +30,7 @@ abstract class PlacementScheme { ArrayList<Obj> result = new ArrayList<Obj>(file.width+2); - // BigInteger two = new BigInteger("2"); BigInteger bigWidth = new BigInteger("" + file.width); - /* - BigInteger bigWidth2 = new BigInteger.ONE; - while (bigWidth2.compareTo(bigWidth) <= 0) - { - bigWidth2 = bigWidth2.multiply(two); - } - */ - BigInteger s = M.divide(bigWidth); BigInteger p = randomID(); @@ -61,36 +52,71 @@ abstract class PlacementScheme result.trimToSize(); return result; } - + + public void place(Collection<Obj> objects, List<Node> nodes) + { + // System.out.println("place objects: " + objects.size()); + for (Obj object : objects) + placeObject(object, nodes); + } + /** - Place a set of objects. + Allocate replicas for object and place all on nodes. */ - abstract void place(Collection<Obj> objects, List<Node> nodes); - + void placeObject(Obj object, List<Node> nodes) + { + // System.out.println("place: " + object); + List<Node> closest = closestNodes(object, nodes); + Primary primary = object.toPrimary(); + closest.remove(closest.size()-1).add(primary); + for (Node node : closest) + { + node.add(object.toSecondary(primary)); + } + } + /** Obtain a list of nodes closest to the given object with respect to the distance metric used here. */ - abstract List<Node> closestNodes(Obj object, List<Node> nodes); + List<Node> closestNodes(Obj object, List<Node> nodes) + { + BoundedSortedValues<Node,BigInteger> closest = + new BoundedSortedValues<Node,BigInteger>(object.replicas); + + for (Node node : nodes) + { + BigInteger d = distance(object, node); + closest.add(node, d); + } + + // System.out.println(closest); + + return closest.get(); + } + + public abstract BigInteger distance(Addressable address1, + Addressable address2); /** Place this object to rebuild. */ void rebuild(Obj object, List<Node> nodes) { + // System.out.println("rebuild: " + object); List<Node> closest = closestNodes(object, nodes); Secondary secondary; Node source = null, destination = null; if (object instanceof Primary) { Primary primary = object.toPrimary(); - source = closest.remove(0); + source = closest.remove(closest.size()-1); secondary = (Secondary) source.remove(primary.id); source.add(primary); } else { - source = closest.remove(0); + source = closest.remove(closest.size()-1); Primary primary = (Primary) source.get(object.id); secondary = primary.toSecondary(primary); } @@ -113,7 +139,7 @@ abstract class PlacementScheme destination.add(secondary); source.pushes++; - source.pulls++; + destination.pulls++; if (Tools.string(Simulator.current.properties, "printRebuilds") .equals("true")) diff --git a/sim/gobs/gobs/sim/Simulator.java b/sim/gobs/gobs/sim/Simulator.java index 2116710..5eb94fd 100644 --- a/sim/gobs/gobs/sim/Simulator.java +++ b/sim/gobs/gobs/sim/Simulator.java @@ -1,8 +1,8 @@ package gobs.sim; -import java.math.BigInteger; -import java.text.DecimalFormat; +import java.math.BigInteger; +import java.text.DecimalFormat; import java.util.*; import gobs.util.*; @@ -19,10 +19,12 @@ public class Simulator int B; int N; + public BigInteger M; + int fileCount; int faults; - PlacementScheme placer; + public PlacementScheme placer; NodeScheme hub; FileFactory factory; @@ -75,14 +77,14 @@ public class Simulator { System.out.println("NODES:"); for (Node node : nodes) - System.out.println(node.bitString()); + System.out.println(node.name()); } void printNodeObjects(List<Node> nodes) { System.out.println("NODE_CONTENTS:"); for (Node node : nodes) - System.out.println(node); + System.out.println(node.display()); } void printFiles() @@ -100,7 +102,7 @@ public class Simulator for (Node node : sorted.keySet()) { Integer d = sorted.get(node); - System.out.println(node.bitString() + ": " + d); + System.out.println(node.name() + ": " + d); } } @@ -216,6 +218,8 @@ public class Simulator } else bail("Bad PlacementScheme name: " + placerName); + + M = placer.M; String nodesName = Tools.string(properties, "NodeScheme"); if (nodesName.equals("RandomNodes")) @@ -235,6 +239,9 @@ public class Simulator // Initialize node addresses... hub.generate(N, nodes); stats.nodes = N; + + if (Tools.bool(properties, "printInitialNodes")) + printNodes(nodes); // Initialize object addresses... for (int i = 0; i < fileCount; i++) @@ -270,6 +277,8 @@ public class Simulator if (Tools.string(properties, "printInitialNodes").equals("true")) printNodeObjects(nodes); + System.out.println("faults: " + faults); + for (int fault = 0; fault < faults; fault++) { // Cause a fault and reallocate objects... @@ -317,25 +326,43 @@ public class Simulator System.out.println("PULL_DECLUSTERING: "); int affected = 0; Node last = null; - double percent = 0.0; + double percentPulls = 0.0; for (Node node : sorted.keySet()) { int d = sorted.get(node); if (d > 0) { - percent = (100.0*d)/total; + percentPulls = (100.0*d)/total; System.out.println(node.name() + ": " + - df.format(percent) + "%"); + df.format(percentPulls) + "%"); affected++; last = node; } } + + // Display data reallocation declustering... + System.out.println("TOTAL_DECLUSTERING: "); + double percentTotal = 0.0; + double maxPercentTotal = 0.0; + for (Node node : nodes) + { + int d = node.pushes+node.pulls; + if (d > 0) + { + percentTotal = (100.0*d)/(total*2); + System.out.println(node.name() + ": " + + df.format(percentTotal) + "%"); + if (percentTotal > maxPercentTotal) + { + maxPercentTotal = percentTotal; + } + } + } + + stats.results.setProperty("maxPulls", df.format(percentPulls)); + stats.results.setProperty("affected", df.format(affected)); + stats.results.setProperty("maxTotal", df.format(maxPercentTotal)); - stats.results.setProperty("maxDeclustering", - new Double(percent).toString()); - stats.results.setProperty("affected", - new Double(affected).toString()); - System.out.println("SERVERS_AFFECTED: " + affected); } } diff --git a/sim/gobs/gobs/sweep/Balance01.java b/sim/gobs/gobs/sweep/Balance01.java index 148a7de..1ca098d 100644 --- a/sim/gobs/gobs/sweep/Balance01.java +++ b/sim/gobs/gobs/sweep/Balance01.java @@ -10,7 +10,7 @@ import gobs.util.*; import gobs.plot.SimplePlot; /** - * Reports object load on each server. + * Reports object load on each server. Sorted. * * Usage: Balance01 gobs.cfg params.cfg * */ diff --git a/sim/gobs/gobs/sweep/Balance02.java b/sim/gobs/gobs/sweep/Balance02.java index 6deceaa..3bde37b 100644 --- a/sim/gobs/gobs/sweep/Balance02.java +++ b/sim/gobs/gobs/sweep/Balance02.java @@ -1,6 +1,7 @@ package gobs.sweep; +import java.math.BigInteger; import java.util.*; import org.jfree.data.xy.XYSeries; @@ -10,9 +11,9 @@ import gobs.util.*; import gobs.plot.SimplePlot; /** - * Reports object load on each server. + * Reports object load on each server. Unsorted. * - * Usage: Decluster01 -n <repeats> gobs.cfg params.cfg + * Usage: Balance02 -n <repeats> gobs.cfg params.cfg * */ class Balance02 @@ -30,10 +31,32 @@ class Balance02 XYSeries series = new XYSeries("Balance"); - int i = 0; - for (Node node: simulator.nodes) + int i = 0; + for (Node node : simulator.nodes) { series.add(i++, node.objects.size()); + + Node closestNode = null; + BigInteger closestDistance = simulator.M; + for (Node neighbor : simulator.nodes) + { + if (neighbor != node) + { + BigInteger distance = + simulator.placer.distance(node,neighbor); + if (distance.compareTo(closestDistance) < 0) + { + closestNode = neighbor; + closestDistance = distance; + } + } + } + + System.out.println + ("i: " + i + + " node: " + node + + " load: " + node.objects.size() + + "\n\t distance: " + closestDistance); } SimplePlot.plot(series, "Load Distribution", "nodes", "load", diff --git a/sim/gobs/gobs/sweep/Decluster01.java b/sim/gobs/gobs/sweep/Decluster01.java index f67cd06..99dcd11 100644 --- a/sim/gobs/gobs/sweep/Decluster01.java +++ b/sim/gobs/gobs/sweep/Decluster01.java @@ -3,8 +3,8 @@ package gobs.sweep; import java.util.*; -import gobs.util.Tools; import gobs.plot.SimplePlot; +import gobs.util.*; /** * Modifies node count. Reports object movement load on the @@ -14,22 +14,18 @@ import gobs.plot.SimplePlot; * */ class Decluster01 - extends Sweep { - Decluster01(String[] args) - { - super(args); - } - public static void main(String[] args) { - Decluster01 sweep = new Decluster01(args); + Bits.init(); + + Sweep sweep = new Sweep(args); int minNodes = Tools.integer(sweep.properties, "minNodes"); int maxNodes = Tools.integer(sweep.properties, "maxNodes"); List<String> values = Sweep.tens(minNodes, maxNodes); - sweep.execute("Declustering", "nodes", values, "maxDeclustering"); + sweep.execute("Declustering", "nodes", values, "maxPulls"); SimplePlot.plot(sweep.series, "Maximum Rebuild Load", "nodes", "load", "Decluster01.eps"); diff --git a/sim/gobs/gobs/sweep/Decluster02.java b/sim/gobs/gobs/sweep/Decluster02.java index f5fb374..0d26013 100644 --- a/sim/gobs/gobs/sweep/Decluster02.java +++ b/sim/gobs/gobs/sweep/Decluster02.java @@ -8,13 +8,13 @@ import org.jfree.data.xy.XYSeriesCollection; // import gobs.sim.*; import gobs.util.*; -import gobs.plot.MultiplePlot; +import gobs.plot.*; /** * Modifies node count. Reports object movement load on the * heaviest server during rebuild. * - * Usage: Decluster01 -n <repeats> gobs.cfg params.cfg Decluster01.cfg + * Usage: Decluster02 -n <repeats> *.cfg * */ class Decluster02 @@ -29,30 +29,35 @@ class Decluster02 int minNodes = Tools.integer(properties, "minNodes"); int maxNodes = Tools.integer(properties, "maxNodes"); + + List<String> values = null; + String step = Tools.string(properties, "step"); + if (step.equals("tens")) + values = Sweep.tens(minNodes, maxNodes); + else if (step.equals("mids")) + values = Sweep.exps(minNodes, maxNodes); final XYSeriesCollection collection = new XYSeriesCollection(); - List<String> values = null; - Sweep nearestSweep = new Sweep(); properties.setProperty("PlacementScheme", "Nearest"); + nearestSweep.initialize(properties); nearestSweep.repeats = Tools.integer(properties, "repeats"); - values = Sweep.tens(minNodes, maxNodes); - nearestSweep.properties = properties; - nearestSweep.execute("PAST", "nodes", values, "maxDeclustering"); + nearestSweep.execute("PAST", "nodes", values, "maxPulls"); + collection.addSeries(nearestSweep.series); Sweep kademliaSweep = new Sweep(); properties.setProperty("PlacementScheme", "Kademlia"); + kademliaSweep.initialize(properties); kademliaSweep.repeats = Tools.integer(properties, "repeats"); - values = Sweep.tens(minNodes, maxNodes); - kademliaSweep.properties = properties; kademliaSweep.execute("Kademlia", "nodes", values, - "maxDeclustering"); - - collection.addSeries(nearestSweep.series); + "maxPulls"); collection.addSeries(kademliaSweep.series); - - MultiplePlot.plot(collection, "Maximum Rebuild Load", - "nodes", "load", "Decluster01.eps"); + + String output = Tools.string(properties, "output"); + MultiLogXPlot.plot(collection, "Maximum Rebuild Load", + "nodes", "load fraction (%)", output); + // AsciiPlot.plot(nearestSweep.series, "Maximum Rebuild Load", + // "nodes", "load", "tmp.txt"); } } diff --git a/sim/gobs/gobs/sweep/Decluster02.java b/sim/gobs/gobs/sweep/Decluster03.java similarity index 52% copy from sim/gobs/gobs/sweep/Decluster02.java copy to sim/gobs/gobs/sweep/Decluster03.java index f5fb374..4e5296b 100644 --- a/sim/gobs/gobs/sweep/Decluster02.java +++ b/sim/gobs/gobs/sweep/Decluster03.java @@ -8,16 +8,17 @@ import org.jfree.data.xy.XYSeriesCollection; // import gobs.sim.*; import gobs.util.*; -import gobs.plot.MultiplePlot; +import gobs.plot.*; /** - * Modifies node count. Reports object movement load on the - * heaviest server during rebuild. + * Modifies node count. + * Reports object movement load (pushes+pulls) on the + * busiest server during rebuild. * - * Usage: Decluster01 -n <repeats> gobs.cfg params.cfg Decluster01.cfg + * Usage: Decluster03 -n <repeats> gobs.cfg params.cfg Decluster01.cfg * */ -class Decluster02 +class Decluster03 { static Properties properties; @@ -29,30 +30,29 @@ class Decluster02 int minNodes = Tools.integer(properties, "minNodes"); int maxNodes = Tools.integer(properties, "maxNodes"); + String step = Tools.string(properties, "step"); + List<String> values = Sweep.values(step, minNodes, maxNodes); final XYSeriesCollection collection = new XYSeriesCollection(); - List<String> values = null; - - Sweep nearestSweep = new Sweep(); properties.setProperty("PlacementScheme", "Nearest"); + Sweep nearestSweep = new Sweep(properties); nearestSweep.repeats = Tools.integer(properties, "repeats"); - values = Sweep.tens(minNodes, maxNodes); - nearestSweep.properties = properties; - nearestSweep.execute("PAST", "nodes", values, "maxDeclustering"); + nearestSweep.execute("PAST", "nodes", values, "maxTotal"); + collection.addSeries(nearestSweep.series); - Sweep kademliaSweep = new Sweep(); + Sweep kademliaSweep = new Sweep(properties + ); properties.setProperty("PlacementScheme", "Kademlia"); kademliaSweep.repeats = Tools.integer(properties, "repeats"); - values = Sweep.tens(minNodes, maxNodes); - kademliaSweep.properties = properties; kademliaSweep.execute("Kademlia", "nodes", values, - "maxDeclustering"); - - collection.addSeries(nearestSweep.series); + "maxTotal"); collection.addSeries(kademliaSweep.series); - - MultiplePlot.plot(collection, "Maximum Rebuild Load", - "nodes", "load", "Decluster01.eps"); + + String output = Tools.string(properties, "output"); + MultiLogXPlot.plot(collection, "Maximum Rebuild Load", + "nodes", "load", output); + // AsciiPlot.plot(nearestSweep.series, "Maximum Rebuild Load", + // "nodes", "load", "tmp.txt"); } } diff --git a/sim/gobs/gobs/sweep/Sweep.java b/sim/gobs/gobs/sweep/Sweep.java index 1b200f8..686a2d9 100644 --- a/sim/gobs/gobs/sweep/Sweep.java +++ b/sim/gobs/gobs/sweep/Sweep.java @@ -28,6 +28,11 @@ class Sweep Sweep() {} + Sweep(Properties properties) + { + this.properties = properties; + } + Sweep(String[] args) { properties = getopts(args); @@ -55,6 +60,10 @@ class Sweep { result.setProperty("repeats", args[++i]); } + else if (args[i].equals("-o")) + { + result.setProperty("output", args[++i]); + } else if (args[i].equals("-p")) { path(args[++i]); @@ -78,6 +87,21 @@ class Sweep p = p+"/"; path = p; } + + static List<String> values(String type, int min, int max) + { + if (type.equals("all")) + return all(min,max); + else if (type.equals("tens")) + return tens(min,max); + else if (type.equals("exps")) + return exps(min,max); + else if (type.equals("mids")) + return mids(min,max); + else + Tools.bail("Sweep.values(): Bad values type: " + type); + return null; + } /** Sweep over all integer values between min and max. @@ -101,11 +125,67 @@ class Sweep for (int i = min+1; i < max; i++) if (i % 10 == 0) result.add(new Integer(i).toString()); + if (min != max) + result.add(new Integer(max).toString()); + return result; + } + + /** + Sweep over all integer values between min and max that + are the product of min and 2^i for some i. + */ + static List<String> exps(int min, int max) + { + List<String> result = new ArrayList<String>(); + + int p = 1; + int v = min; + + while (v*p < max) + { + result.add(new Integer(v*p).toString()); + p *= 2; + } result.add(new Integer(max).toString()); + return result; } /** + Sweep over all integer values between min and max that + are the product of min and 2^i for some i, and the values + between those. + */ + static List<String> mids(int min, int max) + { + List<String> result = new ArrayList<String>(); + + int v = min; + int p = 1; + int previous = -1; + + int vp = 0; + while ((vp = v*p) < max) + { + if (previous > 0) + { + int m = (vp+previous) / 2; + if (m != vp) + result.add(new Integer(m).toString()); + } + result.add(new Integer(vp).toString()); + previous = vp; + p *= 2; + } + int m = (max+previous) / 2; + if (m != previous) + result.add(new Integer(m).toString()); + result.add(new Integer(max).toString()); + + return result; + } + + /** Load a properties file. */ static void load(Properties properties, String file) @@ -121,11 +201,27 @@ class Sweep } catch (java.io.IOException e) { - Tools.bail("Could not open properties file!"); + Tools.bail("Could not open properties file: " + file); } } /** + Set properties from memory. + */ + void initialize(Properties properties) + { + this.properties = properties; + } + + /** + Set properties from command-line. + */ + void initialize(String[] args) + { + this.properties = getopts(args); + } + + /** Execute the parameter sweep. For each value in values, substitute it for xname in the properties object. Run the simulation and extract the @@ -134,6 +230,8 @@ class Sweep void execute(String description, String xname, List<String> values, String yname) { + repeats = Tools.integer(properties, "repeats"); + if (repeats <= 0) System.out.println("WARNING: repeats=" + repeats); @@ -150,8 +248,10 @@ class Sweep simulator.initialize(properties); simulator.execute(); stats.add(simulator.stats); + System.out.println("result: " + result(simulator, yname)); total += result(simulator, yname); } + System.out.println("avg: " + total/repeats); series.add(Double.parseDouble(v), total/repeats); } } @@ -165,4 +265,17 @@ class Sweep Double.parseDouble ((String) simulator.stats.results.get(name)); } + + /** + Debugging only. + */ + public static void main(String[] args) + { + int i1 = Integer.parseInt(args[0]); + int i2 = Integer.parseInt(args[1]); + + List<String> list = mids(i1,i2); + + System.out.println(list); + } } diff --git a/sim/gobs/gobs/util/BoundedSortedValues.java b/sim/gobs/gobs/util/BoundedSortedValues.java new file mode 100644 index 0000000..834c531 --- /dev/null +++ b/sim/gobs/gobs/util/BoundedSortedValues.java @@ -0,0 +1,144 @@ + +package gobs.util; + +import java.util.*; + +public class BoundedSortedValues<T,V extends Comparable<V>> +{ + List<Entry> list = new LinkedList<Entry>(); + + Entry bottom = null; + int bound = 0; + + Mode mode = Mode.SMALLEST; + + public class Entry + implements Map.Entry<T,V> + { + T thing; + V value; + + Entry(T thing, V value) + { + this.thing = thing; + this.value = value; + } + + public boolean equals(Object o) + { + return thing.equals(o); + } + + public T getKey() + { + return thing; + } + + public V getValue() + { + return value; + } + + public int hashCode() + { + return thing.hashCode() + value.hashCode(); + } + + public V setValue(V value) + { + this.value = value; // .intValue(); + return value; + } + } + + enum Mode + { + SMALLEST, LARGEST + } + + public BoundedSortedValues(int bound) + { + this.bound = bound; + if (bound < 0) + throw new IndexOutOfBoundsException + ("Bound must be non-negative!"); + } + + public boolean add(T thing, V value) + { + if (bound == 0) + return false; + + if (mode == Mode.SMALLEST) + { + if (bottom == null || + value.compareTo(bottom.value) < 0 || + list.size() < bound) + { + int i = 0; + for (Iterator<Entry> it = list.iterator(); it.hasNext(); ) + { + Entry pair = it.next(); + if (value.compareTo(pair.value) < 0) + i++; + else + break; + } + list.add(i, new Entry(thing, value)); + if (list.size() > bound) + list.remove(0); + bottom = list.get(0); + return true; + } + } + return false; + } + + public Map.Entry<T,V> get(int index) + { + return list.get(index); + } + + public int size() + { + return list.size(); + } + + public List<T> get() + { + List<T> result = new ArrayList<T>(list.size()); + for (Entry pair : list) + result.add(pair.thing); + return result; + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + + sb.append("["); + for (Iterator<Entry> it = list.iterator(); it.hasNext(); ) + { + Entry pair = it.next(); + sb.append("("); + sb.append(pair.thing); + sb.append(","); + sb.append(pair.value); + sb.append(")"); + if (it.hasNext()) + sb.append(","); + } + sb.append("]"); + + return sb.toString(); + } + + public static void main(String[] args) + { + BoundedSortedValues<String,Integer> v = + new BoundedSortedValues<String,Integer>(3); + for (String arg : args) + v.add(arg, arg.length()); + System.out.println(v.toString()); + } +} diff --git a/sim/gobs/gobs/sim/EnhancedLinkedHashSet.java b/sim/gobs/gobs/util/EnhancedLinkedHashSet.java similarity index 73% rename from sim/gobs/gobs/sim/EnhancedLinkedHashSet.java rename to sim/gobs/gobs/util/EnhancedLinkedHashSet.java index fb400dd..ac78648 100644 --- a/sim/gobs/gobs/sim/EnhancedLinkedHashSet.java +++ b/sim/gobs/gobs/util/EnhancedLinkedHashSet.java @@ -1,10 +1,10 @@ -package gobs.sim; +package gobs.util; import java.math.BigInteger; import java.util.*; -class EnhancedLinkedHashSet<T> +public class EnhancedLinkedHashSet<T> extends LinkedHashSet<T> { private static final long serialVersionUID = 1; @@ -14,7 +14,7 @@ class EnhancedLinkedHashSet<T> super(); } - boolean containsAny(Collection<T> c) + public boolean containsAny(Collection<T> c) { for (T thing : c) { @@ -27,20 +27,15 @@ class EnhancedLinkedHashSet<T> /** Debugging only. */ + /* public static void main(String[] args) { EnhancedLinkedHashSet<Object> set = new EnhancedLinkedHashSet<Object>(); - /* - String hello = "Hello"; - set.add(hello); - if (set.contains("Hello")) - System.out.println("true"); - */ - Obj obj = new Obj(4, new BigInteger("3"), 0, 0); set.add(obj); if (set.contains(new Obj(5, new BigInteger("3"), 1, 1))) System.out.println("true"); } + */ } diff --git a/sim/gobs/gobs/util/Tools.java b/sim/gobs/gobs/util/Tools.java index 52950f5..264b0fa 100644 --- a/sim/gobs/gobs/util/Tools.java +++ b/sim/gobs/gobs/util/Tools.java @@ -29,6 +29,21 @@ public class Tools return result; } + public static boolean bool(Properties properties, + String variable) + { + boolean result = false; + String value = string(properties, variable); + if (value.equalsIgnoreCase("true")) + result = true; + else if (value.equalsIgnoreCase("false")) + result = false; + else + bail("Could not read boolean from property: " + variable + + " = " + properties.getProperty(variable)); + return result; + } + public static String string(Properties properties, String variable) { String result = null; diff --git a/sim/gobs/params.cfg b/sim/gobs/params.cfg index 9b089f0..fccbf19 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/params.cfg @@ -1,22 +1,23 @@ ### Parameters for GOBS Simulator run -## General parameters... +### General parameters: + # Bit-length of addresses: -B = 16 +B = 7 # Number of servers: nodes = 32 # Number of files: -files = 10000 +files = 6 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +### Choose a PlacementScheme implementation: -# PlacementScheme = Kademlia -PlacementScheme = Nearest +PlacementScheme = Kademlia +# PlacementScheme = Nearest -### Choose a NodeScheme implementation +### Choose a NodeScheme implementation: # NodeScheme = RandomNodes NodeScheme = SimpleNodes @@ -26,13 +27,13 @@ NodeScheme = SimpleNodes # FileFactory implementation PlainFiles FileFactory = PlainFiles # File size: -filesize = 14 +filesize = 140 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles diff --git a/sim/gobs/params.cfg b/sim/gobs/sweeps/kp01.cfg similarity index 56% copy from sim/gobs/params.cfg copy to sim/gobs/sweeps/kp01.cfg index 9b089f0..599984f 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/sweeps/kp01.cfg @@ -1,22 +1,27 @@ -### Parameters for GOBS Simulator run +### Kademlia vs. PAST 01 + +step = exps + +### General parameters: -## General parameters... # Bit-length of addresses: -B = 16 -# Number of servers: -nodes = 32 +B = 32 # Number of files: -files = 10000 +files = 3000 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +# Number of servers: +minNodes = 10 +maxNodes = 1000 + +### Choose a PlacementScheme implementation: # PlacementScheme = Kademlia PlacementScheme = Nearest -### Choose a NodeScheme implementation +### Choose a NodeScheme implementation: # NodeScheme = RandomNodes NodeScheme = SimpleNodes @@ -30,9 +35,9 @@ filesize = 14 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles @@ -51,3 +56,16 @@ filewidth = 1 #filesmallmax = 20 # Min size of small files: #filesmallmin = 0 + +### Simulator output configuration + +# Print nodes and objects at startup (true/false) +printInitialNodes = false +# Print nodes and objects after each rebuild (true/false) +printNodes = false +# Print object tranfers during rebuilds (true/false) +printRebuilds = false +# Print file information (true/false) +printFiles = false +# Print load change statistics (true/false) +printLoadDiffs = false diff --git a/sim/gobs/params.cfg b/sim/gobs/sweeps/kp02.cfg similarity index 50% copy from sim/gobs/params.cfg copy to sim/gobs/sweeps/kp02.cfg index 9b089f0..a972556 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/sweeps/kp02.cfg @@ -1,25 +1,29 @@ -### Parameters for GOBS Simulator run +### Kademlia vs. PAST 02 + +step = exps + +### General parameters: -## General parameters... # Bit-length of addresses: -B = 16 -# Number of servers: -nodes = 32 +B = 32 # Number of files: -files = 10000 +files = 3000 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +# Number of servers: +minNodes = 10 +maxNodes = 1000 -# PlacementScheme = Kademlia -PlacementScheme = Nearest +### Choose a PlacementScheme implementation: -### Choose a NodeScheme implementation +# Chosen by sweep driver. -# NodeScheme = RandomNodes -NodeScheme = SimpleNodes +### Choose a NodeScheme implementation: + +NodeScheme = RandomNodes +# NodeScheme = SimpleNodes ### Choose one of the following FileFactory sections: @@ -30,9 +34,9 @@ filesize = 14 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles @@ -51,3 +55,16 @@ filewidth = 1 #filesmallmax = 20 # Min size of small files: #filesmallmin = 0 + +### Simulator output configuration + +# Print nodes and objects at startup (true/false) +printInitialNodes = false +# Print nodes and objects after each rebuild (true/false) +printNodes = false +# Print object tranfers during rebuilds (true/false) +printRebuilds = false +# Print file information (true/false) +printFiles = false +# Print load change statistics (true/false) +printLoadDiffs = false diff --git a/sim/gobs/params.cfg b/sim/gobs/sweeps/kp03.cfg similarity index 54% copy from sim/gobs/params.cfg copy to sim/gobs/sweeps/kp03.cfg index 9b089f0..25890dc 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/sweeps/kp03.cfg @@ -1,24 +1,30 @@ -### Parameters for GOBS Simulator run +### Kademlia vs. PAST 03 + +output = kp03.eps +step = mids + +### General parameters: -## General parameters... # Bit-length of addresses: -B = 16 -# Number of servers: -nodes = 32 +B = 32 # Number of files: -files = 10000 +files = 3000 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +# Number of servers: +minNodes = 10 +maxNodes = 1000 + +### Choose a PlacementScheme implementation: # PlacementScheme = Kademlia PlacementScheme = Nearest -### Choose a NodeScheme implementation +### Choose a NodeScheme implementation: -# NodeScheme = RandomNodes +#NodeScheme = RandomNodes NodeScheme = SimpleNodes ### Choose one of the following FileFactory sections: @@ -30,9 +36,9 @@ filesize = 14 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles @@ -51,3 +57,16 @@ filewidth = 1 #filesmallmax = 20 # Min size of small files: #filesmallmin = 0 + +### Simulator output configuration + +# Print nodes and objects at startup (true/false) +printInitialNodes = false +# Print nodes and objects after each rebuild (true/false) +printNodes = false +# Print object tranfers during rebuilds (true/false) +printRebuilds = false +# Print file information (true/false) +printFiles = false +# Print load change statistics (true/false) +printLoadDiffs = false diff --git a/sim/gobs/params.cfg b/sim/gobs/sweeps/kp04.cfg similarity index 52% copy from sim/gobs/params.cfg copy to sim/gobs/sweeps/kp04.cfg index 9b089f0..716263c 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/sweeps/kp04.cfg @@ -1,25 +1,31 @@ -### Parameters for GOBS Simulator run +### Kademlia vs. PAST 04 + +output = kp04.eps +step = mids + +### General parameters: -## General parameters... # Bit-length of addresses: -B = 16 -# Number of servers: -nodes = 32 +B = 32 # Number of files: -files = 10000 +files = 3000 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +# Number of servers: +minNodes = 10 +maxNodes = 1000 + +### Choose a PlacementScheme implementation: # PlacementScheme = Kademlia PlacementScheme = Nearest -### Choose a NodeScheme implementation +### Choose a NodeScheme implementation: -# NodeScheme = RandomNodes -NodeScheme = SimpleNodes +NodeScheme = RandomNodes +# NodeScheme = SimpleNodes ### Choose one of the following FileFactory sections: @@ -30,9 +36,9 @@ filesize = 14 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles @@ -51,3 +57,16 @@ filewidth = 1 #filesmallmax = 20 # Min size of small files: #filesmallmin = 0 + +### Simulator output configuration + +# Print nodes and objects at startup (true/false) +printInitialNodes = false +# Print nodes and objects after each rebuild (true/false) +printNodes = false +# Print object tranfers during rebuilds (true/false) +printRebuilds = false +# Print file information (true/false) +printFiles = false +# Print load change statistics (true/false) +printLoadDiffs = false diff --git a/sim/gobs/sweeps/nodes.cfg b/sim/gobs/sweeps/nodes.cfg index d094f3b..408d7ef 100644 --- a/sim/gobs/sweeps/nodes.cfg +++ b/sim/gobs/sweeps/nodes.cfg @@ -1,3 +1,3 @@ minNodes = 10 -maxNodes = 100 +maxNodes = 10 diff --git a/sim/gobs/wiki/dc03kp01.png b/sim/gobs/wiki/dc03kp01.png new file mode 100644 index 0000000..fe5eb78 Binary files /dev/null and b/sim/gobs/wiki/dc03kp01.png differ diff --git a/sim/gobs/params.cfg b/sim/gobs/wiki/kp01.cfg similarity index 56% copy from sim/gobs/params.cfg copy to sim/gobs/wiki/kp01.cfg index 9b089f0..87f72c3 100644 --- a/sim/gobs/params.cfg +++ b/sim/gobs/wiki/kp01.cfg @@ -1,22 +1,27 @@ -### Parameters for GOBS Simulator run +### Kademlia vs. PAST 01 + +output = kp01.eps + +### General parameters: -## General parameters... # Bit-length of addresses: -B = 16 -# Number of servers: -nodes = 32 +B = 32 # Number of files: -files = 10000 +files = 3000 # Number of faults: faults = 1 -### Choose a PlacementScheme implementation +# Number of servers: +minNodes = 10 +maxNodes = 100 + +### Choose a PlacementScheme implementation: # PlacementScheme = Kademlia PlacementScheme = Nearest -### Choose a NodeScheme implementation +### Choose a NodeScheme implementation: # NodeScheme = RandomNodes NodeScheme = SimpleNodes @@ -30,9 +35,9 @@ filesize = 14 # Strip size: filestrip = 4 # File/object replicas: -filereplicas = 1 +filereplicas = 3 # Number of objects per file: -filewidth = 1 +filewidth = 10 # FileFactory implementation TraceFiles #FileFactory = TraceFiles @@ -51,3 +56,16 @@ filewidth = 1 #filesmallmax = 20 # Min size of small files: #filesmallmin = 0 + +### Simulator output configuration + +# Print nodes and objects at startup (true/false) +printInitialNodes = false +# Print nodes and objects after each rebuild (true/false) +printNodes = false +# Print object tranfers during rebuilds (true/false) +printRebuilds = false +# Print file information (true/false) +printFiles = false +# Print load change statistics (true/false) +printLoadDiffs = false diff --git a/sim/gobs/wiki/kp01.png b/sim/gobs/wiki/kp01.png new file mode 100644 index 0000000..ed8515b Binary files /dev/null and b/sim/gobs/wiki/kp01.png differ diff --git a/sim/gobs/wiki/kp02.png b/sim/gobs/wiki/kp02.png new file mode 100644 index 0000000..55412b6 Binary files /dev/null and b/sim/gobs/wiki/kp02.png differ hooks/post-receive -- Grayskull Repository