Skip to content

Commit

Permalink
with fixbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
walter-erquinigo committed Jun 3, 2013
1 parent 2905a51 commit 0d3f00f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Binary file modified bin/pucp/wallace/ConcurrentTester$1.class
Binary file not shown.
Binary file modified bin/pucp/wallace/ConcurrentTester.class
Binary file not shown.
Binary file modified bin/pucp/wallace/UHNode.class
Binary file not shown.
20 changes: 10 additions & 10 deletions src/pucp/wallace/ConcurrentTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
*/
public class ConcurrentTester {
static final int workers = 10000; // Numero de trabajadores sobre el UHTree.
static int numThreads;// = 4; // Numero de hilos concurrents.
static int outerPasses;// = workers / numThreads; // Numero de
static int numThreads = 4;// = 4; // Numero de hilos concurrents.
static int outerPasses = 10000;// = workers / numThreads; // Numero de
// trabajadores por
// hilo.
static final int innerOps = 5000; // Numero de operaciones por trabajador.
static final int putPct = 10; // Porcentaje de inserciones.
static final int putPct = 0; // Porcentaje de inserciones.
static final int searchPct = 99; // searchPct - putPct = porcentaje de
// busquedas.
static final int order = 4; // Orden del UHTree.
Expand All @@ -30,20 +30,20 @@ private static int getHash(int x, int bits) {

public static void main(String[] args) {
ConcurrentTester tester = new ConcurrentTester();
numThreads = Integer.parseInt(args[0]);
/*numThreads = Integer.parseInt(args[0]);
outerPasses = workers / numThreads;
boolean withoutRemove = args[1].equals("without_remove");
tester.testConcurrent(withoutRemove);
boolean withoutRemove = args[1].equals("without_remove");*/
tester.testConcurrent(true);
}

public void testConcurrent(final boolean withoutRemove) {
final UHTree map = UHTreeCreator.getNewUHTree(order);
final Random random = new Random(0);
final int keyRange = 130000; // Rango de los elementos a ingresar en el
final int keyRange = 500000; // Rango de los elementos a ingresar en el
// UHTree.
final RandomDistribution.Zipf zipf = new RandomDistribution.Zipf(
random, 0, keyRange, 1.4);

random, 0, keyRange, 1.3);
for(int i = 0; i < keyRange; i++) map.add(i, i);
long t1 = System.nanoTime();
for (int outer = 0; outer < outerPasses; ++outer) {
ParUtil.parallel(numThreads, new Runnable() {
Expand All @@ -62,7 +62,7 @@ public void run() {
}
}

System.out.println("Finished pass.");
//System.out.println("Finished pass.");
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/pucp/wallace/UHNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class UHNode extends IntegerHeap {
private volatile UHList minElements;
private volatile boolean isEmpty;
private final IntegerHeap HQ;
private volatile UHNode[] LQ;
private UHNode[] LQ;
private volatile UHElement best;

/*
Expand Down

0 comments on commit 0d3f00f

Please sign in to comment.