--- jsr166/src/test/loops/FJPhaserJacobi.java 2009/10/30 14:15:04 1.4 +++ jsr166/src/test/loops/FJPhaserJacobi.java 2014/12/18 18:14:25 1.11 @@ -1,14 +1,12 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ -// Barrier version of Jacobi iteration - import java.util.concurrent.*; -//import jsr166y.*; +/** Barrier version of Jacobi iteration */ public class FJPhaserJacobi { static int dimGran; @@ -26,11 +24,12 @@ public class FJPhaserJacobi { } catch (Exception e) { - System.out.println("Usage: java FJPhaserJacobi "); + System.out.println("Usage: java ThreadPhaserJacobi "); return; } ForkJoinPool fjp = new ForkJoinPool(); + // int granularity = (n * n / fjp.getParallelism()) / 2; int granularity = n * n / fjp.getParallelism(); dimGran = (int)(Math.sqrt(granularity)); @@ -143,8 +142,8 @@ public class FJPhaserJacobi { public void compute() { int rows = hiRow - loRow + 1; int cols = hiCol - loCol + 1; - int rblocks = (int)(Math.round((float)rows / dimGran)); - int cblocks = (int)(Math.round((float)cols / dimGran)); + int rblocks = Math.round((float)rows / dimGran); + int cblocks = Math.round((float)cols / dimGran); int n = rblocks * cblocks;