68 |
|
long now = System.nanoTime(); |
69 |
|
double total = (double)(now - start) / NPS; |
70 |
|
double elapsed = (double)(now - last) / NPS; |
71 |
< |
System.out.printf("Arrays.sort time: %7.3f total %9.3f\n", |
71 |
> |
System.out.printf("Arrays.sort time: %7.3f total %9.3f\n", |
72 |
|
elapsed, total); |
73 |
|
if (i == 0) |
74 |
|
checkSorted(a); |
90 |
|
// pool.invoke(new TaskChecker()); |
91 |
|
double total = (double)(now - start) / NPS; |
92 |
|
double elapsed = (double)(now - last) / NPS; |
93 |
< |
System.out.printf("Parallel sort time: %7.3f total %9.3f\n", |
93 |
> |
System.out.printf("Parallel sort time: %7.3f total %9.3f\n", |
94 |
|
elapsed, total); |
95 |
|
if (i == 0) |
96 |
|
checkSorted(a); |
165 |
|
* and finding index of right closest to split point. |
166 |
|
* Uses left-spine decomposition to generate all |
167 |
|
* merge tasks before bottomming out at base case. |
168 |
– |
* |
168 |
|
*/ |
169 |
|
public final void compute() { |
170 |
|
Merger rights = null; |
201 |
|
Long al = a[l], ar; |
202 |
|
if (r >= rFence || |
203 |
|
al.longValue() <= (ar = a[r]).longValue()) { |
204 |
< |
++l; t = al; |
205 |
< |
} |
206 |
< |
else { |
207 |
< |
++r; t = ar; |
204 |
> |
++l; t = al; |
205 |
> |
} |
206 |
> |
else { |
207 |
> |
++r; t = ar; |
208 |
|
} |
209 |
|
} |
210 |
|
else if (r < rFence) |
211 |
|
t = a[r++]; |
212 |
< |
else |
212 |
> |
else |
213 |
|
break; |
214 |
|
w[k++] = t; |
215 |
|
} |
294 |
|
final Long[] src; |
295 |
|
final Long[] dst; |
296 |
|
final int lo, hi, size; |
297 |
< |
RandomRepacker(Long[] src, Long[] dst, |
297 |
> |
RandomRepacker(Long[] src, Long[] dst, |
298 |
|
int lo, int hi, int size) { |
299 |
|
this.src = src; this.dst = dst; |
300 |
|
this.lo = lo; this.hi = hi; this.size = size; |
301 |
|
} |
302 |
< |
|
302 |
> |
|
303 |
|
public final void compute() { |
304 |
|
Long[] s = src; |
305 |
|
Long[] d = dst; |