Repository: systemml Updated Branches: refs/heads/master 86f0e3f70 -> 7d936cf0c
[SYSTEMML-2077] Fix memory estimate second-order eval builtin function This patch fixes the memory estimate of the second-order eval builtin function, which is a simple function call and thus has no additional memory requirements. This is important for the use in parfor loops which determine the degree of parallelism and other aspects based on the memory estimates of body operations. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/153fd892 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/153fd892 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/153fd892 Branch: refs/heads/master Commit: 153fd8929a8cca42409015d23c3b081848b0356d Parents: 86f0e3f Author: Matthias Boehm <[email protected]> Authored: Fri Jun 1 21:19:42 2018 -0700 Committer: Matthias Boehm <[email protected]> Committed: Fri Jun 1 21:33:14 2018 -0700 ---------------------------------------------------------------------- src/main/java/org/apache/sysml/hops/NaryOp.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/153fd892/src/main/java/org/apache/sysml/hops/NaryOp.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/hops/NaryOp.java b/src/main/java/org/apache/sysml/hops/NaryOp.java index a08f86c..8927087 100644 --- a/src/main/java/org/apache/sysml/hops/NaryOp.java +++ b/src/main/java/org/apache/sysml/hops/NaryOp.java @@ -121,6 +121,19 @@ public class NaryOp extends Hop { } @Override + public void computeMemEstimate(MemoTable memo) { + //overwrites default hops behavior + super.computeMemEstimate(memo); + + //specific case for function call + if( _op == OpOpN.EVAL ) { + _memEstimate = OptimizerUtils.INT_SIZE; + _outputMemEstimate = OptimizerUtils.INT_SIZE; + _processingMemEstimate = 0; + } + } + + @Override protected double computeOutputMemEstimate(long dim1, long dim2, long nnz) { double sparsity = OptimizerUtils.getSparsity(dim1, dim2, nnz); return OptimizerUtils.estimateSizeExactSparsity(dim1, dim2, sparsity);
