http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java index 8e9a681..80b76c5 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixBlock.java @@ -40,7 +40,6 @@ import org.apache.sysml.lops.MMTSJ.MMTSJType; import org.apache.sysml.lops.MapMultChain.ChainType; import org.apache.sysml.lops.PartialAggregate.CorrectionLocationType; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.controlprogram.caching.CacheBlock; import org.apache.sysml.runtime.functionobjects.Builtin; import org.apache.sysml.runtime.functionobjects.CM; @@ -2793,7 +2792,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab */ @Override public MatrixValue scalarOperations(ScalarOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock ret = checkType(result); @@ -2819,7 +2818,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab */ @Override public MatrixValue unaryOperations(UnaryOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock ret = checkType(result); @@ -2863,11 +2862,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab /** * * @param op - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ private void sparseUnaryOperations(UnaryOperator op, MatrixBlock ret) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //early abort possible since sparse-safe if( isEmptyBlock(false) ) @@ -2915,11 +2913,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * * @param op * @param ret - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ private void denseUnaryOperations(UnaryOperator op, MatrixBlock ret) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //prepare 0-value init (determine if unnecessarily sparse-unsafe) double val0 = op.fn.execute(0); @@ -2944,12 +2941,11 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab /** * * @param op - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ @Override public void unaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { if(op.sparseSafe) sparseUnaryOperationsInPlace(op); @@ -2961,11 +2957,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * only apply to non zero cells * * @param op - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ private void sparseUnaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //early abort possible since sparse-safe if( isEmptyBlock(false) ) @@ -3014,7 +3009,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab } private void denseUnaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { if( sparse ) //SPARSE MATRIX { @@ -3057,7 +3052,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * */ public MatrixValue binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock that = checkType(thatValue); MatrixBlock ret = checkType(result); @@ -3089,7 +3084,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * */ public void binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock that=checkType(thatValue); if( !LibMatrixBincell.isValidDimensionsBinary(this, that) ) { @@ -3112,7 +3107,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab public void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, MatrixValue newWithCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //assert(aggOp.correctionExists); MatrixBlock cor=checkType(correction); @@ -3355,7 +3350,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab } public void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //assert(aggOp.correctionExists); MatrixBlock newWithCor=checkType(newWithCorrection); @@ -3656,11 +3651,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param that * @param ret * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public MatrixBlock appendOperations( MatrixBlock that, MatrixBlock ret ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //default append-cbind return appendOperations(that, ret, true); @@ -3671,11 +3665,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param that * @param ret * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public MatrixBlock appendOperations( MatrixBlock that, MatrixBlock ret, boolean cbind ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock result = checkType( ret ); final int m = cbind ? rlen : rlen+that.rlen; @@ -3727,10 +3720,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param tstype * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock transposeSelfMatrixMultOperations( MatrixBlock out, MMTSJType tstype ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { return transposeSelfMatrixMultOperations(out, tstype, 1); } @@ -3741,10 +3733,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param tstype * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock transposeSelfMatrixMultOperations( MatrixBlock out, MMTSJType tstype, int k ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { //check for transpose type if( !(tstype == MMTSJType.LEFT || tstype == MMTSJType.RIGHT) ) @@ -3777,10 +3768,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param ctype * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock chainMatrixMultOperations( MatrixBlock v, MatrixBlock w, MatrixBlock out, ChainType ctype ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { return chainMatrixMultOperations(v, w, out, ctype, 1); } @@ -3793,10 +3783,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param ctype * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock chainMatrixMultOperations( MatrixBlock v, MatrixBlock w, MatrixBlock out, ChainType ctype, int k ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { //check for transpose type if( !(ctype == ChainType.XtXv || ctype == ChainType.XtwXv || ctype == ChainType.XtXvy) ) @@ -3832,10 +3821,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param out1Val * @param out2Val * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public void permutationMatrixMultOperations( MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { permutationMatrixMultOperations(m2Val, out1Val, out2Val, 1); } @@ -3847,10 +3835,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param out1Val * @param out2Val * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public void permutationMatrixMultOperations( MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val, int k ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { //check input types and dimensions MatrixBlock m2 = checkType(m2Val); @@ -3876,10 +3863,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param inplace * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock leftIndexingOperations(MatrixBlock rhsMatrix, IndexRange ixrange, MatrixBlock ret, boolean inplace) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { return leftIndexingOperations( rhsMatrix, (int)ixrange.rowStart, (int)ixrange.rowEnd, @@ -3895,11 +3881,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * 2) result[rowLower:rowUpper, colLower:colUpper] = rhsMatrix; * * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock leftIndexingOperations(MatrixBlock rhsMatrix, int rl, int ru, int cl, int cu, MatrixBlock ret, boolean inplace) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { // Check the validity of bounds if ( rl < 0 || rl >= getNumRows() || ru < rl || ru >= getNumRows() @@ -3977,10 +3962,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param ret * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock leftIndexingOperations(ScalarObject scalar, int rl, int cl, MatrixBlock ret, boolean inplace) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { double inVal = scalar.getDoubleValue(); boolean sp = estimateSparsityOnLeftIndexing(rlen, clen, nonZeros, 1, 1, (inVal!=0)?1:0); @@ -4018,7 +4002,6 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * Extracted submatrix is returned as "result". Note: This operation is now 0-based. * * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock sliceOperations(int rl, int ru, int cl, int cu, MatrixBlock ret) throws DMLRuntimeException @@ -4274,7 +4257,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab public void appendOperations(MatrixValue v2, ArrayList<IndexedMatrixValue> outlist, int blockRowFactor, int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock m2 = (MatrixBlock)v2; @@ -4318,7 +4301,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * */ public MatrixValue zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { checkType(result); double currentSparsity=(double)nonZeros/(double)rlen/(double)clen; @@ -4427,7 +4410,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int blockingFactorRow, int blockingFactorCol, MatrixIndexes indexesIn) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { return aggregateUnaryOperations(op, result, blockingFactorRow, blockingFactorCol, indexesIn, false); @@ -4436,7 +4419,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int blockingFactorRow, int blockingFactorCol, MatrixIndexes indexesIn, boolean inCP) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { CellIndex tempCellIndex = new CellIndex(-1,-1); op.indexFn.computeDimension(rlen, clen, tempCellIndex); @@ -4920,7 +4903,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab return covobj; } - public MatrixValue sortOperations(MatrixValue weights, MatrixValue result) throws DMLRuntimeException, DMLUnsupportedOperationException { + public MatrixValue sortOperations(MatrixValue weights, MatrixValue result) throws DMLRuntimeException { boolean wtflag = (weights!=null); MatrixBlock wts= (weights == null ? null : checkType(weights)); @@ -5074,7 +5057,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab } public MatrixValue pickValues(MatrixValue quantiles, MatrixValue ret) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { MatrixBlock qs=checkType(quantiles); @@ -5177,12 +5160,11 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param result * @param op * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public MatrixValue aggregateBinaryOperations(MatrixIndexes m1Index, MatrixValue m1Value, MatrixIndexes m2Index, MatrixValue m2Value, MatrixValue result, AggregateBinaryOperator op ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { return aggregateBinaryOperations(m1Value, m2Value, result, op); } @@ -5191,7 +5173,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * */ public MatrixValue aggregateBinaryOperations(MatrixValue m1Value, MatrixValue m2Value, MatrixValue result, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //check input types, dimensions, configuration MatrixBlock m1 = checkType(m1Value); @@ -5231,11 +5213,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param m3 * @param op * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public ScalarObject aggregateTernaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock m3, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //check input dimensions and operators if( m1.rlen!=m2.rlen || m1.clen!=m2.clen || (m3!=null && (m2.rlen!=m3.rlen || m2.clen!=m3.clen)) ) @@ -5263,11 +5244,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param bOp * @oaram uaggOp * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public MatrixBlock uaggouterchainOperations(MatrixBlock mbLeft, MatrixBlock mbRight, MatrixBlock mbOut, BinaryOperator bOp, AggregateUnaryOperator uaggOp) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { double bv[] = DataConverter.convertToDoubleVector(mbRight); int bvi[] = null; @@ -5313,10 +5293,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param op * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts, MatrixValue ret, int ngroups, Operator op) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { //single-threaded grouped aggregate return groupedAggOperations(tgt, wghts, ret, ngroups, op, 1); @@ -5332,10 +5311,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param k * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts, MatrixValue ret, int ngroups, Operator op, int k) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { //setup input matrices MatrixBlock target = checkType(tgt); @@ -5396,10 +5374,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param select * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock removeEmptyOperations( MatrixBlock ret, boolean rows, MatrixBlock select ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { MatrixBlock result = checkType(ret); return LibMatrixReorg.rmempty(this, result, rows, select); @@ -5411,10 +5388,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param rows * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock removeEmptyOperations( MatrixBlock ret, boolean rows) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { return removeEmptyOperations(ret, rows, null); } @@ -5428,10 +5404,9 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param ignore * @return * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ public MatrixBlock rexpandOperations( MatrixBlock ret, double max, boolean rows, boolean cast, boolean ignore ) - throws DMLRuntimeException, DMLUnsupportedOperationException + throws DMLRuntimeException { MatrixBlock result = checkType(ret); return LibMatrixReorg.rexpand(this, result, max, rows, cast, ignore); @@ -5440,7 +5415,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab @Override public MatrixValue replaceOperations(MatrixValue result, double pattern, double replacement) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock ret = checkType(result); examSparsity(); //ensure its in the right format @@ -5535,12 +5510,11 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * (v2) from sclar_input2 (scalarThat) * (i3,j3,w) from input3 (that2) * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ @Override public void ternaryOperations(Operator op, double scalarThat, MatrixValue that2Val, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock that2 = checkType(that2Val); CTable ctable = CTable.getCTableFnObject(); @@ -5580,7 +5554,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab @Override public void ternaryOperations(Operator op, double scalarThat, double scalarThat2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { CTable ctable = CTable.getCTableFnObject(); double v2 = scalarThat; @@ -5616,7 +5590,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab @Override public void ternaryOperations(Operator op, MatrixIndexes ix1, double scalarThat, boolean left, int brlen, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { CTable ctable = CTable.getCTableFnObject(); double w = scalarThat; @@ -5663,7 +5637,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab @Override public void ternaryOperations(Operator op, MatrixValue thatVal, double scalarThat2, boolean ignoreZeros, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //setup ctable computation MatrixBlock that = checkType(thatVal); @@ -5733,7 +5707,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * (w) from scalar_input3 (scalarThat2) */ public void ternaryOperations(Operator op, MatrixValue thatMatrix, double thatScalar, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock that = checkType(thatMatrix); CTable ctable = CTable.getCTableFnObject(); @@ -5763,14 +5737,14 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * (i1,j1,w) from input3 (that2) */ public void ternaryOperations(Operator op, MatrixValue thatVal, MatrixValue that2Val, CTableMap resultMap) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { ternaryOperations(op, thatVal, that2Val, resultMap, null); } @Override public void ternaryOperations(Operator op, MatrixValue thatVal, MatrixValue that2Val, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixBlock that = checkType(thatVal); MatrixBlock that2 = checkType(that2Val); @@ -5805,7 +5779,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab @Override public MatrixValue quaternaryOperations(QuaternaryOperator qop, MatrixValue um, MatrixValue vm, MatrixValue wm, MatrixValue out) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { return quaternaryOperations(qop, um, vm, wm, out, 1); } @@ -5820,11 +5794,10 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab * @param wt * @param k * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public MatrixValue quaternaryOperations(QuaternaryOperator qop, MatrixValue um, MatrixValue vm, MatrixValue wm, MatrixValue out, int k) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //check input dimensions if( getNumRows() != um.getNumRows() )
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixCell.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixCell.java b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixCell.java index 4da2e1b..92794aa 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixCell.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixCell.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import org.apache.hadoop.io.WritableComparable; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.functionobjects.CTable; import org.apache.sysml.runtime.functionobjects.ReduceDiag; import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue; @@ -70,10 +69,10 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria value=v; } - private static MatrixCell checkType(MatrixValue cell) throws DMLUnsupportedOperationException + private static MatrixCell checkType(MatrixValue cell) throws DMLRuntimeException { if( cell!=null && !(cell instanceof MatrixCell)) - throw new DMLUnsupportedOperationException("the Matrix Value is not MatrixCell!"); + throw new DMLRuntimeException("the Matrix Value is not MatrixCell!"); return (MatrixCell) cell; } @@ -172,7 +171,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public MatrixValue aggregateBinaryOperations(MatrixValue value1, MatrixValue value2, MatrixValue result, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { MatrixCell c1=checkType(value1); MatrixCell c2=checkType(value2); @@ -186,7 +185,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int brlen, int bclen, - MatrixIndexes indexesIn) throws DMLUnsupportedOperationException { + MatrixIndexes indexesIn) throws DMLRuntimeException { MatrixCell c3=checkType(result); if(c3==null) @@ -207,7 +206,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public MatrixValue binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { MatrixCell c2=checkType(thatValue); MatrixCell c3=checkType(result); if(c3==null) @@ -219,22 +218,20 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { MatrixCell c2=checkType(thatValue); setValue(op.fn.execute(this.getValue(), c2.getValue())); } public void denseScalarOperationsInPlace(ScalarOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.executeScalar(value); } @Override public MatrixValue reorgOperations(ReorgOperator op, MatrixValue result, - int startRow, int startColumn, int length) - throws DMLUnsupportedOperationException { - + int startRow, int startColumn, int length) throws DMLRuntimeException { MatrixCell c3=checkType(result); if(c3==null) c3=new MatrixCell(); @@ -243,7 +240,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria } @Override - public MatrixValue scalarOperations(ScalarOperator op, MatrixValue result) throws DMLUnsupportedOperationException, DMLRuntimeException { + public MatrixValue scalarOperations(ScalarOperator op, MatrixValue result) throws DMLRuntimeException { MatrixCell c3=checkType(result); c3.setValue(op.fn.execute(value, op.getConstant())); @@ -251,18 +248,18 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria } public void sparseScalarOperationsInPlace(ScalarOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.executeScalar(value); } public void sparseUnaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.fn.execute(value); } @Override public MatrixValue unaryOperations(UnaryOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { MatrixCell c3=checkType(result); c3.setValue(op.fn.execute(value)); return c3; @@ -270,7 +267,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void unaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.fn.execute(value); } @@ -320,13 +317,13 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, MatrixValue newWithCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { throw new DMLRuntimeException("MatrixCell.incrementalAggregate should never be called"); } @Override public MatrixValue zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { if(range.rowStart!=0 || range.rowEnd!=0 || range.colStart!=0 || range.colEnd!=0) throw new DMLRuntimeException("wrong range: "+range+" for matrixCell"); MatrixCell c3=checkType(result); @@ -337,14 +334,14 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { throw new DMLRuntimeException("MatrixCell.incrementalAggregate should never be called"); } @Override public void ternaryOperations(Operator op, MatrixValue that, MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixCell c2=checkType(that); MatrixCell c3=checkType(that2); @@ -358,7 +355,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void ternaryOperations(Operator op, MatrixValue that, double scalarThat2, boolean ignoreZeros, CTableMap ctableResult, MatrixBlock ctableResultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixCell c2=checkType(that); CTable ctable = CTable.getCTableFnObject(); @@ -371,7 +368,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void ternaryOperations(Operator op, double scalarThat, double scalarThat2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { CTable ctable = CTable.getCTableFnObject(); if ( resultMap != null) @@ -383,7 +380,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void ternaryOperations(Operator op, MatrixIndexes ix1, double scalarThat, boolean left, int brlen, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //ctable expand (column vector to ctable) CTable ctable = CTable.getCTableFnObject(); @@ -404,7 +401,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public void ternaryOperations(Operator op, double scalarThat, MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixCell c3=checkType(that2); CTable ctable = CTable.getCTableFnObject(); @@ -417,7 +414,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria @Override public MatrixValue quaternaryOperations(QuaternaryOperator qop, MatrixValue um, MatrixValue vm, MatrixValue wm, MatrixValue out) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { throw new DMLRuntimeException("operation not supported fro MatrixCell"); } @@ -426,14 +423,14 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria public void sliceOperations(ArrayList<IndexedMatrixValue> outlist, IndexRange range, int rowCut, int colCut, int blockRowFactor, int blockColFactor, int boundaryRlen, int boundaryClen) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { ((MatrixCell)outlist.get(0).getValue()).setValue(this.value); } @Override public MatrixValue replaceOperations(MatrixValue result, double pattern, double replacement) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixCell out = checkType(result); if( value == pattern || (Double.isNaN(pattern) && Double.isNaN(value)) ) @@ -447,7 +444,7 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int blockingFactorRow, int blockingFactorCol, MatrixIndexes indexesIn, boolean inCP) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { return aggregateUnaryOperations(op, result, blockingFactorRow, blockingFactorCol,indexesIn); } @@ -455,14 +452,14 @@ public class MatrixCell extends MatrixValue implements WritableComparable, Seria public MatrixValue aggregateBinaryOperations(MatrixIndexes m1Index, MatrixValue m1Value, MatrixIndexes m2Index, MatrixValue m2Value, MatrixValue result, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { throw new DMLRuntimeException("MatrixCell.aggregateBinaryOperations should never be called"); } @Override public void appendOperations(MatrixValue valueIn2, ArrayList<IndexedMatrixValue> outlist, int blockRowFactor, int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { ((MatrixCell)outlist.get(0).getValue()).setValue(this.value); MatrixCell c2=checkType(valueIn2); ((MatrixCell)outlist.get(1).getValue()).setValue(c2.getValue()); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixPackedCell.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixPackedCell.java b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixPackedCell.java index 7ccedcf..e606922 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixPackedCell.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixPackedCell.java @@ -26,7 +26,6 @@ import java.io.IOException; import org.apache.sysml.lops.PartialAggregate.CorrectionLocationType; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.cp.KahanObject; import org.apache.sysml.runtime.matrix.operators.AggregateOperator; @@ -64,10 +63,10 @@ public class MatrixPackedCell extends MatrixCell extra_size=size; } - public static MatrixPackedCell checkType(MatrixValue cell) throws DMLUnsupportedOperationException + public static MatrixPackedCell checkType(MatrixValue cell) throws DMLRuntimeException { if( cell!=null && !(cell instanceof MatrixPackedCell)) - throw new DMLUnsupportedOperationException("the Matrix Value is not MatrixPackedCell!"); + throw new DMLRuntimeException("the Matrix Value is not MatrixPackedCell!"); return (MatrixPackedCell) cell; } @@ -82,14 +81,14 @@ public class MatrixPackedCell extends MatrixCell //with corrections @Override public void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, - MatrixValue newWithCorrection)throws DMLUnsupportedOperationException, DMLRuntimeException { + MatrixValue newWithCorrection)throws DMLRuntimeException { incrementalAggregate(aggOp, newWithCorrection); } //with corrections @Override public void incrementalAggregate(AggregateOperator aggOp, - MatrixValue newWithCorrection)throws DMLUnsupportedOperationException, DMLRuntimeException { + MatrixValue newWithCorrection)throws DMLRuntimeException { MatrixPackedCell newWithCor=checkType(newWithCorrection); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixValue.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixValue.java b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixValue.java index c4918f9..dd8fd17 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixValue.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/MatrixValue.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import org.apache.hadoop.io.WritableComparable; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue; import org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator; import org.apache.sysml.runtime.matrix.operators.AggregateOperator; @@ -109,78 +108,78 @@ public abstract class MatrixValue implements WritableComparable public abstract void copy(MatrixValue that, boolean sp); public abstract MatrixValue scalarOperations(ScalarOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract void binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue reorgOperations(ReorgOperator op, MatrixValue result, int startRow, int startColumn, int length) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; // tertiary where all three inputs are matrices public abstract void ternaryOperations(Operator op, MatrixValue that, MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; // tertiary where first two inputs are matrices, and third input is a scalar (double) public abstract void ternaryOperations(Operator op, MatrixValue that, double scalar_that2, boolean ignoreZeros, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; // tertiary where first input is a matrix, and second and third inputs are scalars (double) public abstract void ternaryOperations(Operator op, double scalar_that, double scalar_that2, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; // tertiary where first input is a matrix, and second and third inputs are scalars (double) public abstract void ternaryOperations(Operator op, MatrixIndexes ix1, double scalar_that, boolean left, int brlen, CTableMap resultMap, MatrixBlock resultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; // tertiary where first and third inputs are matrices and second is a scalar public abstract void ternaryOperations(Operator op, double scalarThat, MatrixValue that2, CTableMap ctableResult, MatrixBlock ctableResultBlock) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue quaternaryOperations(QuaternaryOperator qop, MatrixValue um, MatrixValue vm, MatrixValue wm, MatrixValue out) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, - int brlen, int bclen, MatrixIndexes indexesIn) throws DMLUnsupportedOperationException, DMLRuntimeException; + int brlen, int bclen, MatrixIndexes indexesIn) throws DMLRuntimeException; public abstract MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int blockingFactorRow, int blockingFactorCol, MatrixIndexes indexesIn, boolean inCP) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue aggregateBinaryOperations(MatrixValue m1Value, MatrixValue m2Value, MatrixValue result, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue aggregateBinaryOperations(MatrixIndexes m1Index, MatrixValue m1Value, MatrixIndexes m2Index, MatrixValue m2Value, MatrixValue result, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue unaryOperations(UnaryOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; - public abstract void unaryOperationsInPlace(UnaryOperator op) throws DMLUnsupportedOperationException, DMLRuntimeException; + public abstract void unaryOperationsInPlace(UnaryOperator op) throws DMLRuntimeException; public abstract void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, - MatrixValue newWithCorrection) throws DMLUnsupportedOperationException, DMLRuntimeException; + MatrixValue newWithCorrection) throws DMLRuntimeException; public abstract void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract void sliceOperations(ArrayList<IndexedMatrixValue> outlist, IndexRange range, int rowCut, int colCut, int blockRowFactor, int blockColFactor, int boundaryRlen, int boundaryClen) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract MatrixValue replaceOperations( MatrixValue result, double pattern, double replacement ) - throws DMLUnsupportedOperationException, DMLRuntimeException; + throws DMLRuntimeException; public abstract void appendOperations(MatrixValue valueIn2, ArrayList<IndexedMatrixValue> outlist, int blockRowFactor, int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol) - throws DMLUnsupportedOperationException, DMLRuntimeException ; + throws DMLRuntimeException ; } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java b/src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java index 9201795..4fe2834 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/OperationsOnMatrixValues.java @@ -23,7 +23,6 @@ package org.apache.sysml.runtime.matrix.data; import java.util.ArrayList; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.functionobjects.Builtin; import org.apache.sysml.lops.PartialAggregate.CorrectionLocationType; import org.apache.sysml.runtime.matrix.mapred.IndexedMatrixValue; @@ -43,26 +42,26 @@ public class OperationsOnMatrixValues { public static void performScalarIgnoreIndexes(MatrixValue valueIn, MatrixValue valueOut, ScalarOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { valueIn.scalarOperations(op, valueOut); } public static void performUnaryIgnoreIndexes(MatrixValue valueIn, MatrixValue valueOut, UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { valueIn.unaryOperations(op, valueOut); } public static void performUnaryIgnoreIndexesInPlace(MatrixValue valueIn, UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { valueIn.unaryOperationsInPlace(op); } public static void performReorg(MatrixIndexes indexesIn, MatrixValue valueIn, MatrixIndexes indexesOut, MatrixValue valueOut, ReorgOperator op, int startRow, int startColumn, int length) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operate on the value indexes first op.fn.execute(indexesIn, indexesOut); @@ -73,14 +72,14 @@ public class OperationsOnMatrixValues public static void performAppend(MatrixValue valueIn1, MatrixValue valueIn2, ArrayList<IndexedMatrixValue> outlist, int blockRowFactor, int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { valueIn1.appendOperations(valueIn2, outlist, blockRowFactor, blockColFactor, cbind, m2IsLast, nextNCol); } public static void performZeroOut(MatrixIndexes indexesIn, MatrixValue valueIn, MatrixIndexes indexesOut, MatrixValue valueOut, IndexRange range, boolean complementary) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { valueIn.zeroOutOperations(valueOut, range, complementary); indexesOut.setIndexes(indexesIn); @@ -90,7 +89,7 @@ public class OperationsOnMatrixValues // tertiary where all three inputs are matrices public static void performTernary(MatrixIndexes indexesIn1, MatrixValue valueIn1, MatrixIndexes indexesIn2, MatrixValue valueIn2, MatrixIndexes indexesIn3, MatrixValue valueIn3, CTableMap resultMap, MatrixBlock resultBlock, Operator op ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operation on the cells inside the value valueIn1.ternaryOperations(op, valueIn2, valueIn3, resultMap, resultBlock); @@ -99,7 +98,7 @@ public class OperationsOnMatrixValues // tertiary where first two inputs are matrices, and third input is a scalar (double) public static void performTernary(MatrixIndexes indexesIn1, MatrixValue valueIn1, MatrixIndexes indexesIn2, MatrixValue valueIn2, double scalarIn3, CTableMap resultMap, MatrixBlock resultBlock, Operator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operation on the cells inside the value valueIn1.ternaryOperations(op, valueIn2, scalarIn3, false, resultMap, resultBlock); @@ -108,7 +107,7 @@ public class OperationsOnMatrixValues // tertiary where first input is a matrix, and second and third inputs are scalars (double) public static void performTernary(MatrixIndexes indexesIn1, MatrixValue valueIn1, double scalarIn2, double scalarIn3, CTableMap resultMap, MatrixBlock resultBlock, Operator op ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operation on the cells inside the value valueIn1.ternaryOperations(op, scalarIn2, scalarIn3, resultMap, resultBlock); @@ -117,7 +116,7 @@ public class OperationsOnMatrixValues // tertiary where first input is a matrix, and second is scalars (double) public static void performTernary(MatrixIndexes indexesIn1, MatrixValue valueIn1, double scalarIn2, boolean left, int brlen, CTableMap resultMap, MatrixBlock resultBlock, Operator op ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operation on the cells inside the value valueIn1.ternaryOperations(op, indexesIn1, scalarIn2, left, brlen, resultMap, resultBlock); @@ -126,7 +125,7 @@ public class OperationsOnMatrixValues // tertiary where first and third inputs are matrices, and second is a scalars (double) public static void performTernary(MatrixIndexes indexesIn1, MatrixValue valueIn1, double scalarIn2, MatrixIndexes indexesIn3, MatrixValue valueIn3, CTableMap resultMap, MatrixBlock resultBlock, Operator op ) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operation on the cells inside the value valueIn1.ternaryOperations(op, scalarIn2, valueIn3, resultMap, resultBlock); @@ -136,7 +135,7 @@ public class OperationsOnMatrixValues //binary operations are those that the indexes of both cells have to be matched public static void performBinaryIgnoreIndexes(MatrixValue value1, MatrixValue value2, MatrixValue valueOut, BinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { value1.binaryOperations(op, value2, valueOut); } @@ -150,12 +149,11 @@ public class OperationsOnMatrixValues * @param clen * @param sparseHint * @param imbededCorrection - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public static void startAggregation(MatrixValue valueOut, MatrixValue correction, AggregateOperator op, int rlen, int clen, boolean sparseHint, boolean imbededCorrection) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { int outRow=0, outCol=0, corRow=0, corCol=0; if(op.correctionExists) @@ -249,7 +247,7 @@ public class OperationsOnMatrixValues } public static void incrementalAggregation(MatrixValue valueAgg, MatrixValue correction, MatrixValue valueAdd, - AggregateOperator op, boolean imbededCorrection) throws DMLUnsupportedOperationException, DMLRuntimeException + AggregateOperator op, boolean imbededCorrection) throws DMLRuntimeException { if(op.correctionExists) { @@ -264,7 +262,7 @@ public class OperationsOnMatrixValues public static void performAggregateUnary(MatrixIndexes indexesIn, MatrixValue valueIn, MatrixIndexes indexesOut, MatrixValue valueOut, AggregateUnaryOperator op,int brlen, int bclen) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //operate on the value indexes first op.indexFn.execute(indexesIn, indexesOut); @@ -275,7 +273,7 @@ public class OperationsOnMatrixValues public static void performAggregateBinary(MatrixIndexes indexes1, MatrixValue value1, MatrixIndexes indexes2, MatrixValue value2, MatrixIndexes indexesOut, MatrixValue valueOut, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //compute output index indexesOut.setIndexes(indexes1.getRowIndex(), indexes2.getColumnIndex()); @@ -287,7 +285,7 @@ public class OperationsOnMatrixValues public static void performAggregateBinaryIgnoreIndexes( MatrixValue value1, MatrixValue value2, MatrixValue valueOut, AggregateBinaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { //perform on the value value1.aggregateBinaryOperations(value1, value2, valueOut, op); @@ -300,11 +298,10 @@ public class OperationsOnMatrixValues * @param brlen * @param bclen * @param outlist - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public static void performSlice(IndexedMatrixValue in, IndexRange ixrange, int brlen, int bclen, ArrayList<IndexedMatrixValue> outlist) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { long cellIndexTopRow = UtilFunctions.computeCellIndex(in.getIndexes().getRowIndex(), brlen, 0); long cellIndexBottomRow = UtilFunctions.computeCellIndex(in.getIndexes().getRowIndex(), brlen, in.getValue().getNumRows()-1); @@ -373,11 +370,10 @@ public class OperationsOnMatrixValues * @param rlen * @param clen * @param outlist - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public static void performShift(IndexedMatrixValue in, IndexRange ixrange, int brlen, int bclen, long rlen, long clen, ArrayList<IndexedMatrixValue> outlist) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { MatrixIndexes ix = in.getIndexes(); MatrixBlock mb = (MatrixBlock)in.getValue(); @@ -435,9 +431,8 @@ public class OperationsOnMatrixValues * @param bclen * @param outlist * @throws DMLRuntimeException - * @throws DMLUnsupportedOperationException */ - public static void performMapGroupedAggregate( Operator op, IndexedMatrixValue inTarget, MatrixBlock groups, int ngroups, int brlen, int bclen, ArrayList<IndexedMatrixValue> outlist ) throws DMLRuntimeException, DMLUnsupportedOperationException + public static void performMapGroupedAggregate( Operator op, IndexedMatrixValue inTarget, MatrixBlock groups, int ngroups, int brlen, int bclen, ArrayList<IndexedMatrixValue> outlist ) throws DMLRuntimeException { MatrixIndexes ix = inTarget.getIndexes(); MatrixBlock target = (MatrixBlock)inTarget.getValue(); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedCell.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedCell.java b/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedCell.java index ded012c..dac0170 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedCell.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedCell.java @@ -25,7 +25,6 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator; import org.apache.sysml.runtime.matrix.operators.ReorgOperator; import org.apache.sysml.runtime.matrix.operators.ScalarOperator; @@ -57,17 +56,17 @@ public class WeightedCell extends MatrixCell } private static WeightedCell checkType(MatrixValue cell) - throws DMLUnsupportedOperationException + throws DMLRuntimeException { if( cell!=null && !(cell instanceof WeightedCell)) - throw new DMLUnsupportedOperationException("the Matrix Value is not WeightedCell!"); + throw new DMLRuntimeException("the Matrix Value is not WeightedCell!"); return (WeightedCell) cell; } public void copy(MatrixValue that){ WeightedCell c2; try { c2 = checkType(that); - } catch (DMLUnsupportedOperationException e) { + } catch (DMLRuntimeException e) { throw new RuntimeException(e); } value=c2.getValue(); @@ -121,7 +120,7 @@ public class WeightedCell extends MatrixCell @Override public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result, int brlen, int bclen, - MatrixIndexes indexesIn) throws DMLUnsupportedOperationException { + MatrixIndexes indexesIn) throws DMLRuntimeException { super.aggregateUnaryOperations(op, result, brlen, bclen, indexesIn); WeightedCell c3=checkType(result); c3.setWeight(weight); @@ -130,14 +129,14 @@ public class WeightedCell extends MatrixCell //TODO: how to handle -minus left vs. minus right public void denseScalarOperationsInPlace(ScalarOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.executeScalar(value); } @Override public MatrixValue reorgOperations(ReorgOperator op, MatrixValue result, int startRow, int startColumn, int length) - throws DMLUnsupportedOperationException { + throws DMLRuntimeException { super.reorgOperations(op, result, startRow, startColumn, length); WeightedCell c3=checkType(result); c3.setWeight(weight); @@ -146,7 +145,7 @@ public class WeightedCell extends MatrixCell @Override public MatrixValue scalarOperations(ScalarOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { WeightedCell c3=checkType(result); c3.setValue(op.fn.execute(value, op.getConstant())); @@ -155,18 +154,18 @@ public class WeightedCell extends MatrixCell } public void sparseScalarOperationsInPlace(ScalarOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.executeScalar(value); } public void sparseUnaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.fn.execute(value); } @Override public MatrixValue unaryOperations(UnaryOperator op, MatrixValue result) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { WeightedCell c3=checkType(result); c3.setValue(op.fn.execute(value)); c3.setWeight(weight); @@ -175,7 +174,7 @@ public class WeightedCell extends MatrixCell @Override public void unaryOperationsInPlace(UnaryOperator op) - throws DMLUnsupportedOperationException, DMLRuntimeException { + throws DMLRuntimeException { value=op.fn.execute(value); } } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedPair.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedPair.java b/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedPair.java index f830360..c9a6292 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedPair.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/WeightedPair.java @@ -24,8 +24,7 @@ import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; - +import org.apache.sysml.runtime.DMLRuntimeException; public class WeightedPair extends WeightedCell { @@ -52,17 +51,17 @@ public class WeightedPair extends WeightedCell out.writeDouble(weight); } - private static WeightedPair checkType(MatrixValue cell) throws DMLUnsupportedOperationException + private static WeightedPair checkType(MatrixValue cell) throws DMLRuntimeException { if( cell!=null && !(cell instanceof WeightedPair)) - throw new DMLUnsupportedOperationException("the Matrix Value is not WeightedPair!"); + throw new DMLRuntimeException("the Matrix Value is not WeightedPair!"); return (WeightedPair) cell; } public void copy(MatrixValue that){ WeightedPair c2; try { c2 = checkType(that); - } catch (DMLUnsupportedOperationException e) { + } catch (DMLRuntimeException e) { throw new RuntimeException(e); } value=c2.getValue(); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDMapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDMapper.java index 06b15e0..91caca8 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDMapper.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDMapper.java @@ -34,7 +34,6 @@ import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; import org.apache.wink.json4j.JSONException; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.CSVReblockInstruction; import org.apache.sysml.runtime.matrix.CSVReblockMR; import org.apache.sysml.runtime.matrix.CSVReblockMR.OffsetCount; @@ -122,12 +121,10 @@ public class CSVAssignRowIDMapper extends MapReduceBase implements Mapper<LongWr break; } } - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } - + // load properties relevant to transform try { boolean omit = job.getBoolean(MRJobConfiguration.TF_TRANSFORM, false); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVReblockReducer.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVReblockReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVReblockReducer.java index f512104..c0dadbd 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVReblockReducer.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVReblockReducer.java @@ -29,7 +29,6 @@ import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.CSVReblockInstruction; import org.apache.sysml.runtime.instructions.mr.ReblockInstruction; import org.apache.sysml.runtime.matrix.CSVReblockMR.BlockRow; @@ -115,8 +114,6 @@ public class CSVReblockReducer extends ReduceBase implements Reducer<TaggedFirst CSVReblockInstruction[] reblockInstructions; try { reblockInstructions = MRJobConfiguration.getCSVReblockInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRCombinerReducerBase.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRCombinerReducerBase.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRCombinerReducerBase.java index bc7e936..57440b3 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRCombinerReducerBase.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRCombinerReducerBase.java @@ -27,7 +27,6 @@ import java.util.Iterator; import org.apache.hadoop.mapred.JobConf; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.AggregateBinaryInstruction; import org.apache.sysml.runtime.instructions.mr.AggregateInstruction; import org.apache.sysml.runtime.matrix.MatrixCharacteristics; @@ -59,8 +58,6 @@ public class MMCJMRCombinerReducerBase extends ReduceBase AggregateBinaryInstruction[] ins; try { ins = MRJobConfiguration.getAggregateBinaryInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRMapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRMapper.java index 5d255d5..b9e9723 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRMapper.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRMapper.java @@ -30,7 +30,6 @@ import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.AggregateBinaryInstruction; import org.apache.sysml.runtime.matrix.MatrixCharacteristics; import org.apache.sysml.runtime.matrix.data.MatrixBlock; @@ -65,8 +64,6 @@ implements Mapper<Writable, Writable, Writable, Writable> AggregateBinaryInstruction[] ins; try { ins = MRJobConfiguration.getAggregateBinaryInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRReducer.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRReducer.java index f7adedb..a9b7d8b 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRReducer.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMCJMRReducer.java @@ -31,9 +31,8 @@ import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; - import org.apache.sysml.hops.OptimizerUtils; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; +import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.MatrixIndexes; import org.apache.sysml.runtime.matrix.data.MatrixValue; @@ -159,7 +158,7 @@ implements Reducer<TaggedFirstSecondIndexes, MatrixValue, Writable, Writable> try { OperationsOnMatrixValues.performAggregateBinaryIgnoreIndexes(left.value, right.value, valueBuffer, (AggregateBinaryOperator)aggBinInstruction.getOperator()); - } catch (DMLUnsupportedOperationException e) { + } catch (DMLRuntimeException e) { throw new IOException(e); } @@ -209,7 +208,7 @@ implements Reducer<TaggedFirstSecondIndexes, MatrixValue, Writable, Writable> { realWriteToCollector(indexes, value_out); } - } catch (DMLUnsupportedOperationException e) { + } catch (DMLRuntimeException e) { throw new IOException(e); } } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java index 1aee6fc..e83713c 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java @@ -32,7 +32,6 @@ import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.AggregateBinaryInstruction; import org.apache.sysml.runtime.matrix.MatrixCharacteristics; import org.apache.sysml.runtime.matrix.data.TaggedMatrixValue; @@ -117,8 +116,6 @@ implements Mapper<Writable, Writable, Writable, Writable> AggregateBinaryInstruction[] aggBinInstructions; try { aggBinInstructions = MRJobConfiguration.getAggregateBinaryInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRReducer.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRReducer.java index 5bf650a..2b500b7 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRReducer.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRReducer.java @@ -29,7 +29,6 @@ import org.apache.hadoop.mapred.Reducer; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.AggregateBinaryInstruction; import org.apache.sysml.runtime.matrix.data.MatrixIndexes; import org.apache.sysml.runtime.matrix.data.MatrixValue; @@ -157,8 +156,6 @@ implements Reducer<TripleIndexes, TaggedMatrixValue, MatrixIndexes, MatrixValue> super.configure(job); try { aggBinInstructions = MRJobConfiguration.getAggregateBinaryInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java index 21b2426..78d1613 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java @@ -31,7 +31,6 @@ import org.apache.hadoop.mapred.MapReduceBase; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat; import org.apache.sysml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer; import org.apache.sysml.runtime.instructions.Instruction; @@ -160,11 +159,10 @@ public class MRBaseForCommonInstructions extends MapReduceBase /** * * @param mixed_instructions - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ protected void processMixedInstructions(ArrayList<MRInstruction> mixed_instructions) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { if( mixed_instructions != null ) for( MRInstruction ins : mixed_instructions ) @@ -178,12 +176,11 @@ public class MRBaseForCommonInstructions extends MapReduceBase * @param cachedValues * @param tempValue * @param zeroInput - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ protected void processOneInstruction(MRInstruction ins, Class<? extends MatrixValue> valueClass, CachedValueMap cachedValues, IndexedMatrixValue tempValue, IndexedMatrixValue zeroInput) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //Timing time = new Timing(true); http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java index c59be60..5974e3e 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java @@ -49,7 +49,6 @@ import org.apache.sysml.conf.DMLConfig; import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.lops.Lop; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat; import org.apache.sysml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer; import org.apache.sysml.runtime.controlprogram.parfor.util.IDSequence; @@ -551,49 +550,49 @@ public class MRJobConfiguration DoubleWritable.class); } - public static MRInstruction[] getInstructionsInReducer(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static MRInstruction[] getInstructionsInReducer(JobConf job) throws DMLRuntimeException { String str=job.get(INSTRUCTIONS_IN_REDUCER_CONFIG); MRInstruction[] mixed_ops = MRInstructionParser.parseMixedInstructions(str); return mixed_ops; } - public static ReblockInstruction[] getReblockInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static ReblockInstruction[] getReblockInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(REBLOCK_INSTRUCTIONS_CONFIG); ReblockInstruction[] reblock_instructions = MRInstructionParser.parseReblockInstructions(str); return reblock_instructions; } - public static CSVReblockInstruction[] getCSVReblockInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static CSVReblockInstruction[] getCSVReblockInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(CSV_REBLOCK_INSTRUCTIONS_CONFIG); CSVReblockInstruction[] reblock_instructions = MRInstructionParser.parseCSVReblockInstructions(str); return reblock_instructions; } - public static CSVWriteInstruction[] getCSVWriteInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static CSVWriteInstruction[] getCSVWriteInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(CSV_WRITE_INSTRUCTIONS_CONFIG); CSVWriteInstruction[] reblock_instructions = MRInstructionParser.parseCSVWriteInstructions(str); return reblock_instructions; } - public static AggregateInstruction[] getAggregateInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static AggregateInstruction[] getAggregateInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(AGGREGATE_INSTRUCTIONS_CONFIG); AggregateInstruction[] agg_instructions = MRInstructionParser.parseAggregateInstructions(str); return agg_instructions; } - public static MRInstruction[] getCombineInstruction(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static MRInstruction[] getCombineInstruction(JobConf job) throws DMLRuntimeException { String str=job.get(COMBINE_INSTRUCTIONS_CONFIG); MRInstruction[] comb_instructions = MRInstructionParser.parseCombineInstructions(str); return comb_instructions; } - public static MRInstruction[] getInstructionsInMapper(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static MRInstruction[] getInstructionsInMapper(JobConf job) throws DMLRuntimeException { String str=job.get(INSTRUCTIONS_IN_MAPPER_CONFIG); MRInstruction[] instructions = MRInstructionParser.parseMixedInstructions(str); @@ -906,18 +905,18 @@ public class MRJobConfiguration } // TODO: check Rand - public static DataGenMRInstruction[] getDataGenInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException { + public static DataGenMRInstruction[] getDataGenInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(RAND_INSTRUCTIONS_CONFIG); return MRInstructionParser.parseDataGenInstructions(str); } - public static AggregateBinaryInstruction[] getAggregateBinaryInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static AggregateBinaryInstruction[] getAggregateBinaryInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(AGGREGATE_BINARY_INSTRUCTIONS_CONFIG); return MRInstructionParser.parseAggregateBinaryInstructions(str); } - public static CM_N_COVInstruction[] getCM_N_COVInstructions(JobConf job) throws DMLUnsupportedOperationException, DMLRuntimeException + public static CM_N_COVInstruction[] getCM_N_COVInstructions(JobConf job) throws DMLRuntimeException { String str=job.get(CM_N_COV_INSTRUCTIONS_CONFIG); return MRInstructionParser.parseCM_N_COVInstructions(str); @@ -927,11 +926,10 @@ public class MRJobConfiguration * * @param job * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public static GroupedAggregateInstruction[] getGroupedAggregateInstructions(JobConf job) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //parse all grouped aggregate instructions String str=job.get(GROUPEDAGG_INSTRUCTIONS_CONFIG); @@ -1339,7 +1337,7 @@ public class MRJobConfiguration public static MatrixChar_N_ReducerGroups computeMatrixCharacteristics(JobConf job, byte[] inputIndexes, String instructionsInMapper, String aggInstructionsInReducer, String aggBinInstructions, - String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLUnsupportedOperationException, DMLRuntimeException + String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLRuntimeException { return computeMatrixCharacteristics(job, inputIndexes, null, instructionsInMapper, null, aggInstructionsInReducer, aggBinInstructions, otherInstructionsInReducer, resultIndexes, mapOutputIndexes, forMMCJ); @@ -1347,7 +1345,7 @@ public class MRJobConfiguration public static MatrixChar_N_ReducerGroups computeMatrixCharacteristics(JobConf job, byte[] inputIndexes, String instructionsInMapper, String reblockInstructions, String aggInstructionsInReducer, String aggBinInstructions, - String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLUnsupportedOperationException, DMLRuntimeException + String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLRuntimeException { return computeMatrixCharacteristics(job, inputIndexes, null, instructionsInMapper, reblockInstructions, aggInstructionsInReducer, aggBinInstructions, otherInstructionsInReducer, resultIndexes, mapOutputIndexes, forMMCJ); @@ -1395,12 +1393,11 @@ public class MRJobConfiguration * @param mapOutputIndexes * @param forMMCJ * @return - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public static MatrixChar_N_ReducerGroups computeMatrixCharacteristics(JobConf job, byte[] inputIndexes, String dataGenInstructions, String instructionsInMapper, String reblockInstructions, String aggInstructionsInReducer, String aggBinInstructions, - String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLUnsupportedOperationException, DMLRuntimeException + String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLRuntimeException { HashSet<Byte> intermediateMatrixIndexes=new HashSet<Byte>(); HashMap<Byte, MatrixCharacteristics> dims=new HashMap<Byte, MatrixCharacteristics>(); @@ -1738,7 +1735,7 @@ public class MRJobConfiguration public static HashSet<Byte> setUpOutputIndexesForMapper(JobConf job, byte[] inputIndexes, String instructionsInMapper, String aggInstructionsInReducer, String otherInstructionsInReducer, byte[] resultIndexes) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { return setUpOutputIndexesForMapper(job, inputIndexes, null, instructionsInMapper, null, aggInstructionsInReducer, otherInstructionsInReducer, resultIndexes); @@ -1746,14 +1743,14 @@ public class MRJobConfiguration public static HashSet<Byte> setUpOutputIndexesForMapper(JobConf job, byte[] inputIndexes, String instructionsInMapper, String reblockInstructions, String aggInstructionsInReducer, String otherInstructionsInReducer, byte[] resultIndexes) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { return setUpOutputIndexesForMapper(job, inputIndexes, null, instructionsInMapper, reblockInstructions, aggInstructionsInReducer, otherInstructionsInReducer, resultIndexes); } public static HashSet<Byte> setUpOutputIndexesForMapper(JobConf job, byte[] inputIndexes, String randInstructions, String instructionsInMapper, String reblockInstructions, String aggInstructionsInReducer, String otherInstructionsInReducer, byte[] resultIndexes) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { //find out what results are needed to send to reducers http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java index 6067d7f..082de29 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java @@ -32,7 +32,6 @@ import org.apache.hadoop.mapred.OutputCollector; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.instructions.mr.AggregateBinaryInstruction; import org.apache.sysml.runtime.instructions.mr.CSVReblockInstruction; import org.apache.sysml.runtime.instructions.mr.DataGenMRInstruction; @@ -212,8 +211,6 @@ public abstract class MapperBase extends MRBaseForCommonInstructions allCSVReblockIns=MRJobConfiguration.getCSVReblockInstructions(job); - } catch (DMLUnsupportedOperationException e) { - throw new RuntimeException(e); } catch (DMLRuntimeException e) { throw new RuntimeException(e); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/6c89c3a7/src/main/java/org/apache/sysml/runtime/matrix/mapred/PartialAggregator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/PartialAggregator.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/PartialAggregator.java index 8136479..0430af7 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/PartialAggregator.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/PartialAggregator.java @@ -28,7 +28,6 @@ import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.Reporter; import org.apache.sysml.runtime.DMLRuntimeException; -import org.apache.sysml.runtime.DMLUnsupportedOperationException; import org.apache.sysml.runtime.matrix.data.MatrixIndexes; import org.apache.sysml.runtime.matrix.data.MatrixValue; import org.apache.sysml.runtime.matrix.operators.AggregateBinaryOperator; @@ -107,11 +106,10 @@ public class PartialAggregator extends MMCJMRCache * @param value * @param leftcached * @throws IOException - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ public void aggregateToBuffer(MatrixIndexes indexes, MatrixValue value, boolean leftcached) - throws IOException, DMLUnsupportedOperationException, DMLRuntimeException + throws IOException, DMLRuntimeException { if( !memOnly ) { @@ -183,11 +181,10 @@ public class PartialAggregator extends MMCJMRCache * @param indexes * @param value * @param leftcached - * @throws DMLUnsupportedOperationException * @throws DMLRuntimeException */ private void aggregateToBufferHelp(MatrixIndexes indexes, MatrixValue value, boolean leftcached) - throws DMLUnsupportedOperationException, DMLRuntimeException + throws DMLRuntimeException { Integer ix = _bufferMap.get( indexes ); if( ix != null ) //agg into existing block
