32 |
|
|
33 |
|
ForkJoinPool fjp = new ForkJoinPool(); |
34 |
|
int granularity = n * n / fjp.getParallelism(); |
35 |
< |
dimGran = (int)(Math.sqrt(granularity)); |
35 |
> |
dimGran = (int) Math.sqrt(granularity); |
36 |
|
|
37 |
|
// allocate enough space for edges |
38 |
|
int dim = n+2; |
59 |
|
fjp.invoke(driver); |
60 |
|
|
61 |
|
long time = System.currentTimeMillis() - startTime; |
62 |
< |
double secs = ((double)time) / 1000.0; |
62 |
> |
double secs = (double) time / 1000.0; |
63 |
|
|
64 |
|
System.out.println("Compute Time: " + secs); |
65 |
|
System.out.println(fjp); |
143 |
|
public void compute() { |
144 |
|
int rows = hiRow - loRow + 1; |
145 |
|
int cols = hiCol - loCol + 1; |
146 |
< |
int rblocks = Math.round((float)rows / dimGran); |
147 |
< |
int cblocks = Math.round((float)cols / dimGran); |
146 |
> |
int rblocks = Math.round((float) rows / dimGran); |
147 |
> |
int cblocks = Math.round((float) cols / dimGran); |
148 |
|
|
149 |
|
int n = rblocks * cblocks; |
150 |
|
|