ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/FJPhaserJacobi.java
(Generate patch)

Comparing jsr166/src/test/loops/FJPhaserJacobi.java (file contents):
Revision 1.2 by jsr166, Thu Oct 29 23:09:07 2009 UTC vs.
Revision 1.6 by jsr166, Tue Nov 3 01:04:02 2009 UTC

# Line 1 | Line 1
1 + /*
2 + * Written by Doug Lea with assistance from members of JCP JSR-166
3 + * Expert Group and released to the public domain, as explained at
4 + * http://creativecommons.org/licenses/publicdomain
5 + */
6 +
7   // Barrier version of Jacobi iteration
8  
9   import java.util.concurrent.*;
# Line 20 | Line 26 | public class FJPhaserJacobi {
26          }
27  
28          catch (Exception e) {
29 <            System.out.println("Usage: java ThreadPhaserJacobi <matrix size> <max steps>");
29 >            System.out.println("Usage: java FJPhaserJacobi <matrix size> <max steps>");
30              return;
31          }
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;
# Line 53 | Line 59 | public class FJPhaserJacobi {
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);
# Line 137 | Line 143 | public class FJPhaserJacobi {
143          public void compute() {
144              int rows = hiRow - loRow + 1;
145              int cols = hiCol - loCol + 1;
146 <            int rblocks = (int)(Math.round((float)rows / dimGran));
147 <            int cblocks = (int)(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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines