[SYSTEMML-2485] Fix parfor optimizer robustness for non-existing vars

This patch fixes the robustness of the parfor optimizer to correctly
handling non-existing parent variables. The non-guaranteed existence of
these variables is due to their conditional creation.


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/c1917d84
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/c1917d84
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/c1917d84

Branch: refs/heads/master
Commit: c1917d84fc2691e9e1b6da983b9a9f950844a285
Parents: 5d67515
Author: Matthias Boehm <[email protected]>
Authored: Fri Aug 3 14:39:15 2018 -0700
Committer: Matthias Boehm <[email protected]>
Committed: Fri Aug 3 14:39:15 2018 -0700

----------------------------------------------------------------------
 .../sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/c1917d84/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
 
b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
index 9f6db11..e7c7a6e 100644
--- 
a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
+++ 
b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
@@ -418,6 +418,7 @@ public class OptimizerRuleBased extends Optimizer
                                if( dpf != PartitionFormat.NONE 
                                        && dpf._dpf != 
PDataPartitionFormat.BLOCK_WISE_M_N
                                        && (constrained || (mem > _lm/2 && mem 
> _rm/2))
+                                       && vars.get(c) != null //robustness 
non-existing vars
                                        && !vars.get(c).getDataType().isList() 
) {
                                        cand2.put( c, dpf );
                                }

Reply via email to