Package aleph

Examples of aleph.GlobalObject.open()


    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); ) {
      fork.start((PE) e.next(), join);
    }
    join.waitFor();
    Counter counter = (Counter) global.open("r");
    System.out.println(PE.numPEs() + " PEs, Final value is " + counter.value);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here


    Join         join   = new Join();
    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); )
  fork.start((PE) e.next(), join);
    join.waitFor();
    BigCounter counter = (BigCounter) global.open("r");
    System.out.println("Final value is " + counter.value[0]);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here

   fork = new UserThread(global, i, j, n);
   fork.start((PE)e.next(), join);
       }
     join.waitFor();
     // Print out the result
     Matrix matrix = (Matrix) global.open("r");
     System.out.println("The result matrix is: ");
     System.out.println(matrix);
     try { global.release(); } catch (AlephException x) {}
     System.out.println("Elapsed time: " +
      ((double) (System.currentTimeMillis() - start)) / 1000.0
View Full Code Here

    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); ) {
      fork.start((PE) e.next(), join);
    }
    join.waitFor();
    GlobalObjectLatency counter = (GlobalObjectLatency) global.open("r");
    System.out.println(PE.numPEs() + " PEs, Final value is " + counter.value);
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0
           + " seconds");
  }
View Full Code Here

      System.out.println(Integer.toString(i+1) + "\t" +
       (double) duration / (double) iterations);
      System.out.flush()// impatient?
    }
   
    System.out.println(((SharedCounter)object.open("r")).value);
  }
  public static class SharedCounter implements java.io.Serializable {
    public long value;
  }
}
View Full Code Here

      duration += (stop - start);
    }
    System.out.println(howMany + "\t" + (double) duration / (double)
        iterations);
    try {
      SharedCounter shared = (SharedCounter) object.open("w");
      System.out.println("Final counter value: " + shared.value);
      object.release();
    } catch (AlephException e) {}
  }
  public static class SharedCounter implements java.io.Serializable {
View Full Code Here

    if (Aleph.verbosity(Constants.LOQUACIOUS))
      System.out.println("n:"+n+" dir:"+dir+" peNo:"+peNo+" numPE:"+numPE);
    if (n == 0) return null;
    gb = new GlobalObject(t);
   
    t = (Tree) gb.open("w");
    leftN = (n-1)/2;
    rightN = n-1-leftN;
    if (dir == 1) {
      dir = 0;
      med = median(minX, maxX, n);
View Full Code Here

    }
    Builder builder = new Builder(gb, leftN, dir, peNo+numPE/2, numPE/2,
          minX, med, minY, maxY);
    builder.start(PE.getPE(peNo+numPE/2), jv);
    jv.waitFor();
    t = (Tree) gb.open("w");
  }
      }
     
      if (rightN == 0)
  t._right = null;
View Full Code Here

    }
    Builder builder = new Builder(gb, leftN, dir, peNo+numPE/2, numPE/2,
          minX, maxX, minY, med);
    builder.start(PE.getPE(peNo+numPE/2), jv);
    jv.waitFor();
    t = (Tree) gb.open("w");
  }
      }

      if (rightN == 0)
  t._right = null;
View Full Code Here

    } catch (AlephException ale) {
      Aleph.warning("Release failed: " + ale.getMessage());
    }

    while(gtmp != root) {
      tmp = (Tree) gtmp.open("r");
      if (Aleph.verbosity(Constants.LOQUACIOUS))
  System.out.println("x = " + tmp._x + ", y = " + tmp._y);
      oldgtmp = gtmp;
      gtmp = tmp._next;
      try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.