[MINOR] Cleanup unnecessary operators and instruction types

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

Branch: refs/heads/master
Commit: 17ccc097208304ff5ed93ea43915f497b03ab652
Parents: 0d85834
Author: Matthias Boehm <[email protected]>
Authored: Mon Mar 26 22:35:02 2018 -0700
Committer: Matthias Boehm <[email protected]>
Committed: Mon Mar 26 22:38:37 2018 -0700

----------------------------------------------------------------------
 .../sysml/runtime/instructions/Instruction.java | 17 ++++-------
 .../runtime/instructions/MRJobInstruction.java  | 22 +++++++-------
 .../instructions/cp/BreakPointInstruction.java  |  9 ++++--
 .../runtime/instructions/cp/CPInstruction.java  |  6 +++-
 .../instructions/cp/CtableCPInstruction.java    |  7 ++---
 .../cp/FrameIndexingCPInstruction.java          |  9 +++---
 .../instructions/cp/IndexingCPInstruction.java  | 18 ++++++------
 .../cp/MatrixIndexingCPInstruction.java         |  9 +++---
 .../cp/QuantileSortCPInstruction.java           | 14 ++++-----
 .../cpfile/MatrixIndexingCPFileInstruction.java |  8 ++----
 .../instructions/gpu/GPUInstruction.java        |  6 +++-
 .../gpu/MatrixIndexingGPUInstruction.java       |  6 ++--
 .../runtime/instructions/mr/MRInstruction.java  |  6 +++-
 .../instructions/mr/ZeroOutInstruction.java     |  8 ++----
 .../instructions/spark/CtableSPInstruction.java |  6 ++--
 .../spark/FrameIndexingSPInstruction.java       |  9 +++---
 .../spark/IndexingSPInstruction.java            | 20 ++++++-------
 .../spark/MatrixIndexingSPInstruction.java      |  9 +++---
 .../spark/QuantileSortSPInstruction.java        | 14 ++++-----
 .../instructions/spark/SPInstruction.java       |  6 +++-
 .../matrix/operators/ZeroOutOperator.java       | 30 --------------------
 .../ExternalFunctionInvocationInstruction.java  |  8 ++++--
 22 files changed, 107 insertions(+), 140 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/Instruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/Instruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/Instruction.java
index 11dfb99..b0ff996 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/Instruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/Instruction.java
@@ -49,7 +49,6 @@ public abstract class Instruction
        public static final String GPU_INST_PREFIX = "gpu_";
        
        //basic instruction meta data
-       protected IType type = null;
        protected String instString = null;
        protected String instOpcode = null;
        private String extendedOpcode = null;
@@ -81,14 +80,8 @@ public abstract class Instruction
        public int getEndColumn() {
                return endCol;
        }
-
-       public void setType (IType tp ) {
-               type = tp;
-       }
        
