bug fixes
authoradash <adash>
Fri, 25 Apr 2008 07:52:10 +0000 (07:52 +0000)
committeradash <adash>
Fri, 25 Apr 2008 07:52:10 +0000 (07:52 +0000)
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/JGFInstrumentor.java
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/JGFMolDynBench.java
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/JGFMolDynBenchSizeA.java
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/JGFTimer.java
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/TournamentBarrier.java
Robust/src/Benchmarks/Prefetch/Moldyn/dsm/makefile

index fc737bec8b3752e607a971c4f1a7813e51154747..3f9f580c0b6a7207e074b20cf138fd4a9fd2b072 100644 (file)
@@ -31,7 +31,7 @@ public class JGFInstrumentor{
 
     if (timers.containsKey(name)) {
       System.printString("JGFInstrumentor.addTimer: warning -  timer " + name + 
-          " already exists");
+          " already exists\n");
     }
     else {
       timers.put(name, new JGFTimer(name));
@@ -42,7 +42,7 @@ public class JGFInstrumentor{
 
     if (timers.containsKey(name)) {
       System.printString("JGFInstrumentor.addTimer: warning -  timer " + name + 
-          " already exists");
+          " already exists\n");
     }
     else {
       timers.put(name, new JGFTimer(name,opname));
@@ -54,7 +54,7 @@ public class JGFInstrumentor{
 
     if (timers.containsKey(name)) {
       System.printString("JGFInstrumentor.addTimer: warning -  timer " + name +
-          " already exists");
+          " already exists\n");
     }
     else {
       timers.put(name, new JGFTimer(name,opname,size));
@@ -68,7 +68,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.startTimer: failed -  timer " + name + 
-          " does not exist");
+          " does not exist\n");
     }
 
   }
@@ -79,7 +79,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.stopTimer: failed -  timer " + name + 
-          " does not exist");
+          " does not exist\n");
     }
   }
 
@@ -89,7 +89,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.addOpsToTimer: failed -  timer " + name + 
-          " does not exist");
+          " does not exist\n");
     }
   }  
 
@@ -99,7 +99,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.addTimeToTimer: failed -  timer " + name +
-          " does not exist");
+          " does not exist\n");
     }
 
 
@@ -113,7 +113,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.readTimer: failed -  timer " + name + 
-          " does not exist");
+          " does not exist\n");
       time = 0.0; 
     }
     return time; 
@@ -125,7 +125,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.resetTimer: failed -  timer " + name +
-          " does not exist");
+          " does not exist\n");
     }
   }
 
@@ -135,7 +135,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.printTimer: failed -  timer " + name +
-          " does not exist");
+          " does not exist\n");
     }
   }
 
@@ -145,7 +145,7 @@ public class JGFInstrumentor{
     }
     else {
       System.printString("JGFInstrumentor.printTimer: failed -  timer " + name +
-          " does not exist");
+          " does not exist\n");
     }
   }
 
@@ -185,15 +185,15 @@ public class JGFInstrumentor{
         header = base + "3 - Size B";
     }
 
-    System.printString(header); 
+    System.printString(header + "\n"); 
 
     if (nthreads == 1) {
-      System.printString("Executing on " + nthreads + " thread");
+      System.printString("Executing on " + nthreads + " thread\n");
     }
     else {
-      System.printString("Executing on " + nthreads + " threads");
+      System.printString("Executing on " + nthreads + " threads\n");
     }
 
-    System.printString("");
+    System.printString(" \n");
   } 
 }
index b7ce77eb25d83a7af74b776ede01c17cbb98ee17..5e2b6921e537cb998c5b8de775b94f1a7fae5834 100644 (file)
@@ -28,9 +28,9 @@ public class JGFMolDynBench {
 
   public int PARTSIZE;
 
-  public global double[] epot;
-  public global double[] vir;
-  public global double[] ek;
+  public double[] epot;
+  public double[] vir;
+  public double[] ek;
 
   int size,mm;
   int[] datasizes;
@@ -38,12 +38,11 @@ public class JGFMolDynBench {
   public int interactions;
   public int[] interacts;
 
-  public global int nthreads;
-  public global JGFInstrumentor instr;
+  public int nthreads;
+  public JGFInstrumentor instr;
 
-  public JGFMolDynBench(int nthreads, JGFInstrumentor instr) {
+  public JGFMolDynBench(int nthreads) {
     this.nthreads=nthreads;
-    this.instr = instr;
   }
 
   public void JGFsetsize(int size){
@@ -52,7 +51,7 @@ public class JGFMolDynBench {
 
   public void JGFinitialise(){
     interactions = 0;
-    datasizes = new int[2];
+    datasizes = global new int[2];
     datasizes[0] = 8;
     datasizes[1] = 13;
 
@@ -65,8 +64,6 @@ public class JGFMolDynBench {
     kb = 1.38066e-23;
     TSIM = 50;
     deltat = 5e-16;
-
-    //initialise();
   }
 
   public static void JGFapplication(JGFMolDynBench mold) { 
@@ -84,11 +81,14 @@ public class JGFMolDynBench {
       numthreads = mold.nthreads;
     }
 
-    double sh_force [][] = new double[3][partsize];
-    double sh_force2 [][][] = new double[3][numthreads][partsize];
+    double sh_force [][];
+    double sh_force2 [][][];
+    atomic {
+      sh_force = global new double[3][partsize];
+      sh_force2 = global new double[3][numthreads][partsize];
+    }
 
     // spawn threads 
-    //Thread thobjects[] = new Thread [nthreads];
     mdRunner[] thobjects;
     TournamentBarrier br;
     atomic {
@@ -101,16 +101,18 @@ public class JGFMolDynBench {
 
     for(int i=1;i<numthreads;i++) {
       atomic {
-        thobjects[i] = global new mdRunner(i,mold.mm,sh_force,sh_force2,br,mold.instr,mold.nthreads,mold);
+        thobjects[i] = global new mdRunner(i,mold.mm,sh_force,sh_force2,br,mold.nthreads,mold);
         tmp = thobjects[i];
       }
       tmp.start(mid);
     }
 
     atomic {
-      thobjects[0] = global new mdRunner(0,mold.mm,sh_force,sh_force2,br,mold.instr,mold.nthreads,mold);
-      thobjects[0].run();
+      thobjects[0] = global new mdRunner(0,mold.mm,sh_force,sh_force2,br,mold.nthreads,mold);
+      tmp = thobjects[0];
     }
+    tmp.start(mid);
+    tmp.join();
 
     for(int i=1;i<numthreads;i++) {
       atomic {
@@ -126,8 +128,8 @@ public class JGFMolDynBench {
     refval[1] = 7397.392307839352;
     double dev = Math.fabs(ek[0] - refval[size]);
     if (dev > 1.0e-10 ){
-      //System.printString("Validation failed");
-      //System.printString("Kinetic Energy = " + (long)ek[0] + "  " + (long)dev + "  " + size);
+      //System.printString("Validation failed\n");
+      //System.printString("Kinetic Energy = " + (long)ek[0] + "  " + (long)dev + "  " + size + "\n");
     }
   }
 }
@@ -157,20 +159,18 @@ class mdRunner extends Thread {
 
   TournamentBarrier br;
   random randnum;
-  JGFInstrumentor instr;
   JGFMolDynBench mymd;
   int nthreads;
 
   particle[] one;
 
   public mdRunner(int id, int mm, double [][] sh_force, double [][][] sh_force2,TournamentBarrier br, 
-      JGFInstrumentor instr, int nthreads, JGFMolDynBench mymd) {
+      int nthreads, JGFMolDynBench mymd) {
     this.id=id;
     this.mm=mm;
     this.sh_force=sh_force;
     this.sh_force2=sh_force2;
     this.br=br;
-    this.instr = instr;
     this.nthreads = nthreads;
     this.mymd = mymd;
     count = 0.0;
@@ -189,32 +189,38 @@ class mdRunner extends Thread {
 
     atomic {
       mdsize = mymd.PARTSIZE;
-    }
-    one = global new particle [mdsize];
-    atomic {
+      one = global new particle[mdsize];
       l = mymd.LENGTH;
     }
 
-    side = Math.pow((mdsize/den),0.3333333);
-    rcoff = mm/4.0;
-
-    a = side/mm;
-    sideh = side*0.5;
-    hsq = h*h;
-    hsq2 = hsq*0.5;
-    npartm = mdsize - 1;
-    rcoffs = rcoff * rcoff;
-    tscale = 16.0 / (1.0 * mdsize - 1.0);
-    vaver = 1.13 * Math.sqrt(tref / 24.0);
-    vaverh = vaver * h;
-
-    /* Particle Generation */
-
-    xvelocity = 0.0;
-    yvelocity = 0.0;
-    zvelocity = 0.0;
-
-    ijk = 0;
+    int tmpmdsize;
+    double tmpden;
+    atomic {
+      tmpmdsize = mdsize;
+      tmpden = den;
+    }
+    
+    atomic {
+      side = Math.pow((tmpmdsize/tmpden),0.3333333);
+      rcoff = mm/4.0;
+
+      a = side/mm;
+      sideh = side*0.5;
+      hsq = h*h;
+      hsq2 = hsq*0.5;
+      npartm = tmpmdsize - 1;
+      rcoffs = rcoff * rcoff;
+      tscale = 16.0 / (1.0 * tmpmdsize - 1.0);
+      vaver = 1.13 * Math.sqrt(tref / 24.0);
+      vaverh = vaver * h;
+
+      /* Particle Generation */
+
+      xvelocity = 0.0;
+      yvelocity = 0.0;
+      zvelocity = 0.0;
+      ijk = 0;
+    }
     atomic {
       for (lg=0; lg<=1; lg++) {
         for (i=0; i<mm; i++) {
@@ -228,6 +234,7 @@ class mdRunner extends Thread {
         }
       }
     }
+
     atomic {
       for (lg=1; lg<=2; lg++) {
         for (i=0; i<mm; i++) {
@@ -245,234 +252,229 @@ class mdRunner extends Thread {
 
     /* Initialise velocities */
 
-    iseed = 0;
-    v1 = 0.0;
-    v2 = 0.0;
+    atomic {
+      iseed = 0;
+      v1 = 0.0;
+      v2 = 0.0;
+      randnum = global new random(iseed,v1,v2);
+
+      for (i=0; i<tmpmdsize; i+=2) {
+        r  = randnum.seed();
+        one[i].xvelocity = r*randnum.v1;
+        one[i+1].xvelocity  = r*randnum.v2;
+      }
 
-    randnum = global new random(iseed,v1,v2);
+      for (i=0; i<tmpmdsize; i+=2) {
+        r  = randnum.seed();
+        one[i].yvelocity = r*randnum.v1;
+        one[i+1].yvelocity  = r*randnum.v2;
+      }
 
-    for (i=0; i<mdsize; i+=2) {
-      r  = randnum.seed();
-      one[i].xvelocity = r*randnum.v1;
-      one[i+1].xvelocity  = r*randnum.v2;
-    }
+      for (i=0; i<tmpmdsize; i+=2) {
+        r  = randnum.seed();
+        one[i].zvelocity = r*randnum.v1;
+        one[i+1].zvelocity  = r*randnum.v2;
+      }
 
-    for (i=0; i<mdsize; i+=2) {
-      r  = randnum.seed();
-      one[i].yvelocity = r*randnum.v1;
-      one[i+1].yvelocity  = r*randnum.v2;
-    }
 
-    for (i=0; i<mdsize; i+=2) {
-      r  = randnum.seed();
-      one[i].zvelocity = r*randnum.v1;
-      one[i+1].zvelocity  = r*randnum.v2;
-    }
+      /* velocity scaling */
 
+      ekin = 0.0;
+      sp = 0.0;
 
-    /* velocity scaling */
+      for(i=0;i<tmpmdsize;i++) {
+        sp = sp + one[i].xvelocity;
+      }
+      sp = sp / tmpmdsize;
 
-    ekin = 0.0;
-    sp = 0.0;
+      for(i=0;i<tmpmdsize;i++) {
+        one[i].xvelocity = one[i].xvelocity - sp;
+        ekin = ekin + one[i].xvelocity*one[i].xvelocity;
+      }
 
-    for(i=0;i<mdsize;i++) {
-      sp = sp + one[i].xvelocity;
-    }
-    sp = sp / mdsize;
+      sp = 0.0;
+      for(i=0;i<tmpmdsize;i++) {
+        sp = sp + one[i].yvelocity;
+      }
+      sp = sp / tmpmdsize;
 
-    for(i=0;i<mdsize;i++) {
-      one[i].xvelocity = one[i].xvelocity - sp;
-      ekin = ekin + one[i].xvelocity*one[i].xvelocity;
-    }
+      for(i=0;i<tmpmdsize;i++) {
+        one[i].yvelocity = one[i].yvelocity - sp;
+        ekin = ekin + one[i].yvelocity*one[i].yvelocity;
+      }
 
-    sp = 0.0;
-    for(i=0;i<mdsize;i++) {
-      sp = sp + one[i].yvelocity;
-    }
-    sp = sp / mdsize;
 
-    for(i=0;i<mdsize;i++) {
-      one[i].yvelocity = one[i].yvelocity - sp;
-      ekin = ekin + one[i].yvelocity*one[i].yvelocity;
-    }
+      sp = 0.0;
+      for(i=0;i<tmpmdsize;i++) {
+        sp = sp + one[i].zvelocity;
+      }
+      sp = sp / tmpmdsize;
 
+      for(i=0;i<tmpmdsize;i++) {
+        one[i].zvelocity = one[i].zvelocity - sp;
+        ekin = ekin + one[i].zvelocity*one[i].zvelocity;
+      }
 
-    sp = 0.0;
-    for(i=0;i<mdsize;i++) {
-      sp = sp + one[i].zvelocity;
-    }
-    sp = sp / mdsize;
+      ts = tscale * ekin;
+      sc = h * Math.sqrt(tref/ts);
 
-    for(i=0;i<mdsize;i++) {
-      one[i].zvelocity = one[i].zvelocity - sp;
-      ekin = ekin + one[i].zvelocity*one[i].zvelocity;
-    }
 
-    ts = tscale * ekin;
-    sc = h * Math.sqrt(tref/ts);
+      for(i=0;i<tmpmdsize;i++) {
 
+        one[i].xvelocity = one[i].xvelocity * sc;     
+        one[i].yvelocity = one[i].yvelocity * sc;     
+        one[i].zvelocity = one[i].zvelocity * sc;     
 
-    for(i=0;i<mdsize;i++) {
+      }
 
-      one[i].xvelocity = one[i].xvelocity * sc;     
-      one[i].yvelocity = one[i].yvelocity * sc;     
-      one[i].zvelocity = one[i].zvelocity * sc;     
 
-    }
+      /* Synchronise threads and start timer before MD simulation */
 
+        br.DoBarrier(id);
+      //if (id == 0) JGFInstrumentor.startTimer("Section3:MolDyn:Run", instr.timers);
+        br.DoBarrier(id);
 
-    /* Synchronise threads and start timer before MD simulation */
+      /* MD simulation */
 
-    atomic {
-      br.DoBarrier(id);
-    }
-    if (id == 0) JGFInstrumentor.startTimer("Section3:MolDyn:Run", instr.timers);
-    atomic {
-      br.DoBarrier(id);
-    }
-
-
-    /* MD simulation */
+      move = 0;
+      for (move=0;move<movemx;move++) {
 
-    move = 0;
-    for (move=0;move<movemx;move++) {
+        /* move the particles and update velocities */
 
-      /* move the particles and update velocities */
-
-      for (i=0;i<mdsize;i++) {
-        one[i].domove(side,i);       
-      }
+        for (i=0;i<tmpmdsize;i++) {
+          one[i].domove(side,i);       
+        }
 
-      /* Barrier */
-      br.DoBarrier(id);
+        /* Barrier */
+        br.DoBarrier(id);
 
-      if(id==0) {
-        for(j=0;j<3;j++) {
-          for (i=0;i<mdsize;i++) {
-            sh_force[j][i] = 0.0;
+        if(id==0) {
+          for(j=0;j<3;j++) {
+            for (i=0;i<tmpmdsize;i++) {
+              sh_force[j][i] = 0.0;
+            }
           }
         }
-      }
-
-      mymd.epot[id] = 0.0;
-      mymd.vir[id] = 0.0;
-      mymd.interacts[id] = 0;
-
-      /* Barrier */
-      br.DoBarrier(id);
 
+        mymd.epot[id] = 0.0;
+        mymd.vir[id] = 0.0;
+        mymd.interacts[id] = 0;
 
+        /* Barrier */
+        br.DoBarrier(id);
 
-      /* compute forces */
+        /* compute forces */
 
-      for (i=0+id;i<mdsize;i+=nthreads) {
-        one[i].force(side,rcoff,mdsize,i,xx,yy,zz,mymd); 
-      }
+        for (i=0+id;i<tmpmdsize;i+=nthreads) {
+          one[i].force(side,rcoff,tmpmdsize,i,xx,yy,zz,mymd); 
+        }
 
-      /* Barrier */
-      br.DoBarrier(id);
+        /* Barrier */
+        br.DoBarrier(id);
 
-      /* update force arrays */
+        /* update force arrays */
 
-      if(id == 0) {
-        for(int k=0;k<3;k++) {
-          for(i=0;i<mdsize;i++) {
-            for(j=0;j<nthreads;j++) {
-              sh_force[k][i] += sh_force2[k][j][i];
+        if(id == 0) {
+          for(int k=0;k<3;k++) {
+            for(i=0;i<tmpmdsize;i++) {
+              for(j=0;j<nthreads;j++) {
+                sh_force[k][i] += sh_force2[k][j][i];
+              }
             }
           }
         }
-      }
 
-      if(id == 0) {
-        for(int k=0;k<3;k++) {
-          for(i=0;i<mdsize;i++) {
-            for(j=0;j<nthreads;j++) {
-              sh_force2[k][j][i] = 0.0;
+        if(id == 0) {
+          for(int k=0;k<3;k++) {
+            for(i=0;i<tmpmdsize;i++) {
+              for(j=0;j<nthreads;j++) {
+                sh_force2[k][j][i] = 0.0;
+              }
             }
           }
         }
-      }
 
-      if(id==0) {
-        for(j=1;j<nthreads;j++) {
-          mymd.epot[0] += mymd.epot[j];
-          mymd.vir[0] += mymd.vir[j];
-        }
-        for(j=1;j<nthreads;j++) {       
-          mymd.epot[j] = mymd.epot[0];
-          mymd.vir[j] = mymd.vir[0];
-        }
-        for(j=0;j<nthreads;j++) {
-          mymd.interactions += mymd.interacts[j]; 
+        if(id==0) {
+          for(j=1;j<nthreads;j++) {
+            mymd.epot[0] += mymd.epot[j];
+            mymd.vir[0] += mymd.vir[j];
+          }
+          for(j=1;j<nthreads;j++) {       
+            mymd.epot[j] = mymd.epot[0];
+            mymd.vir[j] = mymd.vir[0];
+          }
+          for(j=0;j<nthreads;j++) {
+            mymd.interactions += mymd.interacts[j]; 
+          }
         }
-      }
 
-      /* Barrier */
-      br.DoBarrier(id);
+        /* Barrier */
+        br.DoBarrier(id);
 
-      if(id == 0) {
-        for (j=0;j<3;j++) {
-          for (i=0;i<mdsize;i++) {
-            sh_force[j][i] = sh_force[j][i] * hsq2;
+        if(id == 0) {
+          for (j=0;j<3;j++) {
+            for (i=0;i<tmpmdsize;i++) {
+              sh_force[j][i] = sh_force[j][i] * hsq2;
+            }
           }
         }
-      }
 
-      sum = 0.0;
+        sum = 0.0;
 
-      /* Barrier */
-      br.DoBarrier(id);
+        /* Barrier */
+        br.DoBarrier(id);
 
-      /*scale forces, update velocities */
+        /*scale forces, update velocities */
 
-      for (i=0;i<mdsize;i++) {
-        sum = sum + one[i].mkekin(hsq2,i);  
-      }
+        for (i=0;i<tmpmdsize;i++) {
+          sum = sum + one[i].mkekin(hsq2,i);  
+        }
 
-      ekin = sum/hsq;
+        ekin = sum/hsq;
 
-      vel = 0.0;
-      count = 0.0;
+        vel = 0.0;
+        count = 0.0;
 
-      /* average velocity */
+        /* average velocity */
 
-      for (i=0;i<mdsize;i++) {
-        velt = one[i].velavg(vaverh,h);
-        if(velt > vaverh) { count = count + 1.0; }
-        vel = vel + velt;                    
-      }
+        for (i=0;i<tmpmdsize;i++) {
+          velt = one[i].velavg(vaverh,h);
+          if(velt > vaverh) { count = count + 1.0; }
+          vel = vel + velt;                    
+        }
 
-      vel = vel / h;
+        vel = vel / h;
 
-      /* temperature scale if required */
+        /* temperature scale if required */
 
-      if((move < istop) && (((move+1) % irep) == 0)) {
-        sc = Math.sqrt(tref / (tscale*ekin));
-        for (i=0;i<mdsize;i++) {
-          one[i].dscal(sc,1);
+        if((move < istop) && (((move+1) % irep) == 0)) {
+          sc = Math.sqrt(tref / (tscale*ekin));
+          for (i=0;i<tmpmdsize;i++) {
+            one[i].dscal(sc,1);
+          }
+          ekin = tref / tscale;
         }
-        ekin = tref / tscale;
-      }
 
-      /* sum to get full potential energy and virial */
+        /* sum to get full potential energy and virial */
+
+        if(((move+1) % iprint) == 0) {
+          mymd.ek[id] = 24.0*ekin;
+          mymd.epot[id] = 4.0*mymd.epot[id];
+          etot = mymd.ek[id] + mymd.epot[id];
+          temp = tscale * ekin;
+          pres = tmpden * 16.0 * (ekin - mymd.vir[id]) / tmpmdsize;
+          vel = vel / tmpmdsize; 
+          rp = (count / tmpmdsize) * 100.0;
+        }
 
-      if(((move+1) % iprint) == 0) {
-        mymd.ek[id] = 24.0*ekin;
-        mymd.epot[id] = 4.0*mymd.epot[id];
-        etot = mymd.ek[id] + mymd.epot[id];
-        temp = tscale * ekin;
-        pres = den * 16.0 * (ekin - mymd.vir[id]) / mdsize;
-        vel = vel / mdsize; 
-        rp = (count / mdsize) * 100.0;
+        br.DoBarrier(id);
       }
 
-      br.DoBarrier(id);
-    }
 
+      br.DoBarrier(id);
+      //if (id == 0) JGFInstrumentor.stopTimer("Section3:MolDyn:Run", instr.timers);
 
-    br.DoBarrier(id);
-    if (id == 0) JGFInstrumentor.stopTimer("Section3:MolDyn:Run", instr.timers);
+    }
 
   }
 
index 125f7571bed0027bd69681c91bbe4f5bd1e9f8fa..518cf4db7a8280c9473edaaf69b6780ab4382fd3 100644 (file)
@@ -24,8 +24,8 @@ public class JGFMolDynBenchSizeA {
     if(argv.length != 0 ) {
       nthreads = Integer.parseInt(argv[0]);
     } else {
-      System.printString("The no of threads has not been specified, defaulting to 1");
-      System.printString("  ");
+      System.printString("The no of threads has not been specified, defaulting to 1\n");
+      System.printString("  " + "\n");
       nthreads = 1;
     }
 
@@ -34,7 +34,7 @@ public class JGFMolDynBenchSizeA {
 
     JGFMolDynBench mold;
     atomic {
-      mold = global new JGFMolDynBench(nthreads, instr); 
+      mold = global new JGFMolDynBench(nthreads); 
     }
     int size = 0;
     JGFInstrumentor.addTimer("Section3:MolDyn:Total", "Solutions",size, instr.timers);
@@ -49,7 +49,6 @@ public class JGFMolDynBenchSizeA {
     JGFMolDynBench tmp;
     atomic {
       mold.JGFinitialise(); 
-      //tmp = mold;
     }
     JGFMolDynBench.JGFapplication(mold); 
     atomic {
@@ -66,8 +65,8 @@ public class JGFMolDynBenchSizeA {
     }
     double dev = Math.fabs(dval - refval[size]);
     if (dev > 1.0e-10 ){
-      System.printString("Validation failed");
-      System.printString("Kinetic Energy = " + (long)dval + "  " + (long)dev + "  " + size);
+      System.printString("Validation failed\n");
+      System.printString("Kinetic Energy = " + (long)dval + "  " + (long)dev + "  " + size + "\n");
     }
 
     JGFInstrumentor.stopTimer("Section3:MolDyn:Total", instr.timers);
index d65f4010b90338d971d5422a5c5fc7fe800a4ce1..4e1d168f94ca0653b0f2ba39adfae1fe9114446a 100644 (file)
@@ -53,7 +53,7 @@ public class JGFTimer {
 
 
   public void start(){
-    if (on) System.printString("Warning timer " + " was already turned on");
+    if (on) System.printString("Warning timer " + " was already turned on\n");
     on = true; 
     start_time = System.currentTimeMillis();
   }
@@ -61,7 +61,7 @@ public class JGFTimer {
 
   public void stop(){
     time += (double) (System.currentTimeMillis()-start_time) / 1000.;
-    if (!on) System.printString("Warning timer " + " wasn't turned on");
+    if (!on) System.printString("Warning timer " + " wasn't turned on\n");
     calls++;
     on = false;  
   }
@@ -86,23 +86,23 @@ public class JGFTimer {
   }
 
   public void longprint(){
-    System.printString("Timer            Calls         Time(s)       Performance("+opname+"/s)");   
-    System.printString(name + "           " + calls +    "           "  +  (long)time + "        " + (long)this.perf());
+    System.printString("Timer            Calls         Time(s)       Performance("+opname+"/s)\n");   
+    System.printString(name + "           " + calls +    "           "  +  (long)time + "        " + (long)this.perf() + "\n");
   }
 
   public void print(){
     if (opname.equals("")) {
-      System.printString(name + "   " + (long)time + " (s)");
+      System.printString(name + "   " + (long)time + " (s)\n");
     }
     else {
       if(size == 0) {
-        System.printString(name + ":SizeA" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)");
+        System.printString(name + ":SizeA" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)\n");
       } else if (size == 1) {
-        System.printString(name + ":SizeB" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)");
+        System.printString(name + ":SizeB" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)\n");
       } else if (size == 2) {
-        System.printString(name + ":SizeC" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)");
+        System.printString(name + ":SizeC" + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)\n");
       } else{
-        System.printString(name + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)");
+        System.printString(name + "\t" + (long)time + " (s) \t " + (long)this.perf() + "\t" + " ("+opname+"/s)\n");
       }
     }
   }
@@ -117,7 +117,7 @@ public class JGFTimer {
     while ( name.length() < 40 ) name = name + " "; 
 
     System.printString(name + "\t" + (long)this.perf() + "\t"
-        + " ("+opname+"/s)");  
+        + " ("+opname+"/s)\n");  
   }
 
 }
index 266e3cc01b60049f60fb2901fd04cd4f9a16d93f..56259b4541e7adedbdf2d4d0e19693fea5896c47 100755 (executable)
@@ -40,7 +40,7 @@ public class TournamentBarrier {
 
     // Initialise the IsDone array. The choice of initial value is
     // arbitrary, but must be consistent!
-    IsDone = new boolean[numThreads];
+    IsDone = global new boolean[numThreads];
     for(int i = 0; i < n; i++) {
       IsDone[i] = false;
     }
index f1ad9c84afdafdfa46461fa373a3c544738dc456..1d8fed82e8a09badb87808eb32dfffc6f957fb22 100644 (file)
@@ -4,7 +4,7 @@ JGFInstrumentor.java \
 JGFTimer.java \
 JGFMolDynBench.java \
 TournamentBarrier.java
-FLAGS=-dsm -prefetch -optimize -debug -profile -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.5
+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
 
 default: