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

Comparing jsr166/src/test/loops/CCJacobi.java (file contents):
Revision 1.5 by jsr166, Mon Aug 10 03:13:33 2015 UTC vs.
Revision 1.6 by dl, Sat Sep 12 18:15:47 2015 UTC

# Line 38 | Line 38 | public class CCJacobi {
38              return;
39          }
40  
41 <        ForkJoinPool fjp = new ForkJoinPool();
41 >        ForkJoinPool fjp = ForkJoinPool.commonPool();
42  
43          // allocate enough space for edges
44          int dim = n+2;
# Line 67 | Line 67 | public class CCJacobi {
67              Driver driver = new Driver(a, b, 1, n, 1, n, steps, granularity);
68  
69              long startTime = System.currentTimeMillis();
70 <            fjp.invoke(driver);
70 >            driver.invoke();
71  
72              long time = System.currentTimeMillis() - startTime;
73              double secs = ((double)time) / 1000.0;
74  
75              System.out.println("Compute Time: " + secs);
76              System.out.println(fjp);
77 +            System.gc();
78          }
79      }
80  
# Line 109 | Line 110 | public class CCJacobi {
110              double[][] b = AtoB ? B : A;
111  
112              double md = 0.0; // local for computing max diff
112
113              for (int i = loRow; i <= hiRow; ++i) {
114                  for (int j = loCol; j <= hiCol; ++j) {
115                      double v = 0.25 * (a[i-1][j] + a[i][j-1] +
116                                         a[i+1][j] + a[i][j+1]);
117                      b[i][j] = v;
118 <
119 <                    double diff = v - a[i][j];
118 >                    double prev = a[i][j];
119 >                    double diff = v - prev;
120                      if (diff < 0) diff = -diff;
121                      if (diff > md) md = diff;
122                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines