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");
}
}
Aggregations