Package aleph

Examples of aleph.Join.waitFor()


    Worker worker = new Worker(solution, nextRow, i, depth-1);
    worker.start((PE) e.next(), join);
  }
      }
    }
    join.waitFor();
  }

  boolean getLeftDiag(int i, int j) {
    return left[i+j];
  }
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();
    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

    long start = System.currentTimeMillis();
    for (Iterator e = PE.allPEs(); e.hasNext(); ) {
      thread.start((PE) e.next(), join);
    }
    join.waitFor();
    System.out.println("Elapsed time: " +
           ((double) (System.currentTimeMillis() - start)) / 1000.0);
  }
}
View Full Code Here

    UserThread   fork   = new UserThread(count, global);
    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

     for (int i = 0; i < n; i++)
       for (int j = 0; j < n; j++) {
   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) {}
View Full Code Here

     InitThread fork = new InitThread(numvert, perproc);
     Join       join = new Join();
     Iterator e = PE.roundRobin();
     for (int i = 0; i < numproc; i++)
       fork.start((PE) e.next(), join);
     join.waitFor();

     System.out.println("phase 2");
     AddEdgeThread fork1 = new AddEdgeThread(numvert, perproc);
     e = PE.allPEs();
     for (int i = 0; i < numproc; i++)
View Full Code Here

     System.out.println("phase 2");
     AddEdgeThread fork1 = new AddEdgeThread(numvert, perproc);
     e = PE.allPEs();
     for (int i = 0; i < numproc; i++)
       fork1.start((PE) e.next(), join);
     join.waitFor();

   }

   // create numvert/numproc nodes on each PE
   // the nodes on each PE are put in a linked list
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();
    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

      for (int j = 0; j < iterations; j++) {
        Iterator e = PE.roundRobin();
        long start = System.currentTimeMillis();
        for (int k = 0; k < i; k++)
          thread.start((PE) e.next(), join);
        join.waitFor();
        long stop = System.currentTimeMillis();
        duration += (stop - start);
      }
      System.out.println(Integer.toString(i+1) + "\t" +
                         (double) duration / (double) iterations);
View Full Code Here

      for (int j = 0; j < iterations; j++) {
        Iterator e = PE.roundRobin();
        long start = System.currentTimeMillis();
        for (int k = 0; k <= i; k++)
          thread.start((PE) e.next(), join);
        join.waitFor();
        long stop = System.currentTimeMillis();
        duration += (stop - start);
      }
      System.out.println(Integer.toString(i+1) + "\t" +
       (double) duration / (double) iterations);
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.