File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
src/main/java/org/apache/sysds/runtime/matrix/data Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -1417,13 +1417,10 @@ else if( !sparse && denseBlock!=null ) //DENSE
14171417 * @return the number of non zeros
14181418 */
14191419 public long recomputeNonZeros (int k ) {
1420- if (k <= 1 )
1421- return recomputeNonZeros ();
1422- if (sparse && sparseBlock !=null )
1420+ // fallback to single thread if k <= 1, small matrix, or sparse.
1421+ if (k <= 1 || ((long ) rlen * clen < 10000 ) || (sparse && sparseBlock !=null ))
14231422 return recomputeNonZeros ();
14241423 else if (!sparse && denseBlock !=null ){
1425- if ((long ) rlen * clen < 10000 )
1426- return recomputeNonZeros ();
14271424 final ExecutorService pool = CommonThreadPool .get (k );
14281425 try {
14291426 List <Future <Long >> f = new ArrayList <>();
You can’t perform that action at this time.
0 commit comments