BiGraph bg;
int upperlimit;
int lowerlimit;
- Barrier mybarr;
+ //Barrier barr;
+ String hostname;
public Em3d() {
}
- public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, Barrier mybarr, int numDegree, int threadindex) {
+ public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, int numDegree, int threadindex, String name) {
this.bg = bg;
this.lowerlimit = lowerlimit;
this.upperlimit = upperlimit;
this.numIter = numIter;
- this.mybarr = mybarr;
+ this.hostname = name;
this.numDegree = numDegree;
this.threadindex=threadindex;
}
int degree;
Random random;
+ barr = new Barrier(hostname);
atomic {
iteration = numIter;
- barr=mybarr;
degree = numDegree;
random = new Random(lowerlimit);
}
bg.allocateNodes ( lowerlimit, upperlimit, threadindex);
}
Barrier.enterBarrier(barr);
+ System.clearPrefetchCache();
atomic {
//initialize the eNodes
long start0 = System.currentTimeMillis();
int numThreads = em.numThreads;
int[] mid = new int[4];
+ String[] hostname;
+ atomic {
+ hostname = global new String[4];
+ hostname[0] = global new String("128.195.175.79");
+ hostname[1] = global new String("128.195.175.73");
+ hostname[2] = global new String("128.195.175.78");
+ hostname[3] = global new String("128.195.175.69");
+ }
mid[0] = (128<<24)|(195<<16)|(175<<8)|79;//dw-1
- mid[1] = (128<<24)|(195<<16)|(175<<8)|80;//dw-2
- mid[2] = (128<<24)|(195<<16)|(175<<8)|73;
- mid[3] = (128<<24)|(195<<16)|(175<<8)|78;
+ mid[1] = (128<<24)|(195<<16)|(175<<8)|73;//dw-2
+ mid[2] = (128<<24)|(195<<16)|(175<<8)|78;
+ mid[3] = (128<<24)|(195<<16)|(175<<8)|69;
+
System.printString("DEBUG -> numThreads = " + numThreads+"\n");
- Barrier mybarr;
+ BarrierServer mybarr;
BiGraph graph;
// System.printString( "Allocating BiGraph.\n" );
atomic {
- mybarr = global new Barrier(numThreads);
+ mybarr = global new BarrierServer(numThreads);
graph = BiGraph.create(em.numNodes, em.numDegree, numThreads);
}
for(int i=0;i<numThreads;i++) {
Em3d tmp;
if ((i+1)==numThreads)
- tmp = global new Em3d(graph, base, em.numNodes, em.numIter, mybarr, em.numDegree, i);
+ tmp = global new Em3d(graph, base, em.numNodes, em.numIter, em.numDegree, i, hostname[0]);
else
- tmp = global new Em3d(graph, base, base+increment, em.numIter, mybarr, em.numDegree, i);
+ tmp = global new Em3d(graph, base, base+increment, em.numIter, em.numDegree, i, hostname[0]);
em3d[i]=new Em3dWrap(tmp);
base+=increment;
}
}
+ //TODO check if correct
+ mybarr.start(mid[0]);
for(int i = 0; i<numThreads; i++) {
- em3d[i].em3d.start(mid[i]);
+ em3d[i].em3d.start(mid[i]);
}
+ mybarr.join();
for(int i = 0; i<numThreads; i++) {
- em3d[i].em3d.join();
+ em3d[i].em3d.join();
}
+ System.printString("Done!"+ "\n");
}
BiGraphNold.java \
Node.java \
Barrier.java
+SRC3=${MAINCLASS}2.java \
+ ${MAINCLASS}Wrap.java \
+ BiGraph2.java \
+ Node2.java \
+ EVector.java
-FLAGS=-dsm -prefetch -optimize -transstats -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -nooptimize -debug -mainclass ${MAINCLASS} -trueprob 0.91
+FLAGS=-dsm -prefetch -optimize -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -debug -mainclass ${MAINCLASS} -trueprob 0.91
+FLAGS1=-dsm -prefetch -transstats -optimize -excprefetch Node.makeUniqueNeighbors -excprefetch EVector.ensureCapacity -excprefetch EVector.addElement -excprefetch BiGraph.makeFromNodes -excprefetch EVector.elementAt -excprefetch BiGraph.initializeNodes -excprefetch BiGraph.allocateNodes -mainclass ${MAINCLASS} -trueprob 0.91
FLAGS2=-dsm -optimize -transstats -mainclass ${MAINCLASS}
default:
# ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC}
# ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC}
- ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NNP ${SRC1}
- ../../../../buildscript ${FLAGS} -o ${MAINCLASS}N ${SRC1}
- cp ${MAINCLASS}NNP.bin ${MAINCLASS}1NP.bin
- cp ${MAINCLASS}N.bin ${MAINCLASS}1.bin
- cp ${MAINCLASS}NNP.bin ${MAINCLASS}2NP.bin
- cp ${MAINCLASS}N.bin ${MAINCLASS}2.bin
- cp ${MAINCLASS}NNP.bin ${MAINCLASS}3NP.bin
- cp ${MAINCLASS}N.bin ${MAINCLASS}3.bin
- cp ${MAINCLASS}NNP.bin ${MAINCLASS}4NP.bin
- cp ${MAINCLASS}N.bin ${MAINCLASS}4.bin
+ ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NNP ${SRC3}
+# ../../../../buildscript ${FLAGS1} -o ${MAINCLASS}N ${SRC3}
+# cp ${MAINCLASS}NNP.bin ${MAINCLASS}1NP.bin
+# cp ${MAINCLASS}N.bin ${MAINCLASS}1.bin
+# cp ${MAINCLASS}NNP.bin ${MAINCLASS}2NP.bin
+# cp ${MAINCLASS}N.bin ${MAINCLASS}2.bin
+# cp ${MAINCLASS}NNP.bin ${MAINCLASS}3NP.bin
+# cp ${MAINCLASS}N.bin ${MAINCLASS}3.bin
+# cp ${MAINCLASS}NNP.bin ${MAINCLASS}4NP.bin
+# cp ${MAINCLASS}N.bin ${MAINCLASS}4.bin
clean:
rm -rf tmpbuilddirectory