--- /dev/null
+public class Barrier {
+ int numthreads;
+ int entercount;
+ boolean cleared;
+
+ public Barrier(int n) {
+ System.printString("Initializing barrier for "+n+" threads.\n");
+ numthreads=n;
+ cleared = false;
+ entercount = 0;
+ }
+
+ public Barrier() {
+ }
+
+ public void reset() {
+ cleared = false;
+ entercount = 0;
+ }
+
+ public static void enterBarrier(Barrier b) {
+ int tmp;
+ boolean retry=true;
+
+ do {
+ atomic {
+ System.printString("Entering barrier with ec="+b.entercount+" cl="+b.cleared+"\n");
+ if (!b.cleared) {
+ b.entercount++;
+ tmp = b.entercount;
+ if (tmp==b.numthreads) {
+ if(b.numthreads > 1)
+ b.cleared=true;
+ b.entercount--;
+ return;
+ }
+ retry=false;
+ }
+ }
+ } while(retry);
+
+ while(true) {
+ atomic {
+ if (b.cleared) {
+ b.entercount--;
+ int count = b.entercount;
+ if (count==0)
+ b.cleared=false;
+ return;
+ }
+ }
+ }
+ }
+}
JGFInstrumentor.java \
JGFTimer.java \
JGFMolDynBench.java \
-Barrier.java
+DebugBarrier.java
FLAGS=-dsm -prefetch -excprefetch particle.force -excprefetch particle.domove -excprefetch particle.mkekin -excprefetch TournamentBarrier.DoBarrier -excprefetch JGFMolDynBench.JGFvalidate -excprefetch JGFMolDynBench.JGFapplication -optimize -debug -profile -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8
FLAGS2=-dsm -optimize -debug -profile -mainclass ${MAINCLASS} -o ${MAINCLASS}NP