1 |
|
// Barrier version of Jacobi iteration |
2 |
|
|
3 |
|
import java.util.concurrent.*; |
4 |
– |
//import jsr166y.*; |
4 |
|
|
5 |
|
public class FJPhaserJacobi { |
6 |
|
|
19 |
|
} |
20 |
|
|
21 |
|
catch (Exception e) { |
22 |
< |
System.out.println("Usage: java FJPhaserJacobi <matrix size> <max steps>"); |
22 |
> |
System.out.println("Usage: java ThreadPhaserJacobi <matrix size> <max steps>"); |
23 |
|
return; |
24 |
|
} |
25 |
|
|
26 |
|
ForkJoinPool fjp = new ForkJoinPool(); |
27 |
+ |
// int granularity = (n * n / fjp.getParallelism()) / 2; |
28 |
|
int granularity = n * n / fjp.getParallelism(); |
29 |
|
dimGran = (int)(Math.sqrt(granularity)); |
30 |
|
|
171 |
|
} |
172 |
|
} |
173 |
|
} |
174 |
+ |
|