26 |
|
|
27 |
|
int procs = 0; |
28 |
|
int n = 2048; |
29 |
< |
int runs = 5; |
29 |
> |
int runs = 32; |
30 |
|
try { |
31 |
|
if (args.length > 0) |
32 |
|
procs = Integer.parseInt(args[0]); |
43 |
|
System.out.println(usage); |
44 |
|
return; |
45 |
|
} |
46 |
< |
ForkJoinPool pool = (procs == 0) ? new ForkJoinPool() : |
46 |
> |
ForkJoinPool pool = (procs == 0) ? ForkJoinPool.commonPool() : |
47 |
|
new ForkJoinPool(procs); |
48 |
|
System.out.println("procs: " + pool.getParallelism() + |
49 |
|
" n: " + n + " runs: " + runs); |
64 |
|
pool.invoke(new LowerUpper(n, M)); |
65 |
|
long time = System.nanoTime() - start; |
66 |
|
double secs = ((double)time) / NPS; |
67 |
< |
System.out.printf("\tTime: %7.3f\n", secs); |
67 |
> |
System.out.printf("Time: %7.3f ", secs); |
68 |
> |
if ((run & 3) == 3) System.out.println(); |
69 |
|
|
70 |
|
if (CHECK) check(m, copy, n); |
71 |
|
} |