13 |
|
|
14 |
|
static final double EPSILON = 0.0001; // convergence criterion |
15 |
|
|
16 |
< |
public static void main(String[] args) { |
16 |
> |
public static void main(String[] args) throws Exception { |
17 |
|
int n = 2048; |
18 |
|
int steps = 1000; |
19 |
|
try { |
28 |
|
return; |
29 |
|
} |
30 |
|
|
31 |
< |
ForkJoinPool fjp = new ForkJoinPool(); |
31 |
> |
// ForkJoinPool fjp = new ForkJoinPool(); |
32 |
> |
ForkJoinPool fjp = ForkJoinPool.commonPool(); |
33 |
> |
|
34 |
|
// int granularity = (n * n / fjp.getParallelism()) / 2; |
35 |
|
int granularity = n * n / fjp.getParallelism(); |
36 |
|
dimGran = (int)(Math.sqrt(granularity)); |
46 |
|
for (int j = 1; j < dim-1; ++j) |
47 |
|
a[i][j] = smallVal; |
48 |
|
} |
49 |
< |
int nreps = 3; |
49 |
> |
int nreps = 10; |
50 |
|
for (int rep = 0; rep < nreps; ++rep) { |
51 |
|
// Fill all edges with 1's. |
52 |
|
for (int k = 0; k < dim; ++k) { |
64 |
|
|
65 |
|
System.out.println("Compute Time: " + secs); |
66 |
|
System.out.println(fjp); |
67 |
+ |
Thread.sleep(1000); |
68 |
|
} |
69 |
|
} |
70 |
|
|