public static void main(String[] args) {
final int iterations = 10000;
int length = 100000;
System.out.println("iterations=" + iterations + ", length=" + length + ", total=" + (iterations * length));
ActorRef accumulator = actorOf(new UntypedActorFactory() {
public UntypedActor create() {
return new Accumulator(iterations);
}
}).start();
// (0,99999), (100000,199999), (200000,299999), (300000,399999)...
for (int x = 0; x < iterations; x++) {
ActorRef worker = actorOf(Worker.class).start();
int start = x * length;
int end = (x + 1) * length - 1;
worker.sendOneWay(new Range(start, end), accumulator);
}
}