Search in sources :

Example 1 with Computation

use of org.apache.hadoop.examples.pi.DistSum.Computation in project hadoop by apache.

the class DistBbp method execute.

/** Execute DistSum computations */
private void execute(DistSum distsum, final Map<Bellard.Parameter, Bellard.Sum> sums) throws Exception {
    final List<Computation> computations = new ArrayList<Computation>();
    int i = 0;
    for (Bellard.Parameter p : Bellard.Parameter.values()) for (Summation s : sums.get(p)) if (s.getValue() == null)
        computations.add(distsum.new Computation(i++, p.toString(), s));
    if (computations.isEmpty())
        Util.out.println("No computation");
    else {
        timer.tick("execute " + computations.size() + " computation(s)");
        Util.execute(distsum.getParameters().nThreads, computations);
        timer.tick("done");
    }
}
Also used : Computation(org.apache.hadoop.examples.pi.DistSum.Computation) ArrayList(java.util.ArrayList) Parameter(org.apache.hadoop.examples.pi.math.Bellard.Parameter) Bellard(org.apache.hadoop.examples.pi.math.Bellard) Summation(org.apache.hadoop.examples.pi.math.Summation)

Aggregations

ArrayList (java.util.ArrayList)1 Computation (org.apache.hadoop.examples.pi.DistSum.Computation)1 Bellard (org.apache.hadoop.examples.pi.math.Bellard)1 Parameter (org.apache.hadoop.examples.pi.math.Bellard.Parameter)1 Summation (org.apache.hadoop.examples.pi.math.Summation)1