public static void main(String[] args) {
MyThread thread = new MyThread();
Join join = new Join();
int howMany = PE.numPEs();
int iterations = 100;
try {
if ( args.length > 0)
iterations = Integer.parseInt(args[0]);
} catch (NumberFormatException e) {
System.err.println("usage: Null <#iterations>");
Aleph.exit(1);
}
System.out.println("iterations: " + iterations);
System.out.println("#PEs\ttime");
for (int i = 0; i < PE.numPEs(); i++) {
long duration = 0;
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);