-       public IType getType() {
-               return type;
-       }
+       public abstract IType getType();
        
        public void setLocation(String filename, int beginLine, int endLine, 
int beginCol, int endCol) {
                this.filename = filename;
@@ -178,18 +171,18 @@ public abstract class Instruction
                                scriptInfo = " [" + filename + " " + beginLine 
+ ":" + beginCol + "-" + endLine + ":" + endCol + "]";
                        else
                                scriptInfo = " [" + beginLine + ":" + beginCol 
+ "-" + endLine + ":" + endCol + "]";
-                       if( type == IType.SPARK )
+                       if( getType() == IType.SPARK )
                                extendedOpcode = SP_INST_PREFIX + getOpcode() + 
scriptInfo;
-                       else if( type == IType.GPU )
+                       else if( getType() == IType.GPU )
                                extendedOpcode = GPU_INST_PREFIX + getOpcode() 
+ scriptInfo;
                        else
                                extendedOpcode = getOpcode() + scriptInfo;
                }
                else {
                        // This ensures that there is no overhead if 
finegrained statistics is disabled
-                       if( type == IType.SPARK )
+                       if( getType() == IType.SPARK )
                                extendedOpcode = SP_INST_PREFIX + getOpcode();
-                       else if( type == IType.GPU )
+                       else if( getType() == IType.GPU )
                                extendedOpcode = GPU_INST_PREFIX + getOpcode();
                        else
                                extendedOpcode = getOpcode();

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/MRJobInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/MRJobInstruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/MRJobInstruction.java
index b817b88..65e9d3a 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/MRJobInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/MRJobInstruction.java
@@ -125,10 +125,8 @@ public class MRJobInstruction extends Instruction
        // Indicates the data type of inputVars
        private DataType[] inputDataTypes;
 
-       public MRJobInstruction(JobType type)
-       {
-               setType(Instruction.IType.MAPREDUCE_JOB);
-               jobType = type; 
+       public MRJobInstruction(JobType type) {
+               jobType = type;
                instOpcode = "MR-Job_"+getJobType();
        }
        
@@ -143,7 +141,7 @@ public class MRJobInstruction extends Instruction
        public MRJobInstruction(MRJobInstruction that) 
                throws IllegalArgumentException, IllegalAccessException 
        {
-               this( that.jobType );
+               this(that.jobType);
                
                //copy basic variables
                _randInstructions         = that._randInstructions;
@@ -180,16 +178,18 @@ public class MRJobInstruction extends Instruction
                inputMatrices  = that.inputMatrices;
                outputMatrices = that.outputMatrices;
                inputDataTypes = that.inputDataTypes;
-
-       }       
+       }
        
-       public JobType getJobType()
-       {
+       @Override
+       public IType getType() {
+               return IType.MAPREDUCE_JOB;
+       }
+       
+       public JobType getJobType() {
                return jobType;
        }
 
-       public String getIv_instructionsInMapper()
-       {
+       public String getIv_instructionsInMapper() {
                return _mapperInstructions;
        }
        

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/BreakPointInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/BreakPointInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/BreakPointInstruction.java
index c5ac38d..8877b2a 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/BreakPointInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/BreakPointInstruction.java
@@ -42,8 +42,7 @@ public class BreakPointInstruction extends Instruction
         * Constructor for a breakpoint instruction
         */
        public BreakPointInstruction() {
-               type = IType.BREAKPOINT;
-               bpStatus = BPINSTRUCTION_STATUS.ENABLED;
+               this(BPINSTRUCTION_STATUS.ENABLED);
        }
 
        /**
@@ -52,9 +51,13 @@ public class BreakPointInstruction extends Instruction
         * @param status Breakpoint instruction status
         */
        public BreakPointInstruction(BPINSTRUCTION_STATUS status) {
-               type = IType.BREAKPOINT;
                bpStatus = status;
        }
+       
+       @Override
+       public IType getType() {
+               return IType.BREAKPOINT;
+       }
 
        /**
         * Setter for breakpoint instruction status

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java
index f8f6dc7..afad85f 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/CPInstruction.java
@@ -64,13 +64,17 @@ public abstract class CPInstruction extends Instruction
        protected CPInstruction(CPType type, Operator op, String opcode, String 
istr) {
                _cptype = type;
                _optr = op;
-               super.type = IType.CONTROL_PROGRAM;
                instString = istr;
 
                // prepare opcode and update requirement for repeated usage
                instOpcode = opcode;
                _requiresLabelUpdate = super.requiresLabelUpdate();
        }
+       
+       @Override
+       public IType getType() {
+               return IType.CONTROL_PROGRAM;
+       }
 
        public CPType getCPInstructionType() {
                return _cptype;

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/CtableCPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/CtableCPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/CtableCPInstruction.java
index 6811f99..50b9c92 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/CtableCPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/CtableCPInstruction.java
@@ -28,7 +28,6 @@ import org.apache.sysml.runtime.instructions.Instruction;
 import org.apache.sysml.runtime.instructions.InstructionUtils;
 import org.apache.sysml.runtime.matrix.data.CTableMap;
 import org.apache.sysml.runtime.matrix.data.MatrixBlock;
-import org.apache.sysml.runtime.matrix.operators.Operator;
 import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 import org.apache.sysml.runtime.util.DataConverter;
 import org.apache.sysml.runtime.util.LongLongDoubleHashMap.EntryType;
@@ -41,10 +40,10 @@ public class CtableCPInstruction extends 
ComputationCPInstruction {
        private final boolean _isExpand;
        private final boolean _ignoreZeros;
 
-       private CtableCPInstruction(Operator op, CPOperand in1, CPOperand in2, 
CPOperand in3, CPOperand out,
+       private CtableCPInstruction(CPOperand in1, CPOperand in2, CPOperand 
in3, CPOperand out,
                        String outputDim1, boolean dim1Literal, String 
outputDim2, boolean dim2Literal, boolean isExpand,
                        boolean ignoreZeros, String opcode, String istr) {
-               super(CPType.Ctable, op, in1, in2, in3, out, opcode, istr);
+               super(CPType.Ctable, null, in1, in2, in3, out, opcode, istr);
                _outDim1 = outputDim1;
                _dim1Literal = dim1Literal;
                _outDim2 = outputDim2;
@@ -79,7 +78,7 @@ public class CtableCPInstruction extends 
ComputationCPInstruction {
                boolean ignoreZeros = Boolean.parseBoolean(parts[7]);
                
                // ctable does not require any operator, so we simply pass-in a 
dummy operator with null functionobject
-               return new CtableCPInstruction(new SimpleOperator(null), in1, 
in2, in3, out, dim1Fields[0], Boolean.parseBoolean(dim1Fields[1]), 
dim2Fields[0], Boolean.parseBoolean(dim2Fields[1]), isExpand, ignoreZeros, 
opcode, inst);
+               return new CtableCPInstruction(in1, in2, in3, out, 
dim1Fields[0], Boolean.parseBoolean(dim1Fields[1]), dim2Fields[0], 
Boolean.parseBoolean(dim2Fields[1]), isExpand, ignoreZeros, opcode, inst);
        }
 
        private Ctable.OperationTypes findCtableOperation() {

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java
index 7cd8848..bda2951 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/FrameIndexingCPInstruction.java
@@ -25,19 +25,18 @@ import org.apache.sysml.parser.Expression.DataType;
 import org.apache.sysml.runtime.DMLRuntimeException;
 import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
 import org.apache.sysml.runtime.matrix.data.FrameBlock;
-import org.apache.sysml.runtime.matrix.operators.Operator;
 import org.apache.sysml.runtime.util.IndexRange;
 
 public final class FrameIndexingCPInstruction extends IndexingCPInstruction {
 
-       protected FrameIndexingCPInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       protected FrameIndexingCPInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, String opcode, String 
istr) {
-               super(op, in, rl, ru, cl, cu, out, opcode, istr);
+               super(in, rl, ru, cl, cu, out, opcode, istr);
        }
 
-       protected FrameIndexingCPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl,
+       protected FrameIndexingCPInstruction(CPOperand lhsInput, CPOperand 
rhsInput, CPOperand rl,
                        CPOperand ru, CPOperand cl, CPOperand cu, CPOperand 
out, String opcode, String istr) {
-               super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
istr);
+               super(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr);
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
index 189631e..4413139 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
@@ -25,25 +25,23 @@ import org.apache.sysml.parser.Expression.DataType;
 import org.apache.sysml.runtime.DMLRuntimeException;
 import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
 import org.apache.sysml.runtime.instructions.InstructionUtils;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 import org.apache.sysml.runtime.util.IndexRange;
 
 public abstract class IndexingCPInstruction extends UnaryCPInstruction {
        protected final CPOperand rowLower, rowUpper, colLower, colUpper;
 
-       protected IndexingCPInstruction(Operator op, CPOperand in, CPOperand 
rl, CPOperand ru, CPOperand cl, CPOperand cu,
+       protected IndexingCPInstruction(CPOperand in, CPOperand rl, CPOperand 
ru, CPOperand cl, CPOperand cu,
                        CPOperand out, String opcode, String istr) {
-               super(CPType.MatrixIndexing, op, in, out, opcode, istr);
+               super(CPType.MatrixIndexing, null, in, out, opcode, istr);
                rowLower = rl;
                rowUpper = ru;
                colLower = cl;
                colUpper = cu;
        }
 
-       protected IndexingCPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl, CPOperand ru,
+       protected IndexingCPInstruction(CPOperand lhsInput, CPOperand rhsInput, 
CPOperand rl, CPOperand ru,
                        CPOperand cl, CPOperand cu, CPOperand out, String 
opcode, String istr) {
-               super(CPType.MatrixIndexing, op, lhsInput, rhsInput, out, 
opcode, istr);
+               super(CPType.MatrixIndexing, null, lhsInput, rhsInput, out, 
opcode, istr);
                rowLower = rl;
                rowUpper = ru;
                colLower = cl;
@@ -72,9 +70,9 @@ public abstract class IndexingCPInstruction extends 
UnaryCPInstruction {
                                cu = new CPOperand(parts[5]);
                                out = new CPOperand(parts[6]);
                                if( in.getDataType()==DataType.MATRIX )
-                                       return new 
MatrixIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, 
opcode, str);
+                                       return new 
MatrixIndexingCPInstruction(in, rl, ru, cl, cu, out, opcode, str);
                                else if (in.getDataType() == DataType.FRAME)
-                                       return new 
FrameIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, 
opcode, str);
+                                       return new 
FrameIndexingCPInstruction(in, rl, ru, cl, cu, out, opcode, str);
                                else 
                                        throw new DMLRuntimeException("Can 
index only on Frames or Matrices");
                        }
@@ -93,9 +91,9 @@ public abstract class IndexingCPInstruction extends 
UnaryCPInstruction {
                                cu = new CPOperand(parts[6]);
                                out = new CPOperand(parts[7]);
                                if( lhsInput.getDataType()==DataType.MATRIX )
-                                       return new 
MatrixIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, 
ru, cl, cu, out, opcode, str);
+                                       return new 
MatrixIndexingCPInstruction(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
str);
                                else if (lhsInput.getDataType() == 
DataType.FRAME)
-                                       return new 
FrameIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, 
ru, cl, cu, out, opcode, str);
+                                       return new 
FrameIndexingCPInstruction(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
str);
                                else 
                                        throw new DMLRuntimeException("Can 
index only on Frames or Matrices");
                        }

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java
index 10a10d5..51cc4c1 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/MatrixIndexingCPInstruction.java
@@ -29,20 +29,19 @@ import 
org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
 import org.apache.sysml.runtime.controlprogram.caching.MatrixObject.UpdateType;
 import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
 import org.apache.sysml.runtime.matrix.data.MatrixBlock;
-import org.apache.sysml.runtime.matrix.operators.Operator;
 import org.apache.sysml.runtime.util.IndexRange;
 import org.apache.sysml.utils.Statistics;
 
 public final class MatrixIndexingCPInstruction extends IndexingCPInstruction {
 
-       protected MatrixIndexingCPInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       protected MatrixIndexingCPInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, String opcode, String 
istr) {
-               super(op, in, rl, ru, cl, cu, out, opcode, istr);
+               super(in, rl, ru, cl, cu, out, opcode, istr);
        }
 
-       protected MatrixIndexingCPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl,
+       protected MatrixIndexingCPInstruction(CPOperand lhsInput, CPOperand 
rhsInput, CPOperand rl,
                        CPOperand ru, CPOperand cl, CPOperand cu, CPOperand 
out, String opcode, String istr) {
-               super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
istr);
+               super(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr);
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java
index bf7e3e4..4b7421f 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cp/QuantileSortCPInstruction.java
@@ -26,8 +26,6 @@ import org.apache.sysml.runtime.DMLRuntimeException;
 import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
 import org.apache.sysml.runtime.instructions.InstructionUtils;
 import org.apache.sysml.runtime.matrix.data.MatrixBlock;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 
 /**
  * This class supports two variants of sort operation on a 1-dimensional input 
matrix. 
@@ -39,13 +37,13 @@ import 
org.apache.sysml.runtime.matrix.operators.SimpleOperator;
  */
 public class QuantileSortCPInstruction extends UnaryCPInstruction {
 
-       private QuantileSortCPInstruction(Operator op, CPOperand in, CPOperand 
out, String opcode, String istr) {
-               this(op, in, null, out, opcode, istr);
+       private QuantileSortCPInstruction(CPOperand in, CPOperand out, String 
opcode, String istr) {
+               this(in, null, out, opcode, istr);
        }
 
-       private QuantileSortCPInstruction(Operator op, CPOperand in1, CPOperand 
in2, CPOperand out, String opcode,
+       private QuantileSortCPInstruction(CPOperand in1, CPOperand in2, 
CPOperand out, String opcode,
                        String istr) {
-               super(CPType.QSort, op, in1, in2, out, opcode, istr);
+               super(CPType.QSort, null, in1, in2, out, opcode, istr);
        }
 
        public static QuantileSortCPInstruction parseInstruction ( String str ) 
{
@@ -60,13 +58,13 @@ public class QuantileSortCPInstruction extends 
UnaryCPInstruction {
                        if ( parts.length == 3 ) {
                                // Example: sort:mVar1:mVar2 (input=mVar1, 
output=mVar2)
                                parseUnaryInstruction(str, in1, out);
-                               return new QuantileSortCPInstruction(new 
SimpleOperator(null), in1, out, opcode, str);
+                               return new QuantileSortCPInstruction(in1, out, 
opcode, str);
                        }
                        else if ( parts.length == 4 ) {
                                // Example: sort:mVar1:mVar2:mVar3 
(input=mVar1, weights=mVar2, output=mVar3)
                                in2 = new CPOperand("", ValueType.UNKNOWN, 
DataType.UNKNOWN);
                                parseUnaryInstruction(str, in1, in2, out);
-                               return new QuantileSortCPInstruction(new 
SimpleOperator(null), in1, in2, out, opcode, str);
+                               return new QuantileSortCPInstruction(in1, in2, 
out, opcode, str);
                        }
                        else {
                                throw new DMLRuntimeException("Invalid number 
of operands in instruction: " + str);

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/cpfile/MatrixIndexingCPFileInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/cpfile/MatrixIndexingCPFileInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/cpfile/MatrixIndexingCPFileInstruction.java
index 4503553..88a0624 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/cpfile/MatrixIndexingCPFileInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/cpfile/MatrixIndexingCPFileInstruction.java
@@ -30,8 +30,6 @@ import 
org.apache.sysml.runtime.instructions.cp.IndexingCPInstruction;
 import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
 import org.apache.sysml.runtime.matrix.MetaDataFormat;
 import org.apache.sysml.runtime.matrix.data.MatrixBlock;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 import org.apache.sysml.runtime.util.IndexRange;
 import org.apache.sysml.runtime.util.MapReduceTool;
 
@@ -45,9 +43,9 @@ import org.apache.sysml.runtime.util.MapReduceTool;
  */
 public final class MatrixIndexingCPFileInstruction extends 
IndexingCPInstruction {
 
-       private MatrixIndexingCPFileInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       private MatrixIndexingCPFileInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, String opcode, String 
istr) {
-               super(op, in, rl, ru, cl, cu, out, opcode, istr);
+               super(in, rl, ru, cl, cu, out, opcode, istr);
        }
 
        public static MatrixIndexingCPFileInstruction parseInstruction ( String 
str ) {
@@ -63,7 +61,7 @@ public final class MatrixIndexingCPFileInstruction extends 
IndexingCPInstruction
                                cl = new CPOperand(parts[4]);
                                cu = new CPOperand(parts[5]);
                                out = new CPOperand(parts[6]);
-                               return new MatrixIndexingCPFileInstruction(new 
SimpleOperator(null), in, rl, ru, cl, cu, out, opcode, str);
+                               return new MatrixIndexingCPFileInstruction(in, 
rl, ru, cl, cu, out, opcode, str);
                        }
                        else {
                                throw new DMLRuntimeException("Invalid number 
of operands in instruction: " + str);

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
index 722b564..1a9e632 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
@@ -151,7 +151,6 @@ public abstract class GPUInstruction extends Instruction {
        protected boolean _requiresLabelUpdate = false;
 
        private GPUInstruction(String opcode, String istr) {
-               type = IType.GPU;
                instString = istr;
 
                // prepare opcode and update requirement for repeated usage
@@ -163,6 +162,11 @@ public abstract class GPUInstruction extends Instruction {
                this(opcode, istr);
                _optr = op;
        }
+       
+       @Override
+       public IType getType() {
+               return IType.GPU;
+       }
 
        public GPUINSTRUCTION_TYPE getGPUInstructionType() {
                return _gputype;

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/gpu/MatrixIndexingGPUInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/gpu/MatrixIndexingGPUInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/gpu/MatrixIndexingGPUInstruction.java
index 9ea91a5..6e1ac2c 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/gpu/MatrixIndexingGPUInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/gpu/MatrixIndexingGPUInstruction.java
@@ -38,9 +38,9 @@ public class MatrixIndexingGPUInstruction extends 
GPUInstruction {
        CPOperand input2;
        CPOperand output;
 
-       private MatrixIndexingGPUInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       private MatrixIndexingGPUInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, String opcode, String 
istr) {
-               super(op, opcode, istr);
+               super(null, opcode, istr);
                _gputype = GPUINSTRUCTION_TYPE.MatrixIndexing;
                rowLower = rl;
                rowUpper = ru;
@@ -77,7 +77,7 @@ public class MatrixIndexingGPUInstruction extends 
GPUInstruction {
                                cu = new CPOperand(parts[5]);
                                out = new CPOperand(parts[6]);
                                if( in.getDataType()==DataType.MATRIX )
-                                       return new 
MatrixIndexingGPUInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, 
opcode, str);
+                                       return new 
MatrixIndexingGPUInstruction(in, rl, ru, cl, cu, out, opcode, str);
                                else 
                                        throw new DMLRuntimeException("Can 
index only on Matrices in GPU");
                        }

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
index 41f29b3..7be7cd2 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
@@ -41,11 +41,15 @@ public abstract class MRInstruction extends Instruction {
        public byte output;
 
        protected MRInstruction(MRType type, Operator op, byte out) {
-               super.type = IType.MAPREDUCE;
                optr = op;
                output = out;
                mrtype = type;
        }
+       
+       @Override
+       public IType getType() {
+               return IType.MAPREDUCE;
+       }
 
        public Operator getOperator() {
                return optr;

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/mr/ZeroOutInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/mr/ZeroOutInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/mr/ZeroOutInstruction.java
index 47fca64..a821c5d 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/mr/ZeroOutInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/mr/ZeroOutInstruction.java
@@ -27,8 +27,6 @@ import org.apache.sysml.runtime.matrix.data.MatrixValue;
 import org.apache.sysml.runtime.matrix.data.OperationsOnMatrixValues;
 import org.apache.sysml.runtime.matrix.mapred.CachedValueMap;
 import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.ZeroOutOperator;
 import org.apache.sysml.runtime.util.IndexRange;
 import org.apache.sysml.runtime.util.UtilFunctions;
 
@@ -41,8 +39,8 @@ public class ZeroOutInstruction extends 
UnaryMRInstructionBase {
        private IndexRange tempRange = new IndexRange(-1, -1, -1, -1);
        public boolean complementary = false;
 
-       private ZeroOutInstruction(Operator op, byte in, byte out, IndexRange 
rng, String istr) {
-               super(MRType.ZeroOut, op, in, out);
+       private ZeroOutInstruction(byte in, byte out, IndexRange rng, String 
istr) {
+               super(MRType.ZeroOut, null, in, out);
                instString = istr;
                indexRange = rng;
        }
@@ -59,7 +57,7 @@ public class ZeroOutInstruction extends 
UnaryMRInstructionBase {
                                UtilFunctions.parseToLong(parts[4]), 
                                UtilFunctions.parseToLong(parts[5]));
                byte out = Byte.parseByte(parts[6]);
-               return new ZeroOutInstruction(new ZeroOutOperator(), in, out, 
rng, str);
+               return new ZeroOutInstruction(in, out, rng, str);
        }
        
        @Override

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/CtableSPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/CtableSPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/CtableSPInstruction.java
index 8cb156c..bf2cc91 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/CtableSPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/CtableSPInstruction.java
@@ -61,10 +61,10 @@ public class CtableSPInstruction extends 
ComputationSPInstruction {
        private boolean _isExpand;
        private boolean _ignoreZeros;
 
-       private CtableSPInstruction(Operator op, CPOperand in1, CPOperand in2, 
CPOperand in3, CPOperand out,
+       private CtableSPInstruction(CPOperand in1, CPOperand in2, CPOperand 
in3, CPOperand out,
                        String outputDim1, boolean dim1Literal, String 
outputDim2, boolean dim2Literal, boolean isExpand,
                        boolean ignoreZeros, String opcode, String istr) {
-               super(SPType.Ctable, op, in1, in2, in3, out, opcode, istr);
+               super(SPType.Ctable, null, in1, in2, in3, out, opcode, istr);
                _outDim1 = outputDim1;
                _dim1Literal = dim1Literal;
                _outDim2 = outputDim2;
@@ -98,7 +98,7 @@ public class CtableSPInstruction extends 
ComputationSPInstruction {
                boolean ignoreZeros = Boolean.parseBoolean(parts[7]);
                
                // ctable does not require any operator, so we simply pass-in a 
dummy operator with null functionobject
-               return new CtableSPInstruction(new SimpleOperator(null), in1, 
in2, in3, out, dim1Fields[0], Boolean.parseBoolean(dim1Fields[1]), 
dim2Fields[0], Boolean.parseBoolean(dim2Fields[1]), isExpand, ignoreZeros, 
opcode, inst);
+               return new CtableSPInstruction(in1, in2, in3, out, 
dim1Fields[0], Boolean.parseBoolean(dim1Fields[1]), dim2Fields[0], 
Boolean.parseBoolean(dim2Fields[1]), isExpand, ignoreZeros, opcode, inst);
        }
 
 

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/FrameIndexingSPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/FrameIndexingSPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/FrameIndexingSPInstruction.java
index f2c20a3..f74f293 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/FrameIndexingSPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/FrameIndexingSPInstruction.java
@@ -45,7 +45,6 @@ import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
 import org.apache.sysml.runtime.matrix.data.FrameBlock;
 import org.apache.sysml.runtime.matrix.data.OperationsOnMatrixValues;
 import org.apache.sysml.runtime.matrix.data.Pair;
-import org.apache.sysml.runtime.matrix.operators.Operator;
 import org.apache.sysml.runtime.util.IndexRange;
 import org.apache.sysml.runtime.util.UtilFunctions;
 
@@ -55,14 +54,14 @@ import org.apache.sysml.runtime.util.UtilFunctions;
  */
 public class FrameIndexingSPInstruction extends IndexingSPInstruction {
 
-       protected FrameIndexingSPInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       protected FrameIndexingSPInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, SparkAggType aggtype, 
String opcode, String istr) {
-               super(op, in, rl, ru, cl, cu, out, aggtype, opcode, istr);
+               super(in, rl, ru, cl, cu, out, aggtype, opcode, istr);
        }
 
-       protected FrameIndexingSPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl,
+       protected FrameIndexingSPInstruction(CPOperand lhsInput, CPOperand 
rhsInput, CPOperand rl,
                        CPOperand ru, CPOperand cl, CPOperand cu, CPOperand 
out, String opcode, String istr) {
-               super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
istr);
+               super(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr);
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/IndexingSPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/IndexingSPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/IndexingSPInstruction.java
index f31a989..6f053d9 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/IndexingSPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/IndexingSPInstruction.java
@@ -27,19 +27,17 @@ import org.apache.sysml.parser.Expression.DataType;
 import org.apache.sysml.runtime.DMLRuntimeException;
 import org.apache.sysml.runtime.instructions.InstructionUtils;
 import org.apache.sysml.runtime.instructions.cp.CPOperand;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 
 /**
- * This class implements the matrix indexing functionality inside Spark.  
+ * This class implements the matrix indexing functionality inside Spark.
  */
 public abstract class IndexingSPInstruction extends UnarySPInstruction {
        protected CPOperand rowLower, rowUpper, colLower, colUpper;
        protected SparkAggType _aggType = null;
 
-       protected IndexingSPInstruction(Operator op, CPOperand in, CPOperand 
rl, CPOperand ru, CPOperand cl, CPOperand cu,
+       protected IndexingSPInstruction(CPOperand in, CPOperand rl, CPOperand 
ru, CPOperand cl, CPOperand cu,
                        CPOperand out, SparkAggType aggtype, String opcode, 
String istr) {
-               super(SPType.MatrixIndexing, op, in, out, opcode, istr);
+               super(SPType.MatrixIndexing, null, in, out, opcode, istr);
                rowLower = rl;
                rowUpper = ru;
                colLower = cl;
@@ -47,9 +45,9 @@ public abstract class IndexingSPInstruction extends 
UnarySPInstruction {
                _aggType = aggtype;
        }
 
-       protected IndexingSPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl, CPOperand ru, CPOperand cl,
+       protected IndexingSPInstruction(CPOperand lhsInput, CPOperand rhsInput, 
CPOperand rl, CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, String opcode, String 
istr) {
-               super(SPType.MatrixIndexing, op, lhsInput, rhsInput, out, 
opcode, istr);
+               super(SPType.MatrixIndexing, null, lhsInput, rhsInput, out, 
opcode, istr);
                rowLower = rl;
                rowUpper = ru;
                colLower = cl;
@@ -70,9 +68,9 @@ public abstract class IndexingSPInstruction extends 
UnarySPInstruction {
                                CPOperand out = new CPOperand(parts[6]);
                                SparkAggType aggtype = 
SparkAggType.valueOf(parts[7]);
                                if( in.getDataType()==DataType.MATRIX )
-                                       return new 
MatrixIndexingSPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, 
aggtype, opcode, str);
+                                       return new 
MatrixIndexingSPInstruction(in, rl, ru, cl, cu, out, aggtype, opcode, str);
                                else
-                                       return new 
FrameIndexingSPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, 
aggtype, opcode, str);
+                                       return new 
FrameIndexingSPInstruction(in, rl, ru, cl, cu, out, aggtype, opcode, str);
                        }
                        else {
                                throw new DMLRuntimeException("Invalid number 
of operands in instruction: " + str);
@@ -89,9 +87,9 @@ public abstract class IndexingSPInstruction extends 
UnarySPInstruction {
                                CPOperand out = new CPOperand(parts[7]);
                                LixCacheType lixtype = 
LixCacheType.valueOf(parts[8]);
                                if( lhsInput.getDataType()==DataType.MATRIX )
-                                       return new 
MatrixIndexingSPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, 
ru, cl, cu, out, lixtype, opcode, str);
+                                       return new 
MatrixIndexingSPInstruction(lhsInput, rhsInput, rl, ru, cl, cu, out, lixtype, 
opcode, str);
                                else
-                                       return new 
FrameIndexingSPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, 
ru, cl, cu, out, opcode, str);
+                                       return new 
FrameIndexingSPInstruction(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
str);
                        }
                        else {
                                throw new DMLRuntimeException("Invalid number 
of operands in instruction: " + str);

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/MatrixIndexingSPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/MatrixIndexingSPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/MatrixIndexingSPInstruction.java
index a26a6f1..d30f330 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/MatrixIndexingSPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/MatrixIndexingSPInstruction.java
@@ -56,7 +56,6 @@ import org.apache.sysml.runtime.matrix.data.MatrixBlock;
 import org.apache.sysml.runtime.matrix.data.MatrixIndexes;
 import org.apache.sysml.runtime.matrix.data.OperationsOnMatrixValues;
 import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue;
-import org.apache.sysml.runtime.matrix.operators.Operator;
 import org.apache.sysml.runtime.util.IndexRange;
 import org.apache.sysml.runtime.util.UtilFunctions;
 
@@ -66,15 +65,15 @@ import org.apache.sysml.runtime.util.UtilFunctions;
 public class MatrixIndexingSPInstruction extends IndexingSPInstruction {
        private final LixCacheType _type;
 
-       protected MatrixIndexingSPInstruction(Operator op, CPOperand in, 
CPOperand rl, CPOperand ru, CPOperand cl,
+       protected MatrixIndexingSPInstruction(CPOperand in, CPOperand rl, 
CPOperand ru, CPOperand cl,
                        CPOperand cu, CPOperand out, SparkAggType aggtype, 
String opcode, String istr) {
-               super(op, in, rl, ru, cl, cu, out, aggtype, opcode, istr);
+               super(in, rl, ru, cl, cu, out, aggtype, opcode, istr);
                _type = LixCacheType.NONE;
        }
 
-       protected MatrixIndexingSPInstruction(Operator op, CPOperand lhsInput, 
CPOperand rhsInput, CPOperand rl,
+       protected MatrixIndexingSPInstruction(CPOperand lhsInput, CPOperand 
rhsInput, CPOperand rl,
                        CPOperand ru, CPOperand cl, CPOperand cu, CPOperand 
out, LixCacheType type, String opcode, String istr) {
-               super(op, lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, 
istr);
+               super(lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, istr);
                _type = type;
        }
 

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/QuantileSortSPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/QuantileSortSPInstruction.java
 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/QuantileSortSPInstruction.java
index 313d79c..80c884d 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/QuantileSortSPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/QuantileSortSPInstruction.java
@@ -33,8 +33,6 @@ import 
org.apache.sysml.runtime.instructions.spark.utils.RDDSortUtils;
 import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
 import org.apache.sysml.runtime.matrix.data.MatrixBlock;
 import org.apache.sysml.runtime.matrix.data.MatrixIndexes;
-import org.apache.sysml.runtime.matrix.operators.Operator;
-import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
 
 /**
  * This class supports two variants of sort operation on a 1-dimensional input 
matrix. 
@@ -46,13 +44,13 @@ import 
org.apache.sysml.runtime.matrix.operators.SimpleOperator;
  */
 public class QuantileSortSPInstruction extends UnarySPInstruction {
 
-       private QuantileSortSPInstruction(Operator op, CPOperand in, CPOperand 
out, String opcode, String istr) {
-               this(op, in, null, out, opcode, istr);
+       private QuantileSortSPInstruction(CPOperand in, CPOperand out, String 
opcode, String istr) {
+               this(in, null, out, opcode, istr);
        }
 
-       private QuantileSortSPInstruction(Operator op, CPOperand in1, CPOperand 
in2, CPOperand out, String opcode,
+       private QuantileSortSPInstruction(CPOperand in1, CPOperand in2, 
CPOperand out, String opcode,
                        String istr) {
-               super(SPType.QSort, op, in1, in2, out, opcode, istr);
+               super(SPType.QSort, null, in1, in2, out, opcode, istr);
        }
 
        public static QuantileSortSPInstruction parseInstruction ( String str ) 
{
@@ -67,13 +65,13 @@ public class QuantileSortSPInstruction extends 
UnarySPInstruction {
                        if ( parts.length == 3 ) {
                                // Example: sort:mVar1:mVar2 (input=mVar1, 
output=mVar2)
                                parseUnaryInstruction(str, in1, out);
-                               return new QuantileSortSPInstruction(new 
SimpleOperator(null), in1, out, opcode, str);
+                               return new QuantileSortSPInstruction(in1, out, 
opcode, str);
                        }
                        else if ( parts.length == 4 ) {
                                // Example: sort:mVar1:mVar2:mVar3 
(input=mVar1, weights=mVar2, output=mVar3)
                                in2 = new CPOperand("", ValueType.UNKNOWN, 
DataType.UNKNOWN);
                                parseUnaryInstruction(str, in1, in2, out);
-                               return new QuantileSortSPInstruction(new 
SimpleOperator(null), in1, in2, out, opcode, str);
+                               return new QuantileSortSPInstruction(in1, in2, 
out, opcode, str);
                        }
                        else {
                                throw new DMLRuntimeException("Invalid number 
of operands in instruction: " + str);

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
index cae232e..69d6a72 100644
--- 
a/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
+++ 
b/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
@@ -50,13 +50,17 @@ public abstract class SPInstruction extends Instruction {
        protected SPInstruction(SPType type, Operator op, String opcode, String 
istr) {
                _sptype = type;
                _optr = op;
-               super.type = IType.SPARK;
                instString = istr;
 
                // prepare opcode and update requirement for repeated usage
                instOpcode = opcode;
                _requiresLabelUpdate = super.requiresLabelUpdate();
        }
+       
+       @Override
+       public IType getType() {
+               return IType.SPARK;
+       }
 
        public SPType getSPInstructionType() {
                return _sptype;

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/runtime/matrix/operators/ZeroOutOperator.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/runtime/matrix/operators/ZeroOutOperator.java 
b/src/main/java/org/apache/sysml/runtime/matrix/operators/ZeroOutOperator.java
deleted file mode 100644
index 109c293..0000000
--- 
a/src/main/java/org/apache/sysml/runtime/matrix/operators/ZeroOutOperator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.sysml.runtime.matrix.operators;
-
-public class ZeroOutOperator extends Operator 
-{
-       private static final long serialVersionUID = 8991309598821495444L;
-       
-       public ZeroOutOperator() {
-               super(true);
-       }
-}

http://git-wip-us.apache.org/repos/asf/systemml/blob/17ccc097/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java 
b/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
index 0c21982..c4e4198 100644
--- 
a/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
+++ 
b/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
@@ -43,9 +43,6 @@ import org.apache.sysml.udf.Scalar.ScalarValueType;
 
 /**
  * Class to maintain external function invocation instructions.
- * 
- * 
- * 
  */
 public class ExternalFunctionInvocationInstruction extends Instruction 
 {
@@ -65,6 +62,11 @@ public class ExternalFunctionInvocationInstruction extends 
Instruction
                this.baseDir = baseDir;
                this.iinfo = format;
        }
+       
+       @Override
+       public IType getType() {
+               return IType.CONTROL_PROGRAM;
+       }
 
        @Override
        public void processInstruction(ExecutionContext ec) {

Reply via email to