Repository: incubator-systemml Updated Branches: refs/heads/master e69a1c261 -> e21d12e54
[SYSTEMML-576] Checkpoint fails for empty matrix object Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/e21d12e5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/e21d12e5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/e21d12e5 Branch: refs/heads/master Commit: e21d12e54f91e69325222d7e4427c8ecffd9361b Parents: e69a1c2 Author: Arvind Surve <ac...@yahoo.com> Authored: Mon Mar 14 15:36:24 2016 -0700 Committer: Arvind Surve <ac...@yahoo.com> Committed: Mon Mar 14 15:36:24 2016 -0700 ---------------------------------------------------------------------- .../sysml/runtime/instructions/spark/CheckpointSPInstruction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/e21d12e5/src/main/java/org/apache/sysml/runtime/instructions/spark/CheckpointSPInstruction.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/CheckpointSPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/CheckpointSPInstruction.java index ee25052..87b8a0c 100644 --- a/src/main/java/org/apache/sysml/runtime/instructions/spark/CheckpointSPInstruction.java +++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/CheckpointSPInstruction.java @@ -79,9 +79,10 @@ public class CheckpointSPInstruction extends UnarySPInstruction // (checkpoints are generated for all read only variables in loops; due to unbounded scoping and // conditional control flow they to not necessarily exist in the symbol table during runtime - // this is valid if relevant branches are never entered) - if( sec.getVariable( input1.getName() ) == null ) { + if( sec.getVariable( input1.getName() ) == null || sec.getVariable( input1.getName() ) instanceof BooleanObject) { //add a dummy entry to the input, which will be immediately overwritten by the null output. sec.setVariable( input1.getName(), new BooleanObject(false)); + sec.setVariable( output.getName(), new BooleanObject(false)); return; }