Skip to content

Commit 64ce453

Browse files
committed
[skip ci] revert maptofactory
1 parent e2afaa9 commit 64ce453

File tree

1 file changed

+13
-22
lines changed

1 file changed

+13
-22
lines changed

src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToFactory.java

+13-22
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,21 @@ public static AMapToData create(int unique, IntArrayList values) {
7575
return _data;
7676
}
7777

78-
public static AMapToData create(int size, int[] values, int nUnique, int k) {
78+
public static AMapToData create(int size, int[] values, int nUnique, int k) throws Exception {
79+
AMapToData _data = create(size, nUnique);
7980
final ExecutorService pool = CommonThreadPool.get(k);
80-
try{
81-
82-
AMapToData _data = create(size, nUnique);
83-
int blk = Math.max((values.length / k), 1024);
84-
blk -= blk % 64; // ensure long size
85-
List<Future<?>> tasks = new ArrayList<>();
86-
for(int i = 0; i < values.length; i += blk) {
87-
int start = i;
88-
int end = Math.min(i + blk, values.length);
89-
tasks.add(pool.submit(() -> _data.copyInt(values, start, end)));
90-
}
91-
92-
for(Future<?> t : tasks)
93-
t.get();
94-
return _data;
95-
}
96-
catch(Exception e){
97-
throw new RuntimeException();
98-
}
99-
finally{
100-
pool.shutdown();
81+
int blk = Math.max((values.length / k), 1024);
82+
blk -= blk % 64; // ensure long size
83+
List<Future<?>> tasks = new ArrayList<>();
84+
for(int i = 0; i < values.length; i += blk) {
85+
int start = i;
86+
int end = Math.min(i + blk, values.length);
87+
tasks.add(pool.submit(() -> _data.copyInt(values, start, end)));
10188
}
89+
90+
for(Future<?> t : tasks)
91+
t.get();
92+
return _data;
10293
}
10394

10495
/**

0 commit comments

Comments
 (0)