You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2018/03/24 08:31:43 UTC
[1/5] systemml git commit: [SYSTEMML-2191] Cleanup exception
hierarchy and handling, part 2
Repository: systemml
Updated Branches:
refs/heads/master ad41c3a46 -> 583f34480
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/ResourceOptimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/ResourceOptimizer.java b/src/main/java/org/apache/sysml/yarn/ropt/ResourceOptimizer.java
index 18b9156..ff726c8 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/ResourceOptimizer.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/ResourceOptimizer.java
@@ -28,11 +28,9 @@ import org.apache.commons.logging.LogFactory;
import org.apache.sysml.hops.DataOp;
import org.apache.sysml.hops.Hop;
import org.apache.sysml.hops.Hop.DataOpTypes;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.hops.cost.CostEstimationWrapper;
import org.apache.sysml.hops.recompile.Recompiler;
-import org.apache.sysml.lops.LopsException;
import org.apache.sysml.lops.LopProperties.ExecType;
import org.apache.sysml.parser.Expression.ValueType;
import org.apache.sysml.parser.ForStatementBlock;
@@ -82,7 +80,6 @@ public class ResourceOptimizer
private static long _cntCostPB = 0;
public synchronized static ResourceConfig optimizeResourceConfig( ArrayList<ProgramBlock> prog, YarnClusterConfig cc, GridEnumType cptype, GridEnumType mrtype )
- throws DMLRuntimeException
{
ResourceConfig ROpt = null;
@@ -165,9 +162,7 @@ public class ResourceOptimizer
return ROpt;
}
- public static ArrayList<ProgramBlock> compileProgram( ArrayList<ProgramBlock> prog, ResourceConfig rc )
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
+ public static ArrayList<ProgramBlock> compileProgram( ArrayList<ProgramBlock> prog, ResourceConfig rc ) {
//recompile program block hierarchy to list of blocks and apply optimized resource configuration
ArrayList<ProgramBlock> B = compileProgram(prog, null, rc.getCPResource(), rc.getMaxMRResource());
ResourceOptimizer.recompileProgramBlocks(B, rc.getCPResource(), rc.getMRResourcesMemo());
@@ -175,9 +170,7 @@ public class ResourceOptimizer
return B;
}
- private static ArrayList<ProgramBlock> compileProgram( ArrayList<ProgramBlock> prog, ArrayList<ProgramBlock> B, double cp, double mr )
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
+ private static ArrayList<ProgramBlock> compileProgram( ArrayList<ProgramBlock> prog, ArrayList<ProgramBlock> B, double cp, double mr ) {
if( B == null ) { //init
B = new ArrayList<>();
InfrastructureAnalyzer.setLocalMaxMemory( (long)cp );
@@ -192,9 +185,7 @@ public class ResourceOptimizer
return B;
}
- private static ArrayList<ProgramBlock> compileProgram( ProgramBlock pb, ArrayList<ProgramBlock> B, double cp, double mr )
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
+ private static ArrayList<ProgramBlock> compileProgram( ProgramBlock pb, ArrayList<ProgramBlock> B, double cp, double mr ) {
if (pb instanceof FunctionProgramBlock)
{
FunctionProgramBlock fpb = (FunctionProgramBlock)pb;
@@ -265,11 +256,8 @@ public class ResourceOptimizer
return B;
}
- private static void recompileProgramBlocks( ArrayList<ProgramBlock> pbs, long cp, double[][] memo )
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
- for( int i=0; i<pbs.size(); i++ )
- {
+ private static void recompileProgramBlocks( ArrayList<ProgramBlock> pbs, long cp, double[][] memo ) {
+ for( int i=0; i<pbs.size(); i++ ) {
ProgramBlock pb = pbs.get(i);
long mr = (long)memo[i][0];
recompileProgramBlock(pb, cp, mr);
@@ -277,7 +265,6 @@ public class ResourceOptimizer
}
private static void recompileProgramBlock( ProgramBlock pb, long cp, long mr )
- throws DMLRuntimeException, HopsException, LopsException, IOException
{
//init compiler memory budget
InfrastructureAnalyzer.setLocalMaxMemory( cp );
@@ -286,8 +273,7 @@ public class ResourceOptimizer
OptimizerUtils.resetDefaultSize(); //dependent on cp, mr
//recompile instructions (incl predicates)
- if (pb instanceof WhileProgramBlock)
- {
+ if (pb instanceof WhileProgramBlock) {
WhileProgramBlock wpb = (WhileProgramBlock)pb;
WhileStatementBlock sb = (WhileStatementBlock) pb.getStatementBlock();
if( INCLUDE_PREDICATES && sb!=null && sb.getPredicateHops()!=null ){
@@ -295,10 +281,9 @@ public class ResourceOptimizer
sb.getPredicateHops(), new LocalVariableMap(), null, false, false, 0);
inst = annotateMRJobInstructions(inst, cp, mr);
wpb.setPredicate( inst );
- }
- }
- else if (pb instanceof IfProgramBlock)
- {
+ }
+ }
+ else if (pb instanceof IfProgramBlock) {
IfProgramBlock ipb = (IfProgramBlock)pb;
IfStatementBlock sb = (IfStatementBlock) ipb.getStatementBlock();
if( INCLUDE_PREDICATES && sb!=null && sb.getPredicateHops()!=null ){
@@ -308,8 +293,7 @@ public class ResourceOptimizer
ipb.setPredicate( inst );
}
}
- else if (pb instanceof ForProgramBlock) //incl parfor
- {
+ else if (pb instanceof ForProgramBlock) { //incl parfor
ForProgramBlock fpb = (ForProgramBlock)pb;
ForStatementBlock sb = (ForStatementBlock) fpb.getStatementBlock();
if( INCLUDE_PREDICATES && sb!=null ){
@@ -333,8 +317,7 @@ public class ResourceOptimizer
}
}
}
- else //last-level program blocks
- {
+ else { //last-level program blocks
StatementBlock sb = pb.getStatementBlock();
ArrayList<Instruction> inst = Recompiler.recompileHopsDag(
sb, sb.getHops(), new LocalVariableMap(), null, false, false, 0);
@@ -346,7 +329,6 @@ public class ResourceOptimizer
}
private static ArrayList<Instruction> annotateMRJobInstructions( ArrayList<Instruction> inst, long cp, long mr )
- throws DMLRuntimeException
{
//check for empty instruction lists (e.g., predicates)
if( inst == null || !COSTS_MAX_PARALLELISM )
@@ -382,9 +364,7 @@ public class ResourceOptimizer
return inst;
}
- private static double getProgramCosts( ProgramBlock pb )
- throws DMLRuntimeException, HopsException
- {
+ private static double getProgramCosts( ProgramBlock pb ) {
double val = 0;
if( COST_INDIVIDUAL_BLOCKS ) {
LocalVariableMap vars = new LocalVariableMap();
@@ -403,24 +383,20 @@ public class ResourceOptimizer
return val;
}
- private static double getProgramCosts( Program prog )
- throws DMLRuntimeException
- {
+ private static double getProgramCosts( Program prog ) {
//we need to cost the entire program in order to take in-memory status into account
ExecutionContext ec = ExecutionContextFactory.createContext();
double val = CostEstimationWrapper.getTimeEstimate(prog, ec);
_cntCostPB ++;
-
return val;
}
- private static void collectReadVariables( ArrayList<Hop> hops, LocalVariableMap vars )
- {
+ private static void collectReadVariables( ArrayList<Hop> hops, LocalVariableMap vars ) {
if( hops!=null ) {
Hop.resetVisitStatus(hops);
for( Hop hop : hops )
collectReadVariables(hop, vars);
- }
+ }
}
private static void collectReadVariables( Hop hop, LocalVariableMap vars )
@@ -543,9 +519,7 @@ public class ResourceOptimizer
return ret;
}
- private static ArrayList<Long> enumerateGridPoints( ArrayList<ProgramBlock> prog, long min, long max, GridEnumType type )
- throws DMLRuntimeException, HopsException
- {
+ private static ArrayList<Long> enumerateGridPoints( ArrayList<ProgramBlock> prog, long min, long max, GridEnumType type ) {
//create enumerator
GridEnumeration ge = null;
switch( type ){
@@ -568,22 +542,17 @@ public class ResourceOptimizer
return ret;
}
- private static double[][] initLocalMemoTable( ArrayList<ProgramBlock> Bp, double min )
- throws DMLRuntimeException
- {
+ private static double[][] initLocalMemoTable( ArrayList<ProgramBlock> Bp, double min ) {
//allocate memo structure
int len = Bp.size();
double[][] memo = new double[len][2];
-
//init with min resource and current costs
- for( int i=0; i<len; i++ )
- {
+ for( int i=0; i<len; i++ ) {
ProgramBlock pb = Bp.get(i);
ExecutionContext ec = ExecutionContextFactory.createContext();
memo[i][0] = min;
memo[i][1] = CostEstimationWrapper.getTimeEstimate(pb.getProgram(), ec);
}
-
return memo;
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java b/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
index 8ca1d8d..89de76d 100644
--- a/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
+++ b/src/test/java/org/apache/sysml/test/integration/conversion/RDDConverterUtilsExtTest.java
@@ -36,7 +36,6 @@ import org.apache.spark.sql.SparkSession;
import org.apache.spark.sql.types.DataTypes;
import org.apache.spark.sql.types.StructField;
import org.apache.spark.sql.types.StructType;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.context.SparkExecutionContext;
import org.apache.sysml.runtime.instructions.spark.utils.RDDConverterUtilsExt;
import org.apache.sysml.test.integration.AutomatedTestBase;
@@ -77,7 +76,7 @@ public class RDDConverterUtilsExtTest extends AutomatedTestBase {
}
@Test
- public void testStringDataFrameToVectorDataFrame() throws DMLRuntimeException {
+ public void testStringDataFrameToVectorDataFrame() {
List<String> list = new ArrayList<String>();
list.add("((1.2, 4.3, 3.4))");
list.add("(1.2, 3.4, 2.2)");
@@ -105,7 +104,7 @@ public class RDDConverterUtilsExtTest extends AutomatedTestBase {
}
@Test
- public void testStringDataFrameToVectorDataFrameNull() throws DMLRuntimeException {
+ public void testStringDataFrameToVectorDataFrameNull() {
List<String> list = new ArrayList<String>();
list.add("[1.2, 3.4]");
list.add(null);
@@ -129,7 +128,7 @@ public class RDDConverterUtilsExtTest extends AutomatedTestBase {
}
@Test(expected = SparkException.class)
- public void testStringDataFrameToVectorDataFrameNonNumbers() throws DMLRuntimeException {
+ public void testStringDataFrameToVectorDataFrameNonNumbers() {
List<String> list = new ArrayList<String>();
list.add("[cheeseburger,fries]");
JavaRDD<String> javaRddString = sc.parallelize(list);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/test/java/org/apache/sysml/test/integration/functions/data/FullReblockTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/data/FullReblockTest.java b/src/test/java/org/apache/sysml/test/integration/functions/data/FullReblockTest.java
index 5533022..c1a46ce 100644
--- a/src/test/java/org/apache/sysml/test/integration/functions/data/FullReblockTest.java
+++ b/src/test/java/org/apache/sysml/test/integration/functions/data/FullReblockTest.java
@@ -29,7 +29,6 @@ import org.apache.sysml.api.DMLScript;
import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
import org.apache.sysml.lops.LopProperties.ExecType;
import org.apache.sysml.parser.Expression.ValueType;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
import org.apache.sysml.runtime.matrix.data.InputInfo;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
@@ -503,7 +502,7 @@ public class FullReblockTest extends AutomatedTestBase
}
private static void writeMatrix( double[][] A, String fname, OutputInfo oi, long rows, long cols, int brows, int bcols )
- throws DMLRuntimeException, IOException
+ throws IOException
{
MatrixCharacteristics mc = new MatrixCharacteristics(rows, cols, brows, bcols);
MatrixBlock mb = DataConverter.convertToMatrixBlock(A);
[2/5] systemml git commit: [SYSTEMML-2191] Cleanup exception
hierarchy and handling, part 2
Posted by mb...@apache.org.
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreeConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreeConverter.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreeConverter.java
index 65f7299..e88df23 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreeConverter.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreeConverter.java
@@ -88,9 +88,7 @@ public class OptTreeConverter
_rtMap = new OptTreePlanMappingRuntime();
}
- public static OptTree createOptTree( int ck, double cm, PlanInputType type, ParForStatementBlock pfsb, ParForProgramBlock pfpb, ExecutionContext ec )
- throws DMLRuntimeException, HopsException
- {
+ public static OptTree createOptTree( int ck, double cm, PlanInputType type, ParForStatementBlock pfsb, ParForProgramBlock pfpb, ExecutionContext ec ) {
OptNode root = null;
switch( type )
{
@@ -114,7 +112,6 @@ public class OptTreeConverter
}
public static OptTree createAbstractOptTree( int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, Set<String> memo, ExecutionContext ec )
- throws DMLRuntimeException
{
OptTree tree = null;
OptNode root = null;
@@ -133,7 +130,6 @@ public class OptTreeConverter
}
public static OptNode rCreateOptNode( ProgramBlock pb, LocalVariableMap vars, boolean topLevel, boolean storeObjs )
- throws DMLRuntimeException
{
OptNode node = null;
@@ -246,18 +242,14 @@ public class OptTreeConverter
return node;
}
- public static ArrayList<OptNode> createOptNodes (ArrayList<Instruction> instset, LocalVariableMap vars, boolean storeObjs)
- throws DMLRuntimeException
- {
+ public static ArrayList<OptNode> createOptNodes (ArrayList<Instruction> instset, LocalVariableMap vars, boolean storeObjs) {
ArrayList<OptNode> tmp = new ArrayList<>(instset.size());
for( Instruction inst : instset )
tmp.add( createOptNode(inst,vars,storeObjs) );
return tmp;
}
- public static OptNode createOptNode( Instruction inst, LocalVariableMap vars, boolean storeObjs )
- throws DMLRuntimeException
- {
+ public static OptNode createOptNode( Instruction inst, LocalVariableMap vars, boolean storeObjs ) {
OptNode node = new OptNode(NodeType.INST);
String instStr = inst.toString();
String opstr = instStr.split(Instruction.OPERAND_DELIM)[1];
@@ -290,7 +282,6 @@ public class OptTreeConverter
}
public static OptNode rCreateAbstractOptNode( StatementBlock sb, ProgramBlock pb, LocalVariableMap vars, boolean topLevel, Set<String> memo )
- throws DMLRuntimeException, HopsException
{
OptNode node = null;
@@ -475,9 +466,7 @@ public class OptTreeConverter
return node;
}
- public static ArrayList<OptNode> createAbstractOptNodes(ArrayList<Hop> hops, LocalVariableMap vars, Set<String> memo )
- throws DMLRuntimeException, HopsException
- {
+ public static ArrayList<OptNode> createAbstractOptNodes(ArrayList<Hop> hops, LocalVariableMap vars, Set<String> memo ) {
ArrayList<OptNode> ret = new ArrayList<>();
//reset all hops
@@ -491,9 +480,7 @@ public class OptTreeConverter
return ret;
}
- public static ArrayList<OptNode> rCreateAbstractOptNodes(Hop hop, LocalVariableMap vars, Set<String> memo)
- throws DMLRuntimeException, HopsException
- {
+ public static ArrayList<OptNode> rCreateAbstractOptNodes(Hop hop, LocalVariableMap vars, Set<String> memo) {
ArrayList<OptNode> ret = new ArrayList<>();
ArrayList<Hop> in = hop.getInput();
@@ -648,9 +635,7 @@ public class OptTreeConverter
.anyMatch(inst -> inst instanceof FunctionCallCPInstruction);
}
- public static void replaceProgramBlock(OptNode parent, OptNode n, ProgramBlock pbOld, ProgramBlock pbNew, boolean rtMap)
- throws DMLRuntimeException
- {
+ public static void replaceProgramBlock(OptNode parent, OptNode n, ProgramBlock pbOld, ProgramBlock pbNew, boolean rtMap) {
ProgramBlock pbParent = null;
if( rtMap )
pbParent = (ProgramBlock)_rtMap.getMappedObject( parent.getID() );
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreePlanChecker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreePlanChecker.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreePlanChecker.java
index fc42996..28c3c4c 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreePlanChecker.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptTreePlanChecker.java
@@ -25,7 +25,6 @@ import java.util.Set;
import org.apache.sysml.hops.FunctionOp;
import org.apache.sysml.hops.Hop;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.parser.DMLProgram;
import org.apache.sysml.parser.ForStatement;
import org.apache.sysml.parser.ForStatementBlock;
@@ -122,31 +121,23 @@ public class OptTreePlanChecker
}
- private static void checkHopDagCorrectness( Program prog, DMLProgram dprog, ArrayList<Hop> roots, ArrayList<Instruction> inst, Set<String> fnStack )
- throws DMLRuntimeException, HopsException
- {
+ private static void checkHopDagCorrectness( Program prog, DMLProgram dprog, ArrayList<Hop> roots, ArrayList<Instruction> inst, Set<String> fnStack ) {
if( roots != null )
for( Hop hop : roots )
checkHopDagCorrectness(prog, dprog, hop, inst, fnStack);
}
- private static void checkHopDagCorrectness( Program prog, DMLProgram dprog, Hop root, ArrayList<Instruction> inst, Set<String> fnStack )
- throws DMLRuntimeException, HopsException
- {
+ private static void checkHopDagCorrectness( Program prog, DMLProgram dprog, Hop root, ArrayList<Instruction> inst, Set<String> fnStack ) {
//set of checks to perform
checkFunctionNames(prog, dprog, root, inst, fnStack);
}
- private static void checkLinksProgramStatementBlock( ProgramBlock pb, StatementBlock sb )
- throws DMLRuntimeException
- {
+ private static void checkLinksProgramStatementBlock( ProgramBlock pb, StatementBlock sb ) {
if( pb.getStatementBlock() != sb )
throw new DMLRuntimeException("Links between programblocks and statementblocks are incorrect ("+pb+").");
}
- private static void checkFunctionNames( Program prog, DMLProgram dprog, Hop root, ArrayList<Instruction> inst, Set<String> fnStack )
- throws DMLRuntimeException, HopsException
- {
+ private static void checkFunctionNames( Program prog, DMLProgram dprog, Hop root, ArrayList<Instruction> inst, Set<String> fnStack ) {
//reset visit status of dag
root.resetVisitStatus();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizationWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizationWrapper.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizationWrapper.java
index 5f2f030..83bcae8 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizationWrapper.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizationWrapper.java
@@ -99,10 +99,8 @@ public class OptimizationWrapper
* @param pb parfor program block
* @param ec execution context
* @param monitor ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static void optimize( POptMode type, ParForStatementBlock sb, ParForProgramBlock pb, ExecutionContext ec, boolean monitor )
- throws DMLRuntimeException
{
Timing time = new Timing(true);
@@ -134,7 +132,6 @@ public class OptimizationWrapper
@SuppressWarnings("unused")
private static void optimize( POptMode otype, int ck, double cm, ParForStatementBlock sb, ParForProgramBlock pb, ExecutionContext ec, boolean monitor )
- throws DMLRuntimeException
{
Timing time = new Timing(true);
@@ -273,50 +270,28 @@ public class OptimizationWrapper
}
}
- private static Optimizer createOptimizer( POptMode otype )
- throws DMLRuntimeException
- {
- Optimizer opt = null;
-
- switch( otype )
- {
- case HEURISTIC:
- opt = new OptimizerHeuristic();
- break;
- case RULEBASED:
- opt = new OptimizerRuleBased();
- break;
- case CONSTRAINED:
- opt = new OptimizerConstrained();
- break;
+ private static Optimizer createOptimizer( POptMode otype ) {
+ switch( otype ) {
+ case HEURISTIC: return new OptimizerHeuristic();
+ case RULEBASED: return new OptimizerRuleBased();
+ case CONSTRAINED: return new OptimizerConstrained();
default:
throw new DMLRuntimeException("Undefined optimizer: '"+otype+"'.");
}
-
- return opt;
}
- private static CostEstimator createCostEstimator( CostModelType cmtype, LocalVariableMap vars )
- throws DMLRuntimeException
- {
- CostEstimator est = null;
-
- switch( cmtype )
- {
+ private static CostEstimator createCostEstimator( CostModelType cmtype, LocalVariableMap vars ) {
+ switch( cmtype ) {
case STATIC_MEM_METRIC:
- est = new CostEstimatorHops(
- OptTreeConverter.getAbstractPlanMapping() );
- break;
+ return new CostEstimatorHops(
+ OptTreeConverter.getAbstractPlanMapping() );
case RUNTIME_METRICS:
- est = new CostEstimatorRuntime(
- OptTreeConverter.getAbstractPlanMapping(),
- (LocalVariableMap)vars.clone() );
- break;
+ return new CostEstimatorRuntime(
+ OptTreeConverter.getAbstractPlanMapping(),
+ (LocalVariableMap)vars.clone() );
default:
throw new DMLRuntimeException("Undefined cost model type: '"+cmtype+"'.");
}
-
- return est;
}
private static ProgramRewriter createProgramRewriterWithRuleSets()
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/Optimizer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/Optimizer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/Optimizer.java
index af92b80..5ff4d61 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/Optimizer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/Optimizer.java
@@ -22,7 +22,6 @@ package org.apache.sysml.runtime.controlprogram.parfor.opt;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysml.parser.ParForStatementBlock;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.POptMode;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
@@ -69,11 +68,9 @@ public abstract class Optimizer
* @param est cost estimator
* @param ec execution context
* @return true if plan changed, false otherwise
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract boolean optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, ExecutionContext ec)
- throws DMLRuntimeException;
-
+ public abstract boolean optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, ExecutionContext ec);
+
public abstract PlanInputType getPlanInputType();
public abstract CostModelType getCostModelType();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerConstrained.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerConstrained.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerConstrained.java
index 2a1fd19..68731c1 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerConstrained.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerConstrained.java
@@ -27,7 +27,6 @@ import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.lops.LopProperties;
import org.apache.sysml.parser.ParForStatementBlock;
import org.apache.sysml.parser.ParForStatementBlock.ResultVar;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat;
@@ -77,7 +76,6 @@ public class OptimizerConstrained extends OptimizerRuleBased
*/
@Override
public boolean optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, ExecutionContext ec)
- throws DMLRuntimeException
{
LOG.debug("--- "+getOptMode()+" OPTIMIZER -------");
@@ -230,7 +228,6 @@ public class OptimizerConstrained extends OptimizerRuleBased
@Override
protected boolean rewriteSetDataPartitioner(OptNode n, LocalVariableMap vars, HashMap<String,PartitionFormat> partitionedMatrices, double thetaM)
- throws DMLRuntimeException
{
//call rewrite first to obtain partitioning information
String initPlan = n.getParam(ParamType.DATA_PARTITIONER);
@@ -254,7 +251,6 @@ public class OptimizerConstrained extends OptimizerRuleBased
@Override
protected boolean rewriteSetExecutionStategy(OptNode n, double M0, double M, double M2, double M3, boolean flagLIX)
- throws DMLRuntimeException
{
boolean ret = false;
@@ -262,7 +258,7 @@ public class OptimizerConstrained extends OptimizerRuleBased
if( n.getExecType() != null && ConfigurationManager.isParallelParFor() )
{
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
- .getAbstractPlanMapping().getMappedProg(n.getID())[1];
+ .getAbstractPlanMapping().getMappedProg(n.getID())[1];
PExecMode mode = PExecMode.LOCAL;
@@ -288,9 +284,7 @@ public class OptimizerConstrained extends OptimizerRuleBased
///
@Override
- protected void rewriteSetDegreeOfParallelism(OptNode n, double M, boolean flagNested)
- throws DMLRuntimeException
- {
+ protected void rewriteSetDegreeOfParallelism(OptNode n, double M, boolean flagNested) {
// constraint awareness
if( n.getK() > 0 && ConfigurationManager.isParallelParFor() )
{
@@ -347,9 +341,7 @@ public class OptimizerConstrained extends OptimizerRuleBased
///
@Override
- protected void rewriteSetResultMerge( OptNode n, LocalVariableMap vars, boolean inLocal )
- throws DMLRuntimeException
- {
+ protected void rewriteSetResultMerge( OptNode n, LocalVariableMap vars, boolean inLocal ) {
// constraint awareness
if( !n.getParam(ParamType.RESULT_MERGE).equals(PResultMerge.UNSPECIFIED.toString()) )
{
@@ -368,7 +360,6 @@ public class OptimizerConstrained extends OptimizerRuleBased
///
protected void rewriteSetFusedDataPartitioningExecution(OptNode pn, double M, boolean flagLIX, HashMap<String, PartitionFormat> partitionedMatrices, LocalVariableMap vars, PExecMode emode)
- throws DMLRuntimeException
{
if( emode == PExecMode.REMOTE_MR_DP || emode == PExecMode.REMOTE_SPARK_DP )
{
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
index d5b09e1..9059e0f 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/OptimizerRuleBased.java
@@ -19,7 +19,6 @@
package org.apache.sysml.runtime.controlprogram.parfor.opt;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -41,7 +40,6 @@ import org.apache.sysml.hops.AggBinaryOp.MMultMethod;
import org.apache.sysml.hops.Hop.MultiThreadedHop;
import org.apache.sysml.hops.Hop.ParamBuiltinOp;
import org.apache.sysml.hops.Hop.ReOrgOp;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.hops.IndexingOp;
import org.apache.sysml.hops.LeftIndexingOp;
import org.apache.sysml.hops.LiteralOp;
@@ -56,11 +54,9 @@ import org.apache.sysml.hops.rewrite.ProgramRewriter;
import org.apache.sysml.hops.rewrite.RewriteInjectSparkLoopCheckpointing;
import org.apache.sysml.hops.recompile.Recompiler;
import org.apache.sysml.lops.LopProperties;
-import org.apache.sysml.lops.LopsException;
import org.apache.sysml.parser.DMLProgram;
import org.apache.sysml.parser.Expression.DataType;
import org.apache.sysml.parser.FunctionStatementBlock;
-import org.apache.sysml.parser.LanguageException;
import org.apache.sysml.parser.ParForStatement;
import org.apache.sysml.parser.ParForStatementBlock;
import org.apache.sysml.parser.ParForStatementBlock.ResultVar;
@@ -200,7 +196,6 @@ public class OptimizerRuleBased extends Optimizer
*/
@Override
public boolean optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, ExecutionContext ec)
- throws DMLRuntimeException
{
LOG.debug("--- "+getOptMode()+" OPTIMIZER -------");
@@ -399,7 +394,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected boolean rewriteSetDataPartitioner(OptNode n, LocalVariableMap vars, HashMap<String, PartitionFormat> partitionedMatrices, double thetaM )
- throws DMLRuntimeException
{
if( n.getNodeType() != NodeType.PARFOR )
LOG.warn(getOptMode()+" OPT: Data partitioner can only be set for a ParFor node.");
@@ -454,7 +448,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean rFindDataPartitioningCandidates( OptNode n, HashMap<String, PartitionFormat> cand, LocalVariableMap vars, double thetaM )
- throws DMLRuntimeException
{
boolean ret = false;
@@ -507,10 +500,8 @@ public class OptimizerRuleBased extends Optimizer
* @param dpf data partition format
* @param vars local variable map
* @return memory estimate
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected double getNewRIXMemoryEstimate( OptNode n, String varName, PartitionFormat dpf, LocalVariableMap vars )
- throws DMLRuntimeException
{
double mem = -1;
@@ -544,9 +535,8 @@ public class OptimizerRuleBased extends Optimizer
}
protected static LopProperties.ExecType getRIXExecType( MatrixObject mo, PDataPartitionFormat dpf, boolean withSparsity )
- throws DMLRuntimeException
{
- double mem = -1;
+ double mem = -1;
long rlen = mo.getNumRows();
long clen = mo.getNumColumns();
@@ -581,9 +571,7 @@ public class OptimizerRuleBased extends Optimizer
return LopProperties.ExecType.CP_FILE;
}
- public static boolean allowsBinaryCellPartitions( MatrixObject mo, PartitionFormat dpf )
- throws DMLRuntimeException
- {
+ public static boolean allowsBinaryCellPartitions( MatrixObject mo, PartitionFormat dpf ) {
return (getRIXExecType(mo, PDataPartitionFormat.COLUMN_BLOCK_WISE, false)==LopProperties.ExecType.CP );
}
@@ -591,9 +579,7 @@ public class OptimizerRuleBased extends Optimizer
//REWRITE set result partitioning
///
- protected boolean rewriteSetResultPartitioning(OptNode n, double M, LocalVariableMap vars)
- throws DMLRuntimeException
- {
+ protected boolean rewriteSetResultPartitioning(OptNode n, double M, LocalVariableMap vars) {
//preparations
long id = n.getID();
Object[] o = OptTreeConverter.getAbstractPlanMapping().getMappedProg(id);
@@ -626,25 +612,19 @@ public class OptimizerRuleBased extends Optimizer
return apply;
}
- protected boolean isResultPartitionableAll( Collection<OptNode> nlist, ArrayList<ResultVar> resultVars, LocalVariableMap vars, String iterVarname )
- throws DMLRuntimeException
- {
+ protected boolean isResultPartitionableAll( Collection<OptNode> nlist, ArrayList<ResultVar> resultVars, LocalVariableMap vars, String iterVarname ) {
boolean ret = true;
- for( OptNode n : nlist )
- {
+ for( OptNode n : nlist ) {
ret &= isResultPartitionable(n, resultVars, vars, iterVarname);
if(!ret) //early abort
break;
}
-
return ret;
}
protected boolean isResultPartitionable( OptNode n, ArrayList<ResultVar> resultVars, LocalVariableMap vars, String iterVarname )
- throws DMLRuntimeException
{
boolean ret = true;
-
//check left indexing operator
String opStr = n.getParam(ParamType.OPSTRING);
if( opStr==null || !opStr.equals(LeftIndexingOp.OPSTRING) )
@@ -754,9 +734,7 @@ public class OptimizerRuleBased extends Optimizer
return (int) Math.floor( lbudget / 12 );
}
- protected void recompileLIX( OptNode n, LocalVariableMap vars )
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
+ protected void recompileLIX( OptNode n, LocalVariableMap vars ) {
Hop h = OptTreeConverter.getAbstractPlanMapping().getMappedHop(n.getID());
//set forced exec type
@@ -812,9 +790,7 @@ public class OptimizerRuleBased extends Optimizer
//REWRITE set execution strategy
///
- protected boolean rewriteSetExecutionStategy(OptNode n, double M0, double M, double M2, double M3, boolean flagLIX)
- throws DMLRuntimeException
- {
+ protected boolean rewriteSetExecutionStategy(OptNode n, double M0, double M, double M2, double M3, boolean flagLIX) {
boolean isCPOnly = n.isCPOnly();
boolean isCPOnlyPossible = isCPOnly || isCPOnlyPossible(n, _rm);
@@ -900,9 +876,7 @@ public class OptimizerRuleBased extends Optimizer
&& M > PROB_SIZE_THRESHOLD_MB/(isCtxCreated?10:1));
}
- protected boolean isCPOnlyPossible( OptNode n, double memBudget )
- throws DMLRuntimeException
- {
+ protected boolean isCPOnlyPossible( OptNode n, double memBudget ) {
ExecType et = n.getExecType();
boolean ret = ( et == ExecType.CP);
@@ -933,9 +907,7 @@ public class OptimizerRuleBased extends Optimizer
//REWRITE set operations exec type
///
- protected void rewriteSetOperationsExecType(OptNode pn, boolean recompile)
- throws DMLRuntimeException
- {
+ protected void rewriteSetOperationsExecType(OptNode pn, boolean recompile) {
//set exec type in internal opt tree
int count = setOperationExecType(pn, ExecType.CP);
@@ -979,11 +951,8 @@ public class OptimizerRuleBased extends Optimizer
*
* @param n internal representation of a plan alternative for program blocks and instructions
* @param vars local variable map
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- protected void rewriteDataColocation( OptNode n, LocalVariableMap vars )
- throws DMLRuntimeException
- {
+ protected void rewriteDataColocation( OptNode n, LocalVariableMap vars ) {
// data colocation is beneficial if we have dp=REMOTE_MR, etype=REMOTE_MR
// and there is at least one direct col-/row-wise access with the index variable
// on the partitioned matrix
@@ -1023,9 +992,7 @@ public class OptimizerRuleBased extends Optimizer
LOG.debug(getOptMode()+" OPT: rewrite 'enable data colocation' - result="+apply+((apply)?" ("+varname+")":"") );
}
- protected void rFindDataColocationCandidates( OptNode n, HashSet<String> cand, String iterVarname )
- throws DMLRuntimeException
- {
+ protected void rFindDataColocationCandidates( OptNode n, HashSet<String> cand, String iterVarname ) {
if( !n.isLeaf() )
{
for( OptNode cn : n.getChilds() )
@@ -1074,17 +1041,15 @@ public class OptimizerRuleBased extends Optimizer
* @param n internal representation of a plan alternative for program blocks and instructions
* @param partitionedMatrices map of data partition formats
* @param vars local variable map
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected void rewriteSetPartitionReplicationFactor( OptNode n, HashMap<String, PartitionFormat> partitionedMatrices, LocalVariableMap vars )
- throws DMLRuntimeException
{
boolean apply = false;
double sizeReplicated = 0;
int replication = ParForProgramBlock.WRITE_REPLICATION_FACTOR;
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
- .getAbstractPlanMapping().getMappedProg(n.getID())[1];
+ .getAbstractPlanMapping().getMappedProg(n.getID())[1];
if(((n.getExecType()==ExecType.MR && n.getParam(ParamType.DATA_PARTITIONER).equals(PDataPartitioner.REMOTE_MR.name()))
|| (n.getExecType()==ExecType.SPARK && n.getParam(ParamType.DATA_PARTITIONER).equals(PDataPartitioner.REMOTE_SPARK.name())))
@@ -1144,19 +1109,17 @@ public class OptimizerRuleBased extends Optimizer
*
* @param n internal representation of a plan alternative for program blocks and instructions
* @param vars local variable map
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected void rewriteSetExportReplicationFactor( OptNode n, LocalVariableMap vars )
- throws DMLRuntimeException
{
boolean apply = false;
int replication = -1;
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
- .getAbstractPlanMapping().getMappedProg(n.getID())[1];
+ .getAbstractPlanMapping().getMappedProg(n.getID())[1];
//decide on the replication factor
- if( n.getExecType()==getRemoteExecType() )
+ if( n.getExecType()==getRemoteExecType() )
{
apply = true;
@@ -1182,9 +1145,8 @@ public class OptimizerRuleBased extends Optimizer
*
* @param n the parfor {@link OptNode}
* @return the maximum memory needed for any operation inside a parfor in CP execution mode
- * @throws DMLRuntimeException if error
*/
- protected double getMaxCPOnlyBudget(OptNode n) throws DMLRuntimeException {
+ protected double getMaxCPOnlyBudget(OptNode n) {
ExecType et = n.getExecType();
double ret = 0;
@@ -1215,7 +1177,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteSetDegreeOfParallelism(OptNode n, double M, boolean flagNested)
- throws DMLRuntimeException
{
ExecType type = n.getExecType();
long id = n.getID();
@@ -1304,8 +1265,7 @@ public class OptimizerRuleBased extends Optimizer
}
protected void rAssignRemainingParallelism(OptNode n, int parforK, int opsK)
- throws DMLRuntimeException
- {
+ {
ArrayList<OptNode> childs = n.getChilds();
if( childs != null )
{
@@ -1486,10 +1446,8 @@ public class OptimizerRuleBased extends Optimizer
* @param flagLIX ?
* @param partitionedMatrices map of data partition formats
* @param vars local variable map
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected void rewriteSetFusedDataPartitioningExecution(OptNode pn, double M, boolean flagLIX, HashMap<String, PartitionFormat> partitionedMatrices, LocalVariableMap vars)
- throws DMLRuntimeException
{
//assertions (warnings of corrupt optimizer decisions)
if( pn.getNodeType() != NodeType.PARFOR )
@@ -1541,7 +1499,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean rIsAccessByIterationVariable( OptNode n, String varName, String iterVarname )
- throws DMLRuntimeException
{
boolean ret = true;
@@ -1602,7 +1559,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteSetTranposeSparseVectorOperations(OptNode pn, HashMap<String, PartitionFormat> partitionedMatrices, LocalVariableMap vars)
- throws DMLRuntimeException
{
//assertions (warnings of corrupt optimizer decisions)
if( pn.getNodeType() != NodeType.PARFOR )
@@ -1611,9 +1567,9 @@ public class OptimizerRuleBased extends Optimizer
boolean apply = false;
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
- .getAbstractPlanMapping().getMappedProg(pn.getID())[1];
+ .getAbstractPlanMapping().getMappedProg(pn.getID())[1];
- if( pfpb.getExecMode() == PExecMode.REMOTE_MR_DP
+ if( pfpb.getExecMode() == PExecMode.REMOTE_MR_DP
&& partitionedMatrices.size()==1 ) //general applicable
{
String moVarname = partitionedMatrices.keySet().iterator().next();
@@ -1635,7 +1591,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean rIsTransposeSafePartition( OptNode n, String varName )
- throws DMLRuntimeException
{
boolean ret = true;
@@ -1670,7 +1625,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteSetInPlaceResultIndexing(OptNode pn, double M, LocalVariableMap vars, HashSet<ResultVar> inPlaceResultVars, ExecutionContext ec)
- throws DMLRuntimeException
{
//assertions (warnings of corrupt optimizer decisions)
if( pn.getNodeType() != NodeType.PARFOR )
@@ -1729,7 +1683,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean rHasOnlyInPlaceSafeLeftIndexing( OptNode n, ArrayList<ResultVar> retVars )
- throws DMLRuntimeException
{
boolean ret = true;
if( !n.isLeaf() ) {
@@ -1770,7 +1723,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteDisableCPCaching(OptNode pn, HashSet<ResultVar> inplaceResultVars, LocalVariableMap vars)
- throws DMLRuntimeException
{
//assertions (warnings of corrupt optimizer decisions)
if( pn.getNodeType() != NodeType.PARFOR )
@@ -1792,7 +1744,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected double rComputeSumMemoryIntermediates( OptNode n, HashSet<ResultVar> inplaceResultVars )
- throws DMLRuntimeException
{
double sum = 0;
@@ -1829,7 +1780,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteEnableRuntimePiggybacking( OptNode n, LocalVariableMap vars, HashMap<String, PartitionFormat> partitionedMatrices )
- throws DMLRuntimeException
{
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
.getAbstractPlanMapping().getMappedProg(n.getID())[1];
@@ -1854,7 +1804,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean rHasSharedMRInput( OptNode n, Set<String> inputVars, Set<String> partitionedVars, HashSet<String> sharedVars )
- throws DMLRuntimeException
{
boolean ret = false;
@@ -1896,7 +1845,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteInjectSparkLoopCheckpointing(OptNode n)
- throws DMLRuntimeException
{
//get program blocks of root parfor
Object[] progobj = OptTreeConverter.getAbstractPlanMapping().getMappedProg(n.getID());
@@ -1933,7 +1881,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteInjectSparkRepartition(OptNode n, LocalVariableMap vars)
- throws DMLRuntimeException
{
//get program blocks of root parfor
Object[] progobj = OptTreeConverter.getAbstractPlanMapping().getMappedProg(n.getID());
@@ -2010,7 +1957,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteSetSparkEagerRDDCaching(OptNode n, LocalVariableMap vars)
- throws DMLRuntimeException
{
//get program blocks of root parfor
Object[] progobj = OptTreeConverter.getAbstractPlanMapping().getMappedProg(n.getID());
@@ -2021,7 +1967,7 @@ public class OptimizerRuleBased extends Optimizer
if( OptimizerUtils.isSparkExecutionMode() //spark exec mode
&& n.getExecType() == ExecType.CP //local parfor
- && _N > 1 ) //at least 2 iterations
+ && _N > 1 ) //at least 2 iterations
{
Set<String> cand = pfsb.variablesRead().getVariableNames();
Collection<String> rpVars = pfpb.getSparkRepartitionVariables();
@@ -2061,10 +2007,9 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteRemoveUnnecessaryCompareMatrix( OptNode n, ExecutionContext ec )
- throws DMLRuntimeException
{
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
- .getAbstractPlanMapping().getMappedProg(n.getID())[1];
+ .getAbstractPlanMapping().getMappedProg(n.getID())[1];
ArrayList<ResultVar> cleanedVars = new ArrayList<>();
ArrayList<ResultVar> resultVars = pfpb.getResultVariables();
@@ -2095,26 +2040,19 @@ public class OptimizerRuleBased extends Optimizer
+" ("+ProgramConverter.serializeResultVariables(cleanedVars)+")" );
}
- protected boolean rContainsResultFullReplace( OptNode n, String resultVar, String iterVarname, MatrixObject mo )
- throws DMLRuntimeException
- {
+ protected boolean rContainsResultFullReplace( OptNode n, String resultVar, String iterVarname, MatrixObject mo ) {
boolean ret = false;
-
//process hop node
if( n.getNodeType()==NodeType.HOP )
ret |= isResultFullReplace(n, resultVar, iterVarname, mo);
-
//process childs recursively
- if( !n.isLeaf() ) {
+ if( !n.isLeaf() )
for( OptNode c : n.getChilds() )
ret |= rContainsResultFullReplace(c, resultVar, iterVarname, mo);
- }
-
return ret;
}
protected boolean isResultFullReplace( OptNode n, String resultVar, String iterVarname, MatrixObject mo )
- throws DMLRuntimeException
{
//check left indexing operator
String opStr = n.getParam(ParamType.OPSTRING);
@@ -2181,9 +2119,7 @@ public class OptimizerRuleBased extends Optimizer
//REWRITE set result merge
///
- protected void rewriteSetResultMerge( OptNode n, LocalVariableMap vars, boolean inLocal )
- throws DMLRuntimeException
- {
+ protected void rewriteSetResultMerge( OptNode n, LocalVariableMap vars, boolean inLocal ) {
ParForProgramBlock pfpb = (ParForProgramBlock) OptTreeConverter
.getAbstractPlanMapping().getMappedProg(n.getID())[1];
@@ -2267,7 +2203,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean hasResultMRLeftIndexing( OptNode n, ArrayList<ResultVar> resultVars, LocalVariableMap vars, boolean checkSize )
- throws DMLRuntimeException
{
boolean ret = false;
@@ -2312,10 +2247,8 @@ public class OptimizerRuleBased extends Optimizer
* @param vars local variable map
* @param checkSize ?
* @return true if result sizes larger than local memory budget
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected boolean hasLargeTotalResults( OptNode pn, ArrayList<ResultVar> resultVars, LocalVariableMap vars, boolean checkSize )
- throws DMLRuntimeException
{
double totalSize = 0;
@@ -2370,7 +2303,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected boolean hasOnlyInMemoryResults( OptNode n, ArrayList<ResultVar> resultVars, LocalVariableMap vars, boolean inLocal )
- throws DMLRuntimeException
{
boolean ret = true;
@@ -2404,9 +2336,7 @@ public class OptimizerRuleBased extends Optimizer
return ret;
}
- protected void rInvokeSetResultMerge( Collection<OptNode> nodes, LocalVariableMap vars, boolean inLocal)
- throws DMLRuntimeException
- {
+ protected void rInvokeSetResultMerge( Collection<OptNode> nodes, LocalVariableMap vars, boolean inLocal) {
for( OptNode n : nodes )
if( n.getNodeType() == NodeType.PARFOR )
{
@@ -2461,7 +2391,6 @@ public class OptimizerRuleBased extends Optimizer
///
protected void rewriteRemoveRecursiveParFor(OptNode n, LocalVariableMap vars)
- throws DMLRuntimeException
{
int count = 0; //num removed parfor
@@ -2514,7 +2443,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected void rFindAndUnfoldRecursiveFunction( OptNode n, ParForProgramBlock parfor, HashSet<ParForProgramBlock> recPBs, LocalVariableMap vars )
- throws DMLRuntimeException, HopsException, LanguageException
{
//unfold if found
if( n.getNodeType() == NodeType.FUNCCALL && n.isRecursive())
@@ -2616,7 +2544,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected void rReplaceFunctionNames( OptNode n, String oldName, String newName )
- throws DMLRuntimeException, HopsException
{
if( n.getNodeType() == NodeType.FUNCCALL)
{
@@ -2659,7 +2586,6 @@ public class OptimizerRuleBased extends Optimizer
}
protected int removeRecursiveParFor( OptNode n, HashSet<ParForProgramBlock> recPBs )
- throws DMLRuntimeException
{
int count = 0;
@@ -2705,18 +2631,13 @@ public class OptimizerRuleBased extends Optimizer
//REWRITE remove unnecessary parfor
///
- protected void rewriteRemoveUnnecessaryParFor(OptNode n)
- throws DMLRuntimeException
- {
+ protected void rewriteRemoveUnnecessaryParFor(OptNode n) {
int count = removeUnnecessaryParFor( n );
-
_numEvaluatedPlans++;
LOG.debug(getOptMode()+" OPT: rewrite 'remove unnecessary parfor' - result="+count );
}
- protected int removeUnnecessaryParFor( OptNode n )
- throws DMLRuntimeException
- {
+ protected int removeUnnecessaryParFor( OptNode n ) {
int count = 0;
if( !n.isLeaf() )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/ProgramRecompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/ProgramRecompiler.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/ProgramRecompiler.java
index 71295b4..ff954bf 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/ProgramRecompiler.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/ProgramRecompiler.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import org.apache.sysml.conf.ConfigurationManager;
import org.apache.sysml.conf.DMLConfig;
import org.apache.sysml.hops.Hop;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.hops.IndexingOp;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.hops.codegen.SpoofCompiler;
@@ -94,10 +93,8 @@ public class ProgramRecompiler
* @param var variable
* @param ec execution context
* @param force if true, set and recompile the respective indexing hops
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static void rFindAndRecompileIndexingHOP( StatementBlock sb, ProgramBlock pb, String var, ExecutionContext ec, boolean force )
- throws DMLRuntimeException
{
if( pb instanceof IfProgramBlock && sb instanceof IfStatementBlock )
{
@@ -200,9 +197,7 @@ public class ProgramRecompiler
}
}
- public static LocalVariableMap getReusableScalarVariables( DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars )
- throws DMLRuntimeException
- {
+ public static LocalVariableMap getReusableScalarVariables( DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars ) {
LocalVariableMap constVars = new LocalVariableMap();
for( String varname : vars.keySet() )
@@ -219,7 +214,6 @@ public class ProgramRecompiler
}
public static void replaceConstantScalarVariables( StatementBlock sb, LocalVariableMap vars )
- throws DMLRuntimeException, HopsException
{
if( sb instanceof IfStatementBlock )
{
@@ -262,9 +256,7 @@ public class ProgramRecompiler
}
}
- private static void replacePredicateLiterals( Hop pred, LocalVariableMap vars )
- throws DMLRuntimeException
- {
+ private static void replacePredicateLiterals( Hop pred, LocalVariableMap vars ) {
if( pred != null ){
pred.resetVisitStatus();
Recompiler.rReplaceLiterals(pred, vars, true);
@@ -281,40 +273,30 @@ public class ProgramRecompiler
* @param parforSB parfor statement block
* @param var variable
* @return true if can reuse variable
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static boolean isApplicableForReuseVariable( DMLProgram prog, StatementBlock parforSB, String var )
- throws DMLRuntimeException
- {
+ public static boolean isApplicableForReuseVariable( DMLProgram prog, StatementBlock parforSB, String var ) {
boolean ret = false;
-
for( StatementBlock sb : prog.getStatementBlocks() )
ret |= isApplicableForReuseVariable(sb, parforSB, var);
-
- return ret;
+ return ret;
}
- private static boolean isApplicableForReuseVariable( StatementBlock sb, StatementBlock parforSB, String var )
- throws DMLRuntimeException
- {
+ private static boolean isApplicableForReuseVariable( StatementBlock sb, StatementBlock parforSB, String var ) {
boolean ret = false;
- if( sb instanceof IfStatementBlock )
- {
+ if( sb instanceof IfStatementBlock ) {
IfStatement is = (IfStatement) sb.getStatement(0);
for( StatementBlock lsb : is.getIfBody() )
ret |= isApplicableForReuseVariable(lsb, parforSB, var);
for( StatementBlock lsb : is.getElseBody() )
ret |= isApplicableForReuseVariable(lsb, parforSB, var);
}
- else if( sb instanceof WhileStatementBlock )
- {
+ else if( sb instanceof WhileStatementBlock ) {
WhileStatement ws = (WhileStatement) sb.getStatement(0);
for( StatementBlock lsb : ws.getBody() )
- ret |= isApplicableForReuseVariable(lsb, parforSB, var);
+ ret |= isApplicableForReuseVariable(lsb, parforSB, var);
}
- else if( sb instanceof ForStatementBlock ) //for or parfor
- {
+ else if( sb instanceof ForStatementBlock ) { //for or parfor
ForStatementBlock fsb = (ForStatementBlock)sb;
ForStatement fs = (ForStatement) fsb.getStatement(0);
if( fsb == parforSB ) {
@@ -326,8 +308,7 @@ public class ProgramRecompiler
ret |= isApplicableForReuseVariable(lsb, parforSB, var);
}
}
-
- return ret && !sb.variablesUpdated().containsVariable(var);
+ return ret && !sb.variablesUpdated().containsVariable(var);
}
public static boolean containsAtLeastOneFunction( ProgramBlock pb )
@@ -368,7 +349,6 @@ public class ProgramRecompiler
}
private static ArrayList<Instruction> rFindAndRecompileIndexingHOP( Hop hop, ArrayList<Instruction> in, String var, ExecutionContext ec, boolean force )
- throws DMLRuntimeException
{
ArrayList<Instruction> tmp = in;
@@ -468,9 +448,7 @@ public class ProgramRecompiler
///////
// additional general-purpose functionalities
- protected static ArrayList<Instruction> createNestedParallelismToInstructionSet(String iterVar, String offset)
- throws DMLRuntimeException
- {
+ protected static ArrayList<Instruction> createNestedParallelismToInstructionSet(String iterVar, String offset) {
//create instruction string
StringBuilder sb = new StringBuilder("CP"+Lop.OPERAND_DELIMITOR+"+"+Lop.OPERAND_DELIMITOR);
sb.append(iterVar);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/FrameReader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/FrameReader.java b/src/main/java/org/apache/sysml/runtime/io/FrameReader.java
index 584ff4d..66589d8 100644
--- a/src/main/java/org/apache/sysml/runtime/io/FrameReader.java
+++ b/src/main/java/org/apache/sysml/runtime/io/FrameReader.java
@@ -94,10 +94,9 @@ public abstract class FrameReader
* @param nrow number of rows
* @return frame block
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected static FrameBlock createOutputFrameBlock(ValueType[] schema, String[] names, long nrow)
- throws IOException, DMLRuntimeException
+ throws IOException
{
//check schema and column names
if( !OptimizerUtils.isValidCPDimensions(schema, names) )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/FrameReaderFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/FrameReaderFactory.java b/src/main/java/org/apache/sysml/runtime/io/FrameReaderFactory.java
index efb4014..0f9d634 100644
--- a/src/main/java/org/apache/sysml/runtime/io/FrameReaderFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/io/FrameReaderFactory.java
@@ -29,18 +29,13 @@ import org.apache.sysml.runtime.matrix.data.InputInfo;
public class FrameReaderFactory
{
- public static FrameReader createFrameReader( InputInfo iinfo )
- throws DMLRuntimeException
- {
+ public static FrameReader createFrameReader( InputInfo iinfo ) {
FileFormatProperties props = (iinfo==InputInfo.CSVInputInfo) ?
- new CSVFileFormatProperties() : null;
-
+ new CSVFileFormatProperties() : null;
return createFrameReader(iinfo, props);
}
- public static FrameReader createFrameReader( InputInfo iinfo, FileFormatProperties props )
- throws DMLRuntimeException
- {
+ public static FrameReader createFrameReader( InputInfo iinfo, FileFormatProperties props ) {
FrameReader reader = null;
if( iinfo == InputInfo.TextCellInputInfo ) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/FrameWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/FrameWriter.java b/src/main/java/org/apache/sysml/runtime/io/FrameWriter.java
index a4ffaba..2b44829 100644
--- a/src/main/java/org/apache/sysml/runtime/io/FrameWriter.java
+++ b/src/main/java/org/apache/sysml/runtime/io/FrameWriter.java
@@ -38,9 +38,7 @@ public abstract class FrameWriter
public abstract void writeFrameToHDFS( FrameBlock src, String fname, long rlen, long clen )
throws IOException, DMLRuntimeException;
- public static FrameBlock[] createFrameBlocksForReuse( ValueType[] schema, String[] names, long rlen )
- throws DMLRuntimeException
- {
+ public static FrameBlock[] createFrameBlocksForReuse( ValueType[] schema, String[] names, long rlen ) {
FrameBlock frameBlock[] = new FrameBlock[1];
frameBlock[0] = new FrameBlock(schema, names);
return frameBlock;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/FrameWriterBinaryBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/FrameWriterBinaryBlock.java b/src/main/java/org/apache/sysml/runtime/io/FrameWriterBinaryBlock.java
index d6b12c9..3425a8d 100644
--- a/src/main/java/org/apache/sysml/runtime/io/FrameWriterBinaryBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/io/FrameWriterBinaryBlock.java
@@ -82,12 +82,11 @@ public class FrameWriterBinaryBlock extends FrameWriter
* @param blen block length
* @param rl lower row
* @param ru upper row
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws IOException if IOException occurs
*/
@SuppressWarnings("deprecation")
protected static void writeBinaryBlockFrameToSequenceFile( Path path, JobConf job, FileSystem fs, FrameBlock src, int blen, int rl, int ru )
- throws DMLRuntimeException, IOException
+ throws IOException
{
//1) create sequence file writer
SequenceFile.Writer writer = null;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/FrameWriterFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/FrameWriterFactory.java b/src/main/java/org/apache/sysml/runtime/io/FrameWriterFactory.java
index 3555a38..df1ed89 100644
--- a/src/main/java/org/apache/sysml/runtime/io/FrameWriterFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/io/FrameWriterFactory.java
@@ -28,15 +28,11 @@ import org.apache.sysml.runtime.matrix.data.OutputInfo;
public class FrameWriterFactory
{
-
- public static FrameWriter createFrameWriter( OutputInfo oinfo )
- throws DMLRuntimeException
- {
+ public static FrameWriter createFrameWriter( OutputInfo oinfo ) {
return createFrameWriter(oinfo, null);
}
public static FrameWriter createFrameWriter( OutputInfo oinfo, FileFormatProperties props )
- throws DMLRuntimeException
{
FrameWriter writer = null;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/MatrixReader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/MatrixReader.java b/src/main/java/org/apache/sysml/runtime/io/MatrixReader.java
index 513a741..f9df756 100644
--- a/src/main/java/org/apache/sysml/runtime/io/MatrixReader.java
+++ b/src/main/java/org/apache/sysml/runtime/io/MatrixReader.java
@@ -69,11 +69,10 @@ public abstract class MatrixReader
* @param mallocSparse if true and sparse, allocate sparse rows block
* @return matrix block
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected static MatrixBlock createOutputMatrixBlock( long rlen, long clen,
int bclen, int brlen, long estnnz, boolean mallocDense, boolean mallocSparse )
- throws IOException, DMLRuntimeException
+ throws IOException
{
//check input dimension
if( !OptimizerUtils.isValidCPDimensions(rlen, clen) )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/MatrixReaderFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/MatrixReaderFactory.java b/src/main/java/org/apache/sysml/runtime/io/MatrixReaderFactory.java
index d35e856..68a1d2b 100644
--- a/src/main/java/org/apache/sysml/runtime/io/MatrixReaderFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/io/MatrixReaderFactory.java
@@ -31,7 +31,6 @@ public class MatrixReaderFactory
{
public static MatrixReader createMatrixReader( InputInfo iinfo )
- throws DMLRuntimeException
{
MatrixReader reader = null;
@@ -66,7 +65,6 @@ public class MatrixReaderFactory
}
public static MatrixReader createMatrixReader( ReadProperties props )
- throws DMLRuntimeException
{
//check valid read properties
if( props == null )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/MatrixWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/MatrixWriter.java b/src/main/java/org/apache/sysml/runtime/io/MatrixWriter.java
index 67dd8c2..45ba2d9 100644
--- a/src/main/java/org/apache/sysml/runtime/io/MatrixWriter.java
+++ b/src/main/java/org/apache/sysml/runtime/io/MatrixWriter.java
@@ -46,13 +46,11 @@ public abstract class MatrixWriter
* @param brlen number of rows in block
* @param bclen number of columns in block
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public abstract void writeEmptyMatrixToHDFS( String fname, long rlen, long clen, int brlen, int bclen )
- throws IOException, DMLRuntimeException;
+ throws IOException;
public static MatrixBlock[] createMatrixBlocksForReuse( long rlen, long clen, int brlen, int bclen, boolean sparse, long nonZeros )
- throws DMLRuntimeException
{
MatrixBlock[] blocks = new MatrixBlock[4];
double sparsity = ((double)nonZeros)/(rlen*clen);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/MatrixWriterFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/MatrixWriterFactory.java b/src/main/java/org/apache/sysml/runtime/io/MatrixWriterFactory.java
index 930c241..f5a93bb 100644
--- a/src/main/java/org/apache/sysml/runtime/io/MatrixWriterFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/io/MatrixWriterFactory.java
@@ -29,14 +29,11 @@ import org.apache.sysml.runtime.matrix.data.OutputInfo;
public class MatrixWriterFactory
{
- public static MatrixWriter createMatrixWriter( OutputInfo oinfo )
- throws DMLRuntimeException
- {
+ public static MatrixWriter createMatrixWriter( OutputInfo oinfo ) {
return createMatrixWriter(oinfo, -1, null);
}
public static MatrixWriter createMatrixWriter( OutputInfo oinfo, int replication, FileFormatProperties props )
- throws DMLRuntimeException
{
MatrixWriter writer = null;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/ReaderBinaryBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/ReaderBinaryBlock.java b/src/main/java/org/apache/sysml/runtime/io/ReaderBinaryBlock.java
index 98edac4..a0c1ca3 100644
--- a/src/main/java/org/apache/sysml/runtime/io/ReaderBinaryBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/io/ReaderBinaryBlock.java
@@ -135,10 +135,9 @@ public class ReaderBinaryBlock extends MatrixReader
* @param brlen number of rows in block
* @param bclen number of columns in block
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private static void readBinaryBlockMatrixFromHDFS( Path path, JobConf job, FileSystem fs, MatrixBlock dest, long rlen, long clen, int brlen, int bclen )
- throws IOException, DMLRuntimeException
+ throws IOException
{
boolean sparse = dest.isInSparseFormat();
MatrixIndexes key = new MatrixIndexes();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/io/WriterBinaryBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/WriterBinaryBlock.java b/src/main/java/org/apache/sysml/runtime/io/WriterBinaryBlock.java
index c9cea0f..59fe573 100644
--- a/src/main/java/org/apache/sysml/runtime/io/WriterBinaryBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/io/WriterBinaryBlock.java
@@ -103,7 +103,7 @@ public class WriterBinaryBlock extends MatrixWriter
@SuppressWarnings("deprecation")
protected final void writeBinaryBlockMatrixToSequenceFile( Path path, JobConf job, FileSystem fs, MatrixBlock src, int brlen, int bclen, int rl, int ru )
- throws DMLRuntimeException, IOException
+ throws IOException
{
boolean sparse = src.isInSparseFormat();
int rlen = src.getNumRows();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/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 78c01fa..bfb394f 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
@@ -312,11 +312,8 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab
* @param arr double array matrix
* @param r number of rows
* @param c number of columns
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void init(double[] arr, int r, int c)
- throws DMLRuntimeException
- {
+ public void init(double[] arr, int r, int c) {
//input checks
if ( sparse )
throw new DMLRuntimeException("MatrixBlockDSM.init() can be invoked only on matrices with dense representation.");
@@ -332,8 +329,7 @@ public class MatrixBlock extends MatrixValue implements CacheBlock, Externalizab
}
public boolean isAllocated() {
- return sparse ? (sparseBlock!=null)
- : (denseBlock!=null);
+ return sparse ? (sparseBlock!=null) : (denseBlock!=null);
}
public MatrixBlock allocateDenseBlock() {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/transform/decode/DecoderFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/transform/decode/DecoderFactory.java b/src/main/java/org/apache/sysml/runtime/transform/decode/DecoderFactory.java
index 19aca0f..d8b9f3a 100644
--- a/src/main/java/org/apache/sysml/runtime/transform/decode/DecoderFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/transform/decode/DecoderFactory.java
@@ -38,8 +38,7 @@ public class DecoderFactory
{
@SuppressWarnings("unchecked")
public static Decoder createDecoder(String spec, String[] colnames, ValueType[] schema, FrameBlock meta)
- throws DMLRuntimeException
- {
+ {
Decoder decoder = null;
try
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java b/src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java
index a1cc0d0..3914f11 100644
--- a/src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/transform/encode/EncoderFactory.java
@@ -36,19 +36,17 @@ import org.apache.wink.json4j.JSONObject;
public class EncoderFactory
{
- public static Encoder createEncoder(String spec, String[] colnames, int clen, FrameBlock meta) throws DMLRuntimeException {
+ public static Encoder createEncoder(String spec, String[] colnames, int clen, FrameBlock meta) {
return createEncoder(spec, colnames, UtilFunctions.nCopies(clen, ValueType.STRING), meta);
}
- public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, int clen, FrameBlock meta) throws DMLRuntimeException {
+ public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, int clen, FrameBlock meta) {
ValueType[] lschema = (schema==null) ? UtilFunctions.nCopies(clen, ValueType.STRING) : schema;
return createEncoder(spec, colnames, lschema, meta);
}
@SuppressWarnings("unchecked")
- public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, FrameBlock meta)
- throws DMLRuntimeException
- {
+ public static Encoder createEncoder(String spec, String[] colnames, ValueType[] schema, FrameBlock meta) {
Encoder encoder = null;
int clen = schema.length;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java b/src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java
index e8d512e..9242d4a 100644
--- a/src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java
+++ b/src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java
@@ -50,7 +50,7 @@ import org.apache.wink.json4j.JSONObject;
public class TfMetaUtils
{
- public static boolean isIDSpec(String spec) throws DMLRuntimeException {
+ public static boolean isIDSpec(String spec) {
try {
JSONObject jSpec = new JSONObject(spec);
return isIDSpec(jSpec);
@@ -64,13 +64,11 @@ public class TfMetaUtils
return spec.containsKey("ids") && spec.getBoolean("ids");
}
- public static boolean containsOmitSpec(String spec, String[] colnames) throws DMLRuntimeException {
+ public static boolean containsOmitSpec(String spec, String[] colnames) {
return (TfMetaUtils.parseJsonIDList(spec, colnames, TfUtils.TXMETHOD_OMIT).length > 0);
}
- public static int[] parseJsonIDList(String spec, String[] colnames, String group)
- throws DMLRuntimeException
- {
+ public static int[] parseJsonIDList(String spec, String[] colnames, String group) {
try {
JSONObject jSpec = new JSONObject(spec);
return parseJsonIDList(jSpec, colnames, group);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/util/ConvolutionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/util/ConvolutionUtils.java b/src/main/java/org/apache/sysml/runtime/util/ConvolutionUtils.java
index 9800773..bf66681 100644
--- a/src/main/java/org/apache/sysml/runtime/util/ConvolutionUtils.java
+++ b/src/main/java/org/apache/sysml/runtime/util/ConvolutionUtils.java
@@ -21,7 +21,6 @@ package org.apache.sysml.runtime.util;
import java.util.Arrays;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
@@ -70,7 +69,7 @@ public class ConvolutionUtils {
return ret;
}
- public static void fillBias(MatrixBlock bias, double [] outputArray, int src_rl, int src_ru, int N, int K, int PQ) throws DMLRuntimeException {
+ public static void fillBias(MatrixBlock bias, double [] outputArray, int src_rl, int src_ru, int N, int K, int PQ) {
// bias.getNumColumns() == 1 checked outside
if(bias.isInSparseFormat()) {
for(int k = 0; k < K; k++) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/util/DataConverter.java b/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
index 83b8149..82eee9d 100644
--- a/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
+++ b/src/main/java/org/apache/sysml/runtime/util/DataConverter.java
@@ -410,11 +410,8 @@ public class DataConverter
*
* @param data 2d double array
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static MatrixBlock convertToMatrixBlock( double[][] data )
- throws DMLRuntimeException
- {
+ public static MatrixBlock convertToMatrixBlock( double[][] data ) {
int rows = data.length;
int cols = (rows > 0)? data[0].length : 0;
MatrixBlock mb = new MatrixBlock(rows, cols, false);
@@ -437,25 +434,14 @@ public class DataConverter
* @param data double array
* @param columnVector if true, create matrix with single column. if false, create matrix with single row
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static MatrixBlock convertToMatrixBlock( double[] data, boolean columnVector )
- throws DMLRuntimeException
- {
+ public static MatrixBlock convertToMatrixBlock( double[] data, boolean columnVector ) {
int rows = columnVector ? data.length : 1;
int cols = columnVector ? 1 : data.length;
MatrixBlock mb = new MatrixBlock(rows, cols, false);
-
- try
- {
- //copy data to mb (can be used because we create a dense matrix)
- mb.init( data, rows, cols );
- }
- catch (Exception e){} //can never happen
-
- //check and convert internal representation
+ //copy data to mb (can be used because we create a dense matrix)
+ mb.init( data, rows, cols );
mb.examSparsity();
-
return mb;
}
@@ -551,10 +537,8 @@ public class DataConverter
*
* @param frame frame block
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static MatrixBlock convertToMatrixBlock(FrameBlock frame)
- throws DMLRuntimeException
{
int m = frame.getNumRows();
int n = frame.getNumColumns();
@@ -744,7 +728,6 @@ public class DataConverter
}
public static MatrixBlock[] convertToMatrixBlockPartitions( MatrixBlock mb, boolean colwise )
- throws DMLRuntimeException
{
MatrixBlock[] ret = null;
int rows = mb.getNumRows();
@@ -799,11 +782,8 @@ public class DataConverter
*
* @param mo matrix object
* @return matrix as a commons-math3 Array2DRowRealMatrix
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static Array2DRowRealMatrix convertToArray2DRowRealMatrix(MatrixObject mo)
- throws DMLRuntimeException
- {
+ public static Array2DRowRealMatrix convertToArray2DRowRealMatrix(MatrixObject mo) {
MatrixBlock mb = mo.acquireRead();
double[][] data = DataConverter.convertToDoubleMatrix(mb);
mo.release();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/util/LocalFileUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/util/LocalFileUtils.java b/src/main/java/org/apache/sysml/runtime/util/LocalFileUtils.java
index deda468..b1a466e 100644
--- a/src/main/java/org/apache/sysml/runtime/util/LocalFileUtils.java
+++ b/src/main/java/org/apache/sysml/runtime/util/LocalFileUtils.java
@@ -369,19 +369,18 @@ public class LocalFileUtils
///
public static String checkAndCreateStagingDir(String dir) {
- File f = new File(dir);
+ File f = new File(dir);
if( !f.exists() )
f.mkdirs();
return dir;
}
- public static String createWorkingDirectory() throws DMLRuntimeException {
+ public static String createWorkingDirectory() {
return createWorkingDirectoryWithUUID( DMLScript.getUUID() );
}
public static String createWorkingDirectoryWithUUID(String uuid)
- throws DMLRuntimeException
{
//create local tmp dir if not existing
String dirRoot = null;
@@ -389,7 +388,7 @@ public class LocalFileUtils
if( conf != null )
dirRoot = conf.getTextValue(DMLConfig.LOCAL_TMP_DIR);
else
- dirRoot = DMLConfig.getDefaultTextValue(DMLConfig.LOCAL_TMP_DIR);
+ dirRoot = DMLConfig.getDefaultTextValue(DMLConfig.LOCAL_TMP_DIR);
//create shared staging dir if not existing
if( !LocalFileUtils.createLocalFileIfNotExist(dirRoot, DMLConfig.DEFAULT_SHARED_DIR_PERMISSION) ){
@@ -477,27 +476,20 @@ public class LocalFileUtils
return count;
}
- public static String getWorkingDir(String category)
- throws DMLRuntimeException
- {
+ public static String getWorkingDir(String category) {
if( _workingDir == null )
createWorkingDirectory();
-
StringBuilder sb = new StringBuilder();
sb.append( _workingDir );
sb.append( Lop.FILE_SEPARATOR );
sb.append( category );
sb.append( Lop.FILE_SEPARATOR );
-
return sb.toString();
}
- public static String getUniqueWorkingDir(String category)
- throws DMLRuntimeException
- {
+ public static String getUniqueWorkingDir(String category) {
if( _workingDir == null )
createWorkingDirectory();
-
StringBuilder sb = new StringBuilder();
sb.append( _workingDir );
sb.append( Lop.FILE_SEPARATOR );
@@ -505,7 +497,6 @@ public class LocalFileUtils
sb.append( Lop.FILE_SEPARATOR );
sb.append( "tmp" );
sb.append( _seq.getNextID() );
-
return sb.toString();
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/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 bfa76ba..0c21982 100644
--- a/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
+++ b/src/main/java/org/apache/sysml/udf/ExternalFunctionInvocationInstruction.java
@@ -67,15 +67,11 @@ public class ExternalFunctionInvocationInstruction extends Instruction
}
@Override
- public void processInstruction(ExecutionContext ec)
- throws DMLRuntimeException
- {
+ public void processInstruction(ExecutionContext ec) {
// get the inputs, wrapped into external data types
fun.setFunctionInputs(getInputObjects(inputs, ec.getVariables()));
-
//executes function
fun.execute(ec);
-
// get and verify the outputs
verifyAndAttachOutputs(ec, fun, outputs);
}
@@ -122,7 +118,6 @@ public class ExternalFunctionInvocationInstruction extends Instruction
}
private void verifyAndAttachOutputs(ExecutionContext ec, PackageFunction fun, CPOperand[] outputs)
- throws DMLRuntimeException
{
for( int i = 0; i < outputs.length; i++) {
CPOperand output = outputs[i];
@@ -161,8 +156,7 @@ public class ExternalFunctionInvocationInstruction extends Instruction
}
}
- private MatrixObject createOutputMatrixObject(Matrix m) throws DMLRuntimeException
- {
+ private MatrixObject createOutputMatrixObject(Matrix m) {
MatrixObject ret = m.getMatrixObject();
if( ret == null ) { //otherwise, pass in-memory matrix from extfunct back to invoking program
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/udf/Matrix.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/udf/Matrix.java b/src/main/java/org/apache/sysml/udf/Matrix.java
index 2fae725..dc4a353 100644
--- a/src/main/java/org/apache/sysml/udf/Matrix.java
+++ b/src/main/java/org/apache/sysml/udf/Matrix.java
@@ -24,7 +24,6 @@ import java.io.IOException;
import org.apache.sysml.conf.ConfigurationManager;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.parser.Expression;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
import org.apache.sysml.runtime.io.MatrixReader;
import org.apache.sysml.runtime.io.MatrixReaderFactory;
@@ -147,12 +146,9 @@ public class Matrix extends FunctionParameter
* representation.
*
* @return matrix as two-dimensional double array
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws IOException if IOException occurs
*/
- public double[][] getMatrixAsDoubleArray()
- throws DMLRuntimeException, IOException
- {
+ public double[][] getMatrixAsDoubleArray() throws IOException {
double[][] ret = null;
if( _mo != null ) { //CP ext function
@@ -177,11 +173,8 @@ public class Matrix extends FunctionParameter
*
* @param data matrix as 2-dimensional double array
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void setMatrixDoubleArray(double[][] data /*, OutputInfo oinfo, InputInfo iinfo*/)
- throws IOException, DMLRuntimeException
- {
+ public void setMatrixDoubleArray(double[][] data) throws IOException {
MatrixBlock mb = DataConverter.convertToMatrixBlock(data);
setMatrixDoubleArray(mb, OutputInfo.BinaryBlockOutputInfo, InputInfo.BinaryBlockInputInfo);
}
@@ -193,11 +186,8 @@ public class Matrix extends FunctionParameter
*
* @param data matrix as double array
* @throws IOException if IOException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void setMatrixDoubleArray(double[] data /*, OutputInfo oinfo, InputInfo iinfo*/)
- throws IOException, DMLRuntimeException
- {
+ public void setMatrixDoubleArray(double[] data) throws IOException {
MatrixBlock mb = DataConverter.convertToMatrixBlock(data, true);
setMatrixDoubleArray(mb, OutputInfo.BinaryBlockOutputInfo, InputInfo.BinaryBlockInputInfo);
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/utils/Explain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/utils/Explain.java b/src/main/java/org/apache/sysml/utils/Explain.java
index 12f4d0f..c7731c0 100644
--- a/src/main/java/org/apache/sysml/utils/Explain.java
+++ b/src/main/java/org/apache/sysml/utils/Explain.java
@@ -52,7 +52,6 @@ import org.apache.sysml.parser.ParForStatementBlock;
import org.apache.sysml.parser.StatementBlock;
import org.apache.sysml.parser.WhileStatement;
import org.apache.sysml.parser.WhileStatementBlock;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ExternalFunctionProgramBlock;
import org.apache.sysml.runtime.controlprogram.ForProgramBlock;
import org.apache.sysml.runtime.controlprogram.FunctionProgramBlock;
@@ -406,25 +405,18 @@ public class Explain
return sb.toString();
}
- public static String explain( Hop hop )
- throws DMLRuntimeException
- {
+ public static String explain( Hop hop ) {
return explain(hop, 0);
}
- public static String explain( Hop hop, int level )
- throws DMLRuntimeException
- {
+ public static String explain( Hop hop, int level ) {
hop.resetVisitStatus();
String ret = explainHop(hop, level);
hop.resetVisitStatus();
-
return ret;
}
- public static String explainCPlan( CNodeTpl cplan )
- throws DMLRuntimeException
- {
+ public static String explainCPlan( CNodeTpl cplan ) {
StringBuilder sb = new StringBuilder();
//create template header
@@ -446,11 +438,11 @@ public class Explain
return sb.toString();
}
- public static String explain( CNode node ) throws DMLRuntimeException {
+ public static String explain( CNode node ) {
return explain(node, 0);
}
- public static String explain( CNode node, int level ) throws DMLRuntimeException {
+ public static String explain( CNode node, int level ) {
return explainCNode(node, level);
}
@@ -691,11 +683,8 @@ public class Explain
* @param hop high-level operator
* @param level offset
* @return string explanation of Hop DAG
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- private static String explainHop(Hop hop, int level)
- throws DMLRuntimeException
- {
+ private static String explainHop(Hop hop, int level) {
if( hop.isVisited() || (!SHOW_LITERAL_HOPS && hop instanceof LiteralOp) )
return "";
@@ -780,8 +769,7 @@ public class Explain
return isInRange;
}
- private static StringBuilder getHopDAG(Hop hop, StringBuilder nodes, ArrayList<Integer> lines, boolean withSubgraph)
- throws DMLRuntimeException {
+ private static StringBuilder getHopDAG(Hop hop, StringBuilder nodes, ArrayList<Integer> lines, boolean withSubgraph) {
StringBuilder sb = new StringBuilder();
if (hop.isVisited() || (!SHOW_LITERAL_HOPS && hop instanceof LiteralOp))
return sb;
@@ -901,9 +889,7 @@ public class Explain
//////////////
// internal explain CNODE
- private static String explainCNode(CNode cnode, int level)
- throws DMLRuntimeException
- {
+ private static String explainCNode(CNode cnode, int level) {
if( cnode.isVisited() )
return "";
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/utils/NativeHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/utils/NativeHelper.java b/src/main/java/org/apache/sysml/utils/NativeHelper.java
index 25e9847..246c5bd 100644
--- a/src/main/java/org/apache/sysml/utils/NativeHelper.java
+++ b/src/main/java/org/apache/sysml/utils/NativeHelper.java
@@ -97,9 +97,8 @@ public class NativeHelper {
*
* @param customLibPath specified by sysml.native.blas.directory
* @param userSpecifiedBLAS specified by sysml.native.blas
- * @throws DMLRuntimeException if error
*/
- public static void initialize(String customLibPath, String userSpecifiedBLAS) throws DMLRuntimeException {
+ public static void initialize(String customLibPath, String userSpecifiedBLAS) {
if(isBLASLoaded() && isSupportedBLAS(userSpecifiedBLAS) && !blasType.equalsIgnoreCase(userSpecifiedBLAS)) {
throw new DMLRuntimeException("Cannot replace previously loaded blas \"" + blasType + "\" with \"" + userSpecifiedBLAS + "\".");
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/DMLAppMasterUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/DMLAppMasterUtils.java b/src/main/java/org/apache/sysml/yarn/DMLAppMasterUtils.java
index bd4a9a4..1c23a46 100644
--- a/src/main/java/org/apache/sysml/yarn/DMLAppMasterUtils.java
+++ b/src/main/java/org/apache/sysml/yarn/DMLAppMasterUtils.java
@@ -19,7 +19,6 @@
package org.apache.sysml.yarn;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -29,12 +28,9 @@ import org.apache.sysml.api.DMLScript;
import org.apache.sysml.conf.CompilerConfig;
import org.apache.sysml.conf.ConfigurationManager;
import org.apache.sysml.conf.DMLConfig;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.hops.OptimizerUtils.OptimizationLevel;
import org.apache.sysml.lops.Lop;
-import org.apache.sysml.lops.LopsException;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.Program;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
import org.apache.sysml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer;
@@ -59,7 +55,6 @@ public class DMLAppMasterUtils
}
public static void setupConfigRemoteMaxMemory(DMLConfig conf)
- throws DMLRuntimeException
{
//set remote max memory (if in yarn appmaster context)
if( DMLScript.isActiveAM() ){
@@ -96,9 +91,7 @@ public class DMLAppMasterUtils
}
}
- public static void setupProgramMappingRemoteMaxMemory(Program prog)
- throws DMLRuntimeException, HopsException, LopsException, IOException
- {
+ public static void setupProgramMappingRemoteMaxMemory(Program prog) {
if( DMLScript.isActiveAM() && isResourceOptimizerEnabled() )
{
ArrayList<ProgramBlock> pbProg = getRuntimeProgramBlocks( prog );
@@ -111,8 +104,7 @@ public class DMLAppMasterUtils
}
}
- public static void setupProgramBlockRemoteMaxMemory(ProgramBlock pb)
- {
+ public static void setupProgramBlockRemoteMaxMemory(ProgramBlock pb) {
if( DMLScript.isActiveAM() && isResourceOptimizerEnabled() )
{
if( _rcMap != null && _rcMap.containsKey(pb) ){
@@ -122,7 +114,7 @@ public class DMLAppMasterUtils
InfrastructureAnalyzer.setRemoteMaxMemoryReduce(mem);
OptimizerUtils.resetDefaultSize();
}
- }
+ }
}
public static void setupMRJobRemoteMaxMemory(JobConf job, DMLConfig conf)
@@ -152,30 +144,23 @@ public class DMLAppMasterUtils
}
}
- public static boolean isResourceOptimizerEnabled()
- {
+ public static boolean isResourceOptimizerEnabled() {
return ( DMLYarnClientProxy.RESOURCE_OPTIMIZER
- || OptimizerUtils.isOptLevel(OptimizationLevel.O3_LOCAL_RESOURCE_TIME_MEMORY) );
+ || OptimizerUtils.isOptLevel(OptimizationLevel.O3_LOCAL_RESOURCE_TIME_MEMORY) );
}
- protected static ArrayList<ProgramBlock> getRuntimeProgramBlocks(Program prog)
- throws DMLRuntimeException
- {
+ protected static ArrayList<ProgramBlock> getRuntimeProgramBlocks(Program prog) {
//construct single list of all program blocks including functions
ArrayList<ProgramBlock> ret = new ArrayList<>();
ret.addAll(prog.getProgramBlocks());
ret.addAll(prog.getFunctionProgramBlocks().values());
-
return ret;
}
- protected static void setupRemoteParallelTasks( YarnClusterConfig cc )
- {
+ protected static void setupRemoteParallelTasks( YarnClusterConfig cc ) {
int pmap = (int) cc.getNumCores();
int preduce = (int) cc.getNumCores()/2;
InfrastructureAnalyzer.setRemoteParallelMapTasks(pmap);
InfrastructureAnalyzer.setRemoteParallelReduceTasks(preduce);
}
-
-
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/GridEnumeration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumeration.java b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumeration.java
index d1a3877..f4cd626 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumeration.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumeration.java
@@ -21,7 +21,6 @@ package org.apache.sysml.yarn.ropt;
import java.util.ArrayList;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
@@ -32,9 +31,7 @@ public abstract class GridEnumeration
protected long _min = -1;
protected long _max = -1;
- public GridEnumeration( ArrayList<ProgramBlock> prog, long min, long max )
- throws DMLRuntimeException
- {
+ public GridEnumeration( ArrayList<ProgramBlock> prog, long min, long max ) {
if( min > max )
throw new DMLRuntimeException("Invalid parameters: min=" + min + ", max=" + max);
@@ -43,6 +40,5 @@ public abstract class GridEnumeration
_max = max;
}
- public abstract ArrayList<Long> enumerateGridPoints()
- throws DMLRuntimeException, HopsException;
+ public abstract ArrayList<Long> enumerateGridPoints();
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationEqui.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationEqui.java b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationEqui.java
index 7e7a09a..364db70 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationEqui.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationEqui.java
@@ -21,7 +21,6 @@ package org.apache.sysml.yarn.ropt;
import java.util.ArrayList;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
public class GridEnumerationEqui extends GridEnumeration
@@ -31,9 +30,7 @@ public class GridEnumerationEqui extends GridEnumeration
private int _nsteps = -1;
- public GridEnumerationEqui( ArrayList<ProgramBlock> prog, long min, long max )
- throws DMLRuntimeException
- {
+ public GridEnumerationEqui( ArrayList<ProgramBlock> prog, long min, long max ) {
super(prog, min, max);
_nsteps = DEFAULT_NSTEPS;
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationExp.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationExp.java b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationExp.java
index 922c60b..4516b2b 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationExp.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationExp.java
@@ -21,7 +21,6 @@ package org.apache.sysml.yarn.ropt;
import java.util.ArrayList;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
public class GridEnumerationExp extends GridEnumeration
@@ -31,9 +30,7 @@ public class GridEnumerationExp extends GridEnumeration
private double _factor = -1;
- public GridEnumerationExp( ArrayList<ProgramBlock> prog, long min, long max )
- throws DMLRuntimeException
- {
+ public GridEnumerationExp( ArrayList<ProgramBlock> prog, long min, long max ) {
super(prog, min, max);
_factor = DEFAULT_FACTOR;
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationHybrid.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationHybrid.java b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationHybrid.java
index beabc4e..53839b1 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationHybrid.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationHybrid.java
@@ -23,8 +23,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import org.apache.sysml.hops.HopsException;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
/**
@@ -33,16 +31,12 @@ import org.apache.sysml.runtime.controlprogram.ProgramBlock;
*/
public class GridEnumerationHybrid extends GridEnumeration
{
- public GridEnumerationHybrid( ArrayList<ProgramBlock> prog, long min, long max )
- throws DMLRuntimeException
- {
+ public GridEnumerationHybrid( ArrayList<ProgramBlock> prog, long min, long max ) {
super(prog, min, max);
}
@Override
- public ArrayList<Long> enumerateGridPoints()
- throws DMLRuntimeException, HopsException
- {
+ public ArrayList<Long> enumerateGridPoints() {
GridEnumeration ge1 = new GridEnumerationMemory(_prog, _min, _max);
GridEnumeration ge2 = new GridEnumerationExp(_prog, _min, _max);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationMemory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationMemory.java b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationMemory.java
index a295218..5d5e5d5 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationMemory.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/GridEnumerationMemory.java
@@ -24,10 +24,8 @@ import java.util.Collections;
import java.util.HashSet;
import org.apache.sysml.hops.Hop;
-import org.apache.sysml.hops.HopsException;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.parser.StatementBlock;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.ForProgramBlock;
import org.apache.sysml.runtime.controlprogram.FunctionProgramBlock;
import org.apache.sysml.runtime.controlprogram.IfProgramBlock;
@@ -42,9 +40,7 @@ public class GridEnumerationMemory extends GridEnumeration
private int _nsteps = -1;
- public GridEnumerationMemory( ArrayList<ProgramBlock> prog, long min, long max )
- throws DMLRuntimeException
- {
+ public GridEnumerationMemory( ArrayList<ProgramBlock> prog, long min, long max ) {
super(prog, min, max);
_nsteps = DEFAULT_NSTEPS;
}
@@ -54,9 +50,7 @@ public class GridEnumerationMemory extends GridEnumeration
}
@Override
- public ArrayList<Long> enumerateGridPoints()
- throws DMLRuntimeException, HopsException
- {
+ public ArrayList<Long> enumerateGridPoints() {
ArrayList<Long> ret = new ArrayList<>();
long gap = (long)(_max - _min) / (_nsteps-1);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/yarn/ropt/ResourceConfig.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/yarn/ropt/ResourceConfig.java b/src/main/java/org/apache/sysml/yarn/ropt/ResourceConfig.java
index 610fe79..129ab12 100644
--- a/src/main/java/org/apache/sysml/yarn/ropt/ResourceConfig.java
+++ b/src/main/java/org/apache/sysml/yarn/ropt/ResourceConfig.java
@@ -78,19 +78,15 @@ public class ResourceConfig
return ret;
}
- public void setMRResources( ArrayList<ProgramBlock> B, double[][] res )
- throws DMLRuntimeException
- {
+ public void setMRResources( ArrayList<ProgramBlock> B, double[][] res ) {
if( _mrres.size() != res.length )
throw new DMLRuntimeException("Memo table sizes do not match: "+_mrres.size()+" vs "+res.length);
-
int len = res.length;
for( int i=0; i<len; i++ )
_mrres.set(i, (long)res[i][0]);
}
- public long getMaxMRResource()
- {
+ public long getMaxMRResource() {
double val = (double) Collections.max(_mrres);
return (long)val;
}
[3/5] systemml git commit: [SYSTEMML-2191] Cleanup exception
hierarchy and handling, part 2
Posted by mb...@apache.org.
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/context/SparkExecutionContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/context/SparkExecutionContext.java b/src/main/java/org/apache/sysml/runtime/controlprogram/context/SparkExecutionContext.java
index fb268d4..f898f28 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/context/SparkExecutionContext.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/context/SparkExecutionContext.java
@@ -287,13 +287,11 @@ public class SparkExecutionContext extends ExecutionContext
*
* @param varname variable name
* @return JavaPairRDD of MatrixIndexes-MatrixBlocks
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
- public JavaPairRDD<MatrixIndexes,MatrixBlock> getBinaryBlockRDDHandleForVariable( String varname )
- throws DMLRuntimeException
- {
- return (JavaPairRDD<MatrixIndexes,MatrixBlock>) getRDDHandleForVariable( varname, InputInfo.BinaryBlockInputInfo);
+ public JavaPairRDD<MatrixIndexes,MatrixBlock> getBinaryBlockRDDHandleForVariable( String varname ) {
+ return (JavaPairRDD<MatrixIndexes,MatrixBlock>)
+ getRDDHandleForVariable( varname, InputInfo.BinaryBlockInputInfo);
}
/**
@@ -302,19 +300,15 @@ public class SparkExecutionContext extends ExecutionContext
*
* @param varname variable name
* @return JavaPairRDD of Longs-FrameBlocks
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
- public JavaPairRDD<Long,FrameBlock> getFrameBinaryBlockRDDHandleForVariable( String varname )
- throws DMLRuntimeException
- {
- JavaPairRDD<Long,FrameBlock> out = (JavaPairRDD<Long,FrameBlock>) getRDDHandleForVariable( varname, InputInfo.BinaryBlockInputInfo);
+ public JavaPairRDD<Long,FrameBlock> getFrameBinaryBlockRDDHandleForVariable( String varname ) {
+ JavaPairRDD<Long,FrameBlock> out = (JavaPairRDD<Long,FrameBlock>)
+ getRDDHandleForVariable( varname, InputInfo.BinaryBlockInputInfo);
return out;
}
- public JavaPairRDD<?,?> getRDDHandleForVariable( String varname, InputInfo inputInfo )
- throws DMLRuntimeException
- {
+ public JavaPairRDD<?,?> getRDDHandleForVariable( String varname, InputInfo inputInfo ) {
Data dat = getVariable(varname);
if( dat instanceof MatrixObject ) {
MatrixObject mo = getMatrixObject(varname);
@@ -336,12 +330,9 @@ public class SparkExecutionContext extends ExecutionContext
* @param mo matrix object
* @param inputInfo input info
* @return JavaPairRDD handle for a matrix object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
- public JavaPairRDD<?,?> getRDDHandleForMatrixObject( MatrixObject mo, InputInfo inputInfo )
- throws DMLRuntimeException
- {
+ public JavaPairRDD<?,?> getRDDHandleForMatrixObject( MatrixObject mo, InputInfo inputInfo ) {
//NOTE: MB this logic should be integrated into MatrixObject
//However, for now we cannot assume that spark libraries are
//always available and hence only store generic references in
@@ -425,11 +416,9 @@ public class SparkExecutionContext extends ExecutionContext
* @param fo frame object
* @param inputInfo input info
* @return JavaPairRDD handle for a frame object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
public JavaPairRDD<?,?> getRDDHandleForFrameObject( FrameObject fo, InputInfo inputInfo )
- throws DMLRuntimeException
{
//NOTE: MB this logic should be integrated into FrameObject
//However, for now we cannot assume that spark libraries are
@@ -511,7 +500,6 @@ public class SparkExecutionContext extends ExecutionContext
@SuppressWarnings("unchecked")
public PartitionedBroadcast<MatrixBlock> getBroadcastForVariable( String varname )
- throws DMLRuntimeException
{
//NOTE: The memory consumption of this method is the in-memory size of the
//matrix object plus the partitioned size in 1k-1k blocks. Since the call
@@ -589,7 +577,6 @@ public class SparkExecutionContext extends ExecutionContext
@SuppressWarnings("unchecked")
public PartitionedBroadcast<FrameBlock> getBroadcastForFrameVariable( String varname)
- throws DMLRuntimeException
{
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
@@ -663,11 +650,8 @@ public class SparkExecutionContext extends ExecutionContext
*
* @param varname variable name
* @param rdd JavaPairRDD handle for variable
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void setRDDHandleForVariable(String varname, JavaPairRDD<?,?> rdd)
- throws DMLRuntimeException
- {
+ public void setRDDHandleForVariable(String varname, JavaPairRDD<?,?> rdd) {
CacheableData<?> obj = getCacheableData(varname);
RDDObject rddhandle = new RDDObject(rdd);
obj.setRDDHandle( rddhandle );
@@ -681,11 +665,8 @@ public class SparkExecutionContext extends ExecutionContext
* @param brlen block row length
* @param bclen block column length
* @return JavaPairRDD handle to matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static JavaPairRDD<MatrixIndexes,MatrixBlock> toMatrixJavaPairRDD(JavaSparkContext sc, MatrixBlock src, int brlen, int bclen)
- throws DMLRuntimeException
- {
+ public static JavaPairRDD<MatrixIndexes,MatrixBlock> toMatrixJavaPairRDD(JavaSparkContext sc, MatrixBlock src, int brlen, int bclen) {
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
List<Tuple2<MatrixIndexes,MatrixBlock>> list = null;
@@ -731,9 +712,7 @@ public class SparkExecutionContext extends ExecutionContext
}
}
- public static JavaPairRDD<Long,FrameBlock> toFrameJavaPairRDD(JavaSparkContext sc, FrameBlock src)
- throws DMLRuntimeException
- {
+ public static JavaPairRDD<Long,FrameBlock> toFrameJavaPairRDD(JavaSparkContext sc, FrameBlock src) {
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
LinkedList<Tuple2<Long,FrameBlock>> list = new LinkedList<>();
@@ -774,12 +753,9 @@ public class SparkExecutionContext extends ExecutionContext
* @param bclen number of columns in a block
* @param nnz number of non-zeros
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
- public static MatrixBlock toMatrixBlock(RDDObject rdd, int rlen, int clen, int brlen, int bclen, long nnz)
- throws DMLRuntimeException
- {
+ public static MatrixBlock toMatrixBlock(RDDObject rdd, int rlen, int clen, int brlen, int bclen, long nnz) {
return toMatrixBlock(
(JavaPairRDD<MatrixIndexes, MatrixBlock>) rdd.getRDD(),
rlen, clen, brlen, bclen, nnz);
@@ -799,12 +775,8 @@ public class SparkExecutionContext extends ExecutionContext
* @param bclen number of columns in a block
* @param nnz number of non-zeros
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static MatrixBlock toMatrixBlock(JavaPairRDD<MatrixIndexes,MatrixBlock> rdd, int rlen, int clen, int brlen, int bclen, long nnz)
- throws DMLRuntimeException
- {
-
+ public static MatrixBlock toMatrixBlock(JavaPairRDD<MatrixIndexes,MatrixBlock> rdd, int rlen, int clen, int brlen, int bclen, long nnz) {
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
MatrixBlock out = null;
@@ -883,9 +855,7 @@ public class SparkExecutionContext extends ExecutionContext
}
@SuppressWarnings("unchecked")
- public static MatrixBlock toMatrixBlock(RDDObject rdd, int rlen, int clen, long nnz)
- throws DMLRuntimeException
- {
+ public static MatrixBlock toMatrixBlock(RDDObject rdd, int rlen, int clen, long nnz) {
return toMatrixBlock(
(JavaPairRDD<MatrixIndexes, MatrixCell>) rdd.getRDD(),
rlen, clen, nnz);
@@ -900,10 +870,8 @@ public class SparkExecutionContext extends ExecutionContext
* @param clen number of columns
* @param nnz number of non-zeros
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static MatrixBlock toMatrixBlock(JavaPairRDD<MatrixIndexes, MatrixCell> rdd, int rlen, int clen, long nnz)
- throws DMLRuntimeException
{
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
@@ -945,7 +913,6 @@ public class SparkExecutionContext extends ExecutionContext
}
public static PartitionedBlock<MatrixBlock> toPartitionedMatrixBlock(JavaPairRDD<MatrixIndexes,MatrixBlock> rdd, int rlen, int clen, int brlen, int bclen, long nnz)
- throws DMLRuntimeException
{
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
@@ -971,16 +938,12 @@ public class SparkExecutionContext extends ExecutionContext
}
@SuppressWarnings("unchecked")
- public static FrameBlock toFrameBlock(RDDObject rdd, ValueType[] schema, int rlen, int clen)
- throws DMLRuntimeException
- {
+ public static FrameBlock toFrameBlock(RDDObject rdd, ValueType[] schema, int rlen, int clen) {
JavaPairRDD<Long,FrameBlock> lrdd = (JavaPairRDD<Long,FrameBlock>) rdd.getRDD();
return toFrameBlock(lrdd, schema, rlen, clen);
}
- public static FrameBlock toFrameBlock(JavaPairRDD<Long,FrameBlock> rdd, ValueType[] schema, int rlen, int clen)
- throws DMLRuntimeException
- {
+ public static FrameBlock toFrameBlock(JavaPairRDD<Long,FrameBlock> rdd, ValueType[] schema, int rlen, int clen) {
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
if(schema == null)
@@ -1062,14 +1025,10 @@ public class SparkExecutionContext extends ExecutionContext
*
* @param varParent parent variable
* @param varChild child variable
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void addLineageRDD(String varParent, String varChild)
- throws DMLRuntimeException
- {
+ public void addLineageRDD(String varParent, String varChild) {
RDDObject parent = getCacheableData(varParent).getRDDHandle();
RDDObject child = getCacheableData(varChild).getRDDHandle();
-
parent.addLineageChild( child );
}
@@ -1078,20 +1037,14 @@ public class SparkExecutionContext extends ExecutionContext
*
* @param varParent parent variable
* @param varChild child variable
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void addLineageBroadcast(String varParent, String varChild)
- throws DMLRuntimeException
- {
+ public void addLineageBroadcast(String varParent, String varChild) {
RDDObject parent = getCacheableData(varParent).getRDDHandle();
BroadcastObject<?> child = getCacheableData(varChild).getBroadcastHandle();
-
parent.addLineageChild( child );
}
- public void addLineage(String varParent, String varChild, boolean broadcast)
- throws DMLRuntimeException
- {
+ public void addLineage(String varParent, String varChild, boolean broadcast) {
if( broadcast )
addLineageBroadcast(varParent, varChild);
else
@@ -1100,7 +1053,6 @@ public class SparkExecutionContext extends ExecutionContext
@Override
public void cleanupCacheableData( CacheableData<?> mo )
- throws DMLRuntimeException
{
//NOTE: this method overwrites the default behavior of cleanupMatrixObject
//and hence is transparently used by rmvar instructions and other users. The
@@ -1215,9 +1167,7 @@ public class SparkExecutionContext extends ExecutionContext
}
@SuppressWarnings("unchecked")
- public void repartitionAndCacheMatrixObject( String var )
- throws DMLRuntimeException
- {
+ public void repartitionAndCacheMatrixObject( String var ) {
MatrixObject mo = getMatrixObject(var);
MatrixCharacteristics mcIn = mo.getMatrixCharacteristics();
@@ -1264,9 +1214,7 @@ public class SparkExecutionContext extends ExecutionContext
}
@SuppressWarnings("unchecked")
- public void cacheMatrixObject( String var )
- throws DMLRuntimeException
- {
+ public void cacheMatrixObject( String var ) {
//get input rdd and default storage level
MatrixObject mo = getMatrixObject(var);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitioner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitioner.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitioner.java
index 9599993..3d12949 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitioner.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitioner.java
@@ -60,15 +60,11 @@ public abstract class DataPartitioner
_n = n;
}
- public MatrixObject createPartitionedMatrixObject( MatrixObject in, String fnameNew )
- throws DMLRuntimeException
- {
+ public MatrixObject createPartitionedMatrixObject( MatrixObject in, String fnameNew ) {
return createPartitionedMatrixObject(in, fnameNew, false);
}
- public MatrixObject createPartitionedMatrixObject( MatrixObject in, String fnameNew, boolean force )
- throws DMLRuntimeException
- {
+ public MatrixObject createPartitionedMatrixObject( MatrixObject in, String fnameNew, boolean force ) {
MatrixObject out = new MatrixObject(in.getValueType(), fnameNew);
return createPartitionedMatrixObject(in, out, force);
}
@@ -85,11 +81,8 @@ public abstract class DataPartitioner
* @param out output matrix object
* @param force if false, try to optimize
* @return partitioned matrix object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixObject createPartitionedMatrixObject( MatrixObject in, MatrixObject out, boolean force )
- throws DMLRuntimeException
- {
+ public MatrixObject createPartitionedMatrixObject( MatrixObject in, MatrixObject out, boolean force ) {
//check for naive partitioning
if( _format == PDataPartitionFormat.NONE )
return in;
@@ -172,8 +165,7 @@ public abstract class DataPartitioner
_allowBinarycell = false;
}
- protected abstract void partitionMatrix( MatrixObject in, String fnameNew, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen )
- throws DMLRuntimeException;
+ protected abstract void partitionMatrix( MatrixObject in, String fnameNew, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen );
public static MatrixBlock createReuseMatrixBlock( PDataPartitionFormat dpf, int rows, int cols )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerLocal.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerLocal.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerLocal.java
index cdb5d4d..ecb5ea0 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerLocal.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerLocal.java
@@ -91,23 +91,17 @@ public class DataPartitionerLocal extends DataPartitioner
* @param dpf data partitionformat
* @param n ?
* @param par -1 for serial otherwise number of threads, can be ignored by implementation
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public DataPartitionerLocal(PartitionFormat dpf, int par)
- throws DMLRuntimeException
- {
+ public DataPartitionerLocal(PartitionFormat dpf, int par) {
super(dpf._dpf, dpf._N);
-
if( dpf.isBlockwise() )
throw new DMLRuntimeException("Data partitioning formt '"+dpf+"' not supported by DataPartitionerLocal" );
-
_seq = new IDSequence();
_par = (par > 0) ? par : 1;
}
@Override
protected void partitionMatrix(MatrixObject in, String fnameNew, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen)
- throws DMLRuntimeException
{
//force writing to disk (typically not required since partitioning only applied if dataset exceeds CP size)
in.exportData(); //written to disk iff dirty
@@ -134,7 +128,6 @@ public class DataPartitionerLocal extends DataPartitioner
}
private void partitionTextCell( String fname, String fnameStaging, String fnameNew, long rlen, long clen, int brlen, int bclen )
- throws DMLRuntimeException
{
long row = -1;
long col = -1;
@@ -227,7 +220,6 @@ public class DataPartitionerLocal extends DataPartitioner
@SuppressWarnings("deprecation")
private void partitionBinaryCell( String fname, String fnameStaging, String fnameNew, long rlen, long clen, int brlen, int bclen )
- throws DMLRuntimeException
{
long row = -1;
long col = -1;
@@ -315,7 +307,6 @@ public class DataPartitionerLocal extends DataPartitioner
@SuppressWarnings("deprecation")
private void partitionBinaryBlock( String fname, String fnameStaging, String fnameNew, long rlen, long clen, int brlen, int bclen )
- throws DMLRuntimeException
{
try
{
@@ -391,7 +382,6 @@ public class DataPartitionerLocal extends DataPartitioner
@SuppressWarnings("deprecation")
private void partitionBinaryBlock2BinaryCell( String fname, String fnameStaging, String fnameNew, long rlen, long clen, int brlen, int bclen )
- throws DMLRuntimeException
{
try
{
@@ -495,7 +485,7 @@ public class DataPartitionerLocal extends DataPartitioner
}
private void appendBlockToStagingArea( String dir, MatrixBlock mb, long row_offset, long col_offset, long brlen, long bclen )
- throws DMLRuntimeException, IOException
+ throws IOException
{
//NOTE: for temporary block we always create dense representations
boolean sparse = mb.isInSparseFormat();
@@ -506,7 +496,7 @@ public class DataPartitionerLocal extends DataPartitioner
if( _format == PDataPartitionFormat.ROW_WISE )
{
- _reuseBlk.reset( 1, (int)cols, sparse, (int) (cols*sparsity) );
+ _reuseBlk.reset( 1, (int)cols, sparse, (int) (cols*sparsity) );
for( int i=0; i<rows; i++ )
{
String pdir = LocalFileUtils.checkAndCreateStagingDir(dir+"/"+(row_offset+1+i));
@@ -545,7 +535,7 @@ public class DataPartitionerLocal extends DataPartitioner
}
private void appendCellBufferToStagingArea( String dir, LinkedList<Cell> buffer, int brlen, int bclen )
- throws DMLRuntimeException, IOException
+ throws IOException
{
HashMap<Long,LinkedList<Cell>> sortedBuffer = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteMR.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteMR.java
index b784ae3..c64c5e9 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteMR.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteMR.java
@@ -69,7 +69,6 @@ public class DataPartitionerRemoteMR extends DataPartitioner
@Override
protected void partitionMatrix(MatrixObject in, String fnameNew, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen)
- throws DMLRuntimeException
{
String jobname = "ParFor-DPMR";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSpark.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSpark.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSpark.java
index f7b09b1..b09420b 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSpark.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSpark.java
@@ -58,7 +58,6 @@ public class DataPartitionerRemoteSpark extends DataPartitioner
@Override
@SuppressWarnings("unchecked")
protected void partitionMatrix(MatrixObject in, String fnameNew, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen)
- throws DMLRuntimeException
{
String jobname = "ParFor-DPSP";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSparkMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSparkMapper.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSparkMapper.java
index ab14ca3..8e62f42 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSparkMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/DataPartitionerRemoteSparkMapper.java
@@ -57,9 +57,7 @@ public class DataPartitionerRemoteSparkMapper extends ParWorker implements PairF
private PDataPartitionFormat _dpf;
private final long _n;
- public DataPartitionerRemoteSparkMapper(MatrixCharacteristics mc, InputInfo ii, OutputInfo oi, PDataPartitionFormat dpf, int n)
- throws DMLRuntimeException
- {
+ public DataPartitionerRemoteSparkMapper(MatrixCharacteristics mc, InputInfo ii, OutputInfo oi, PDataPartitionFormat dpf, int n) {
_rlen = mc.getRows();
_clen = mc.getCols();
_brlen = mc.getRowsPerBlock();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ParWorker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ParWorker.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ParWorker.java
index cf5cbcf..339fbcc 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ParWorker.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ParWorker.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysml.parser.ParForStatementBlock.ResultVar;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
import org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
@@ -111,9 +110,7 @@ public abstract class ParWorker
}
}
- protected void executeTask( Task task )
- throws DMLRuntimeException
- {
+ protected void executeTask( Task task ) {
LOG.trace("EXECUTE PARFOR_WORKER ID="+_workerID+" for task "+task.toCompactString());
switch( task.getType() )
@@ -127,9 +124,7 @@ public abstract class ParWorker
}
}
- private void executeSetTask( Task task )
- throws DMLRuntimeException
- {
+ private void executeSetTask( Task task ) {
//monitoring start
Timing time1 = null, time2 = null;
if( _monitor )
@@ -169,9 +164,7 @@ public abstract class ParWorker
}
}
- private void executeRangeTask( Task task )
- throws DMLRuntimeException
- {
+ private void executeRangeTask( Task task ) {
//monitoring start
Timing time1 = null, time2 = null;
if( _monitor )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ProgramConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ProgramConverter.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ProgramConverter.java
index d5cd518..1356634 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ProgramConverter.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ProgramConverter.java
@@ -162,10 +162,9 @@ public class ProgramConverter
* @param ec execution context
* @return execution context
* @throws CloneNotSupportedException if CloneNotSupportedException occurs
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static ExecutionContext createDeepCopyExecutionContext(ExecutionContext ec)
- throws CloneNotSupportedException, DMLRuntimeException
+ throws CloneNotSupportedException
{
ExecutionContext cpec = ExecutionContextFactory.createContext(false, ec.getProgram());
cpec.setVariables((LocalVariableMap) ec.getVariables().clone());
@@ -210,10 +209,8 @@ public class ProgramConverter
* @param plain if true, full deep copy without id replacement
* @param forceDeepCopy if true, force deep copy
* @return list of program blocks
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static ArrayList<ProgramBlock> rcreateDeepCopyProgramBlocks(ArrayList<ProgramBlock> childBlocks, long pid, int IDPrefix, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy)
- throws DMLRuntimeException
{
ArrayList<ProgramBlock> tmp = new ArrayList<>();
@@ -264,9 +261,7 @@ public class ProgramConverter
return tmp;
}
- public static WhileProgramBlock createDeepCopyWhileProgramBlock(WhileProgramBlock wpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy)
- throws DMLRuntimeException
- {
+ public static WhileProgramBlock createDeepCopyWhileProgramBlock(WhileProgramBlock wpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy) {
ArrayList<Instruction> predinst = createDeepCopyInstructionSet(wpb.getPredicate(), pid, IDPrefix, prog, fnStack, fnCreated, plain, true);
WhileProgramBlock tmpPB = new WhileProgramBlock(prog, predinst);
tmpPB.setStatementBlock( createWhileStatementBlockCopy((WhileStatementBlock) wpb.getStatementBlock(), pid, plain, forceDeepCopy) );
@@ -278,9 +273,7 @@ public class ProgramConverter
return tmpPB;
}
- public static IfProgramBlock createDeepCopyIfProgramBlock(IfProgramBlock ipb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy)
- throws DMLRuntimeException
- {
+ public static IfProgramBlock createDeepCopyIfProgramBlock(IfProgramBlock ipb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy) {
ArrayList<Instruction> predinst = createDeepCopyInstructionSet(ipb.getPredicate(), pid, IDPrefix, prog, fnStack, fnCreated, plain, true);
IfProgramBlock tmpPB = new IfProgramBlock(prog, predinst);
tmpPB.setStatementBlock( createIfStatementBlockCopy((IfStatementBlock)ipb.getStatementBlock(), pid, plain, forceDeepCopy ) );
@@ -293,9 +286,7 @@ public class ProgramConverter
return tmpPB;
}
- public static ForProgramBlock createDeepCopyForProgramBlock(ForProgramBlock fpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy)
- throws DMLRuntimeException
- {
+ public static ForProgramBlock createDeepCopyForProgramBlock(ForProgramBlock fpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy) {
ForProgramBlock tmpPB = new ForProgramBlock(prog,fpb.getIterVar());
tmpPB.setStatementBlock( createForStatementBlockCopy((ForStatementBlock)fpb.getStatementBlock(), pid, plain, forceDeepCopy));
tmpPB.setThreadID(pid);
@@ -309,9 +300,7 @@ public class ProgramConverter
return tmpPB;
}
- public static ForProgramBlock createShallowCopyForProgramBlock(ForProgramBlock fpb, Program prog )
- throws DMLRuntimeException
- {
+ public static ForProgramBlock createShallowCopyForProgramBlock(ForProgramBlock fpb, Program prog ) {
ForProgramBlock tmpPB = new ForProgramBlock(prog,fpb.getIterVar());
tmpPB.setFromInstructions( fpb.getFromInstructions() );
@@ -323,9 +312,7 @@ public class ProgramConverter
return tmpPB;
}
- public static ParForProgramBlock createDeepCopyParForProgramBlock(ParForProgramBlock pfpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy)
- throws DMLRuntimeException
- {
+ public static ParForProgramBlock createDeepCopyParForProgramBlock(ParForProgramBlock pfpb, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean forceDeepCopy) {
ParForProgramBlock tmpPB = null;
if( IDPrefix == -1 ) //still on master node
@@ -366,10 +353,8 @@ public class ProgramConverter
* @param fnStack ?
* @param fnCreated ?
* @param plain ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static void createDeepCopyFunctionProgramBlock(String namespace, String oldName, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain)
- throws DMLRuntimeException
{
//fpb guaranteed to be non-null (checked inside getFunctionProgramBlock)
FunctionProgramBlock fpb = prog.getFunctionProgramBlock(namespace, oldName);
@@ -429,7 +414,6 @@ public class ProgramConverter
}
public static FunctionProgramBlock createDeepCopyFunctionProgramBlock(FunctionProgramBlock fpb, HashSet<String> fnStack, HashSet<String> fnCreated)
- throws DMLRuntimeException
{
if( fpb == null )
throw new DMLRuntimeException("Unable to create a deep copy of a non-existing FunctionProgramBlock.");
@@ -468,10 +452,8 @@ public class ProgramConverter
* @param plain ?
* @param cpFunctions ?
* @return list of instructions
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public static ArrayList<Instruction> createDeepCopyInstructionSet(ArrayList<Instruction> instSet, long pid, int IDPrefix, Program prog, HashSet<String> fnStack, HashSet<String> fnCreated, boolean plain, boolean cpFunctions)
- throws DMLRuntimeException
{
ArrayList<Instruction> tmp = new ArrayList<>();
for( Instruction inst : instSet )
@@ -491,7 +473,6 @@ public class ProgramConverter
}
public static Instruction cloneInstruction( Instruction oInst, long pid, boolean plain, boolean cpFunctions )
- throws DMLRuntimeException
{
Instruction inst = null;
String tmpString = oInst.toString();
@@ -536,7 +517,6 @@ public class ProgramConverter
}
public static StatementBlock createStatementBlockCopy( StatementBlock sb, long pid, boolean plain, boolean forceDeepCopy )
- throws DMLRuntimeException
{
StatementBlock ret = null;
@@ -576,7 +556,6 @@ public class ProgramConverter
}
public static IfStatementBlock createIfStatementBlockCopy( IfStatementBlock sb, long pid, boolean plain, boolean forceDeepCopy )
- throws DMLRuntimeException
{
IfStatementBlock ret = null;
@@ -617,7 +596,6 @@ public class ProgramConverter
}
public static WhileStatementBlock createWhileStatementBlockCopy( WhileStatementBlock sb, long pid, boolean plain, boolean forceDeepCopy )
- throws DMLRuntimeException
{
WhileStatementBlock ret = null;
@@ -659,7 +637,6 @@ public class ProgramConverter
}
public static ForStatementBlock createForStatementBlockCopy( ForStatementBlock sb, long pid, boolean plain, boolean forceDeepCopy )
- throws DMLRuntimeException
{
ForStatementBlock ret = null;
@@ -719,12 +696,11 @@ public class ProgramConverter
// SERIALIZATION
////////////////////////////////
- public static String serializeParForBody( ParForBody body ) throws DMLRuntimeException {
+ public static String serializeParForBody( ParForBody body ) {
return serializeParForBody(body, new HashMap<String, byte[]>());
}
public static String serializeParForBody( ParForBody body, HashMap<String,byte[]> clsMap )
- throws DMLRuntimeException
{
ArrayList<ProgramBlock> pbs = body.getChildBlocks();
ArrayList<ResultVar> rVnames = body.getResultVariables();
@@ -789,21 +765,16 @@ public class ProgramConverter
return sb.toString();
}
- private static String serializeProgram( Program prog, ArrayList<ProgramBlock> pbs, HashMap<String, byte[]> clsMap )
- throws DMLRuntimeException
- {
+ private static String serializeProgram( Program prog, ArrayList<ProgramBlock> pbs, HashMap<String, byte[]> clsMap ) {
//note program contains variables, programblocks and function program blocks
//but in order to avoid redundancy, we only serialize function program blocks
-
HashMap<String, FunctionProgramBlock> fpb = prog.getFunctionProgramBlocks();
HashSet<String> cand = new HashSet<>();
rFindSerializationCandidates(pbs, cand);
-
return rSerializeFunctionProgramBlocks( fpb, cand, clsMap );
}
private static void rFindSerializationCandidates( ArrayList<ProgramBlock> pbs, HashSet<String> cand )
- throws DMLRuntimeException
{
for( ProgramBlock pb : pbs )
{
@@ -844,32 +815,25 @@ public class ProgramConverter
}
}
- private static String serializeVariables (LocalVariableMap vars)
- throws DMLRuntimeException
- {
+ private static String serializeVariables (LocalVariableMap vars) {
StringBuilder sb = new StringBuilder();
sb.append( PARFOR_VARS_BEGIN );
sb.append( vars.serialize() );
sb.append( PARFOR_VARS_END );
-
return sb.toString();
}
public static String serializeDataObject(String key, Data dat)
- throws DMLRuntimeException
{
// SCHEMA: <name>|<datatype>|<valuetype>|value
// (scalars are serialize by value, matrices by filename)
-
StringBuilder sb = new StringBuilder();
-
//prepare data for serialization
String name = key;
DataType datatype = dat.getDataType();
ValueType valuetype = dat.getValueType();
String value = null;
String[] matrixMetaData = null;
-
switch( datatype )
{
case SCALAR:
@@ -917,14 +881,13 @@ public class ProgramConverter
return sb.toString();
}
- private static String serializeExecutionContext( ExecutionContext ec ) throws DMLRuntimeException {
+ private static String serializeExecutionContext( ExecutionContext ec ) {
return (ec != null) ? serializeVariables( ec.getVariables() ) : EMPTY;
}
@SuppressWarnings("all")
private static String serializeInstructions( ArrayList<Instruction> inst, HashMap<String, byte[]> clsMap )
- throws DMLRuntimeException
- {
+ {
StringBuilder sb = new StringBuilder();
int count = 0;
for( Instruction linst : inst )
@@ -1078,7 +1041,6 @@ public class ProgramConverter
}
private static String rSerializeFunctionProgramBlocks(HashMap<String,FunctionProgramBlock> pbs, HashSet<String> cand, HashMap<String, byte[]> clsMap)
- throws DMLRuntimeException
{
StringBuilder sb = new StringBuilder();
@@ -1101,9 +1063,7 @@ public class ProgramConverter
return sb.toString();
}
- private static String rSerializeProgramBlocks(ArrayList<ProgramBlock> pbs, HashMap<String, byte[]> clsMap)
- throws DMLRuntimeException
- {
+ private static String rSerializeProgramBlocks(ArrayList<ProgramBlock> pbs, HashMap<String, byte[]> clsMap) {
StringBuilder sb = new StringBuilder();
int count = 0;
for( ProgramBlock pb : pbs )
@@ -1120,9 +1080,7 @@ public class ProgramConverter
return sb.toString();
}
- private static String rSerializeProgramBlock( ProgramBlock pb, HashMap<String, byte[]> clsMap )
- throws DMLRuntimeException
- {
+ private static String rSerializeProgramBlock( ProgramBlock pb, HashMap<String, byte[]> clsMap ) {
StringBuilder sb = new StringBuilder();
//handle header
@@ -1297,9 +1255,7 @@ public class ProgramConverter
// PARSING
////////////////////////////////
- public static ParForBody parseParForBody( String in, int id )
- throws DMLRuntimeException
- {
+ public static ParForBody parseParForBody( String in, int id ) {
ParForBody body = new ParForBody();
//header elimination
@@ -1353,9 +1309,7 @@ public class ProgramConverter
return body;
}
- public static Program parseProgram( String in, int id )
- throws DMLRuntimeException
- {
+ public static Program parseProgram( String in, int id ) {
String lin = in.substring( PARFOR_PROG_BEGIN.length(),in.length()-PARFOR_PROG_END.length()).trim();
Program prog = new Program();
@@ -1373,9 +1327,7 @@ public class ProgramConverter
return prog;
}
- private static LocalVariableMap parseVariables(String in)
- throws DMLRuntimeException
- {
+ private static LocalVariableMap parseVariables(String in) {
LocalVariableMap ret = null;
if( in.length()> PARFOR_VARS_BEGIN.length() + PARFOR_VARS_END.length())
@@ -1391,9 +1343,7 @@ public class ProgramConverter
return ret;
}
- private static HashMap<String,FunctionProgramBlock> parseFunctionProgramBlocks( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static HashMap<String,FunctionProgramBlock> parseFunctionProgramBlocks( String in, Program prog, int id ) {
HashMap<String,FunctionProgramBlock> ret = new HashMap<>();
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer( in, ELEMENT_DELIM );
@@ -1411,9 +1361,7 @@ public class ProgramConverter
return ret;
}
- private static ArrayList<ProgramBlock> rParseProgramBlocks(String in, Program prog, int id)
- throws DMLRuntimeException
- {
+ private static ArrayList<ProgramBlock> rParseProgramBlocks(String in, Program prog, int id) {
ArrayList<ProgramBlock> pbs = new ArrayList<>();
String tmpdata = in.substring(PARFOR_PBS_BEGIN.length(),in.length()-PARFOR_PBS_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(tmpdata, ELEMENT_DELIM);
@@ -1427,9 +1375,7 @@ public class ProgramConverter
return pbs;
}
- private static ProgramBlock rParseProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static ProgramBlock rParseProgramBlock( String in, Program prog, int id ) {
ProgramBlock pb = null;
if( in.startsWith( PARFOR_PB_WHILE ) )
@@ -1452,9 +1398,7 @@ public class ProgramConverter
return pb;
}
- private static WhileProgramBlock rParseWhileProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static WhileProgramBlock rParseWhileProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_WHILE.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1474,9 +1418,7 @@ public class ProgramConverter
return wpb;
}
- private static ForProgramBlock rParseForProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static ForProgramBlock rParseForProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_FOR.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1504,9 +1446,7 @@ public class ProgramConverter
return fpb;
}
- private static ParForProgramBlock rParseParForProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static ParForProgramBlock rParseParForProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_PARFOR.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1537,9 +1477,7 @@ public class ProgramConverter
return pfpb;
}
- private static IfProgramBlock rParseIfProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static IfProgramBlock rParseIfProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_IF.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1561,9 +1499,7 @@ public class ProgramConverter
return ipb;
}
- private static FunctionProgramBlock rParseFunctionProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static FunctionProgramBlock rParseFunctionProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_FC.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1586,9 +1522,7 @@ public class ProgramConverter
return fpb;
}
- private static ExternalFunctionProgramBlock rParseExternalFunctionProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static ExternalFunctionProgramBlock rParseExternalFunctionProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_EFC.length(),in.length()-PARFOR_PB_END.length());
HierarchyAwareStringTokenizer st = new HierarchyAwareStringTokenizer(lin, COMPONENTS_DELIM);
@@ -1618,9 +1552,7 @@ public class ProgramConverter
return efpb;
}
- private static ProgramBlock rParseGenericProgramBlock( String in, Program prog, int id )
- throws DMLRuntimeException
- {
+ private static ProgramBlock rParseGenericProgramBlock( String in, Program prog, int id ) {
String lin = in.substring( PARFOR_PB_BEGIN.length(),in.length()-PARFOR_PB_END.length());
StringTokenizer st = new StringTokenizer(lin,COMPONENTS_DELIM);
@@ -1632,9 +1564,7 @@ public class ProgramConverter
return pb;
}
- private static ArrayList<Instruction> parseInstructions( String in, int id )
- throws DMLRuntimeException
- {
+ private static ArrayList<Instruction> parseInstructions( String in, int id ) {
ArrayList<Instruction> insts = new ArrayList<>();
String lin = in.substring( PARFOR_INST_BEGIN.length(),in.length()-PARFOR_INST_END.length());
StringTokenizer st = new StringTokenizer(lin, ELEMENT_DELIM);
@@ -1720,11 +1650,8 @@ public class ProgramConverter
*
* @param in data object as string
* @return array of objects
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static Object[] parseDataObject(String in)
- throws DMLRuntimeException
- {
+ public static Object[] parseDataObject(String in) {
Object[] ret = new Object[2];
StringTokenizer st = new StringTokenizer(in, DATA_FIELD_DELIM );
@@ -1787,7 +1714,6 @@ public class ProgramConverter
}
private static ExecutionContext parseExecutionContext(String in, Program prog)
- throws DMLRuntimeException
{
ExecutionContext ec = null;
@@ -1818,10 +1744,8 @@ public class ProgramConverter
* @param pattern ?
* @param replacement string replacement
* @return instruction
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private static Instruction saveReplaceThreadID( Instruction inst, String pattern, String replacement )
- throws DMLRuntimeException
{
//currently known, relevant instructions: createvar, rand, seq, extfunct,
if( inst instanceof MRJobInstruction )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForMR.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForMR.java
index 800cdb4..b51df84 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForMR.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForMR.java
@@ -72,7 +72,6 @@ public class RemoteDPParForMR
public static RemoteParForJobReturn runJob(long pfid, String itervar, String matrixvar, String program,
String resultFile, MatrixObject input, PartitionFormat dpf, OutputInfo oi, boolean tSparseCol, //config params
boolean enableCPCaching, int numReducers, int replication) //opt params
- throws DMLRuntimeException
{
RemoteParForJobReturn ret = null;
String jobname = "ParFor-DPEMR";
@@ -237,12 +236,11 @@ public class RemoteDPParForMR
* @param job job configuration
* @param fname file name
* @return array of local variable maps
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws IOException if IOException occurs
*/
@SuppressWarnings("deprecation")
public static LocalVariableMap [] readResultFile( JobConf job, String fname )
- throws DMLRuntimeException, IOException
+ throws IOException
{
HashMap<Long,LocalVariableMap> tmp = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSpark.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSpark.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSpark.java
index 4562b06..b12dc88 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSpark.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSpark.java
@@ -39,7 +39,6 @@ import org.apache.spark.util.LongAccumulator;
import scala.Tuple2;
import org.apache.sysml.api.DMLScript;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PartitionFormat;
@@ -73,7 +72,6 @@ public class RemoteDPParForSpark
public static RemoteParForJobReturn runJob(long pfid, String itervar, String matrixvar, String program, HashMap<String, byte[]> clsMap,
String resultFile, MatrixObject input, ExecutionContext ec, PartitionFormat dpf, OutputInfo oi,
boolean tSparseCol, boolean enableCPCaching, int numReducers )
- throws DMLRuntimeException
{
String jobname = "ParFor-DPESP";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
@@ -124,7 +122,6 @@ public class RemoteDPParForSpark
@SuppressWarnings("unchecked")
private static JavaPairRDD<Long, Writable> getPartitionedInput(SparkExecutionContext sec,
String matrixvar, OutputInfo oi, PartitionFormat dpf)
- throws DMLRuntimeException
{
InputInfo ii = InputInfo.BinaryBlockInputInfo;
MatrixObject mo = sec.getMatrixObject(matrixvar);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSparkWorker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSparkWorker.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSparkWorker.java
index 52ac922..4ab90ae 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSparkWorker.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParForSparkWorker.java
@@ -73,7 +73,6 @@ public class RemoteDPParForSparkWorker extends ParWorker implements PairFlatMapF
public RemoteDPParForSparkWorker(String program, HashMap<String, byte[]> clsMap, String inputVar, String iterVar,
boolean cpCaching, MatrixCharacteristics mc, boolean tSparseCol, PartitionFormat dpf, OutputInfo oinfo,
LongAccumulator atasks, LongAccumulator aiters)
- throws DMLRuntimeException
{
_prog = program;
_clsMap = clsMap;
@@ -142,7 +141,7 @@ public class RemoteDPParForSparkWorker extends ParWorker implements PairFlatMapF
}
private void configureWorker( long ID )
- throws DMLRuntimeException, IOException
+ throws IOException
{
_workerID = ID;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForMR.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForMR.java
index b998cba..baec5a2 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForMR.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForMR.java
@@ -69,7 +69,6 @@ public class RemoteParForMR
public static RemoteParForJobReturn runJob(long pfid, String program, String taskFile, String resultFile, MatrixObject colocatedDPMatrixObj, //inputs
boolean enableCPCaching, int numMappers, int replication, int max_retry, long minMem, boolean jvmReuse) //opt params
- throws DMLRuntimeException
{
RemoteParForJobReturn ret = null;
String jobname = "ParFor-EMR";
@@ -248,12 +247,11 @@ public class RemoteParForMR
* @param job job configuration
* @param fname file name
* @return array of local variable maps
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws IOException if IOException occurs
*/
@SuppressWarnings("deprecation")
public static LocalVariableMap [] readResultFile( JobConf job, String fname )
- throws DMLRuntimeException, IOException
+ throws IOException
{
HashMap<Long,LocalVariableMap> tmp = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSpark.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSpark.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSpark.java
index 10b44a2..eee65f3 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSpark.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSpark.java
@@ -30,7 +30,6 @@ import org.apache.spark.util.LongAccumulator;
import scala.Tuple2;
import org.apache.sysml.api.DMLScript;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
import org.apache.sysml.runtime.controlprogram.context.SparkExecutionContext;
@@ -60,7 +59,6 @@ public class RemoteParForSpark
public static RemoteParForJobReturn runJob(long pfid, String prog, HashMap<String, byte[]> clsMap,
List<Task> tasks, ExecutionContext ec, boolean cpCaching, int numMappers)
- throws DMLRuntimeException
{
String jobname = "ParFor-ESP";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSparkWorker.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSparkWorker.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSparkWorker.java
index 41dc53c..45e3bc7 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSparkWorker.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForSparkWorker.java
@@ -30,7 +30,6 @@ import java.util.stream.Collectors;
import org.apache.spark.TaskContext;
import org.apache.spark.api.java.function.PairFlatMapFunction;
import org.apache.spark.util.LongAccumulator;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.codegen.CodegenUtils;
import org.apache.sysml.runtime.controlprogram.caching.CacheableData;
import org.apache.sysml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer;
@@ -55,15 +54,12 @@ public class RemoteParForSparkWorker extends ParWorker implements PairFlatMapFun
private final LongAccumulator _aTasks;
private final LongAccumulator _aIters;
- public RemoteParForSparkWorker(long jobid, String program, HashMap<String, byte[]> clsMap, boolean cpCaching, LongAccumulator atasks, LongAccumulator aiters)
- throws DMLRuntimeException
- {
+ public RemoteParForSparkWorker(long jobid, String program, HashMap<String, byte[]> clsMap, boolean cpCaching, LongAccumulator atasks, LongAccumulator aiters) {
_jobid = jobid;
_prog = program;
_clsMap = clsMap;
_initialized = false;
_caching = cpCaching;
-
//setup spark accumulators
_aTasks = atasks;
_aIters = aiters;
@@ -96,7 +92,7 @@ public class RemoteParForSparkWorker extends ParWorker implements PairFlatMapFun
}
private void configureWorker(long taskID)
- throws DMLRuntimeException, IOException
+ throws IOException
{
_workerID = taskID;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForUtils.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForUtils.java
index 7c24ae5..e93f0ac 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForUtils.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParForUtils.java
@@ -38,7 +38,6 @@ import org.apache.sysml.api.DMLScript;
import org.apache.sysml.conf.ConfigurationManager;
import org.apache.sysml.parser.Expression.DataType;
import org.apache.sysml.parser.ParForStatementBlock.ResultVar;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.ParForProgramBlock;
import org.apache.sysml.runtime.controlprogram.caching.CacheStatistics;
@@ -90,9 +89,7 @@ public class RemoteParForUtils
}
}
- public static void exportResultVariables( long workerID, LocalVariableMap vars, ArrayList<ResultVar> resultVars, OutputCollector<Writable, Writable> out )
- throws DMLRuntimeException, IOException
- {
+ public static void exportResultVariables( long workerID, LocalVariableMap vars, ArrayList<ResultVar> resultVars, OutputCollector<Writable, Writable> out ) throws IOException {
exportResultVariables(workerID, vars, resultVars, null, out);
}
@@ -103,13 +100,11 @@ public class RemoteParForUtils
* @param vars local variable map
* @param resultVars list of result variables
* @param rvarFnames ?
- * @param out output collector
- * @throws DMLRuntimeException if DMLRuntimeException occurs
+ * @param out output collectors
* @throws IOException if IOException occurs
*/
public static void exportResultVariables( long workerID, LocalVariableMap vars, ArrayList<ResultVar> resultVars,
- HashMap<String,String> rvarFnames, OutputCollector<Writable, Writable> out )
- throws DMLRuntimeException, IOException
+ HashMap<String,String> rvarFnames, OutputCollector<Writable, Writable> out ) throws IOException
{
//create key and value for reuse
LongWritable okey = new LongWritable( workerID );
@@ -159,11 +154,10 @@ public class RemoteParForUtils
* @param vars local variable map
* @param resultVars list of result variables
* @return list of result variables
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws IOException if IOException occurs
*/
public static ArrayList<String> exportResultVariables( long workerID, LocalVariableMap vars, ArrayList<ResultVar> resultVars)
- throws DMLRuntimeException, IOException
+ throws IOException
{
ArrayList<String> ret = new ArrayList<>();
@@ -218,7 +212,6 @@ public class RemoteParForUtils
}
public static LocalVariableMap[] getResults( List<Tuple2<Long,String>> out, Log LOG )
- throws DMLRuntimeException
{
HashMap<Long,LocalVariableMap> tmp = new HashMap<>();
@@ -228,10 +221,10 @@ public class RemoteParForUtils
Long key = entry._1();
String val = entry._2();
if( !tmp.containsKey( key ) )
- tmp.put(key, new LocalVariableMap ());
+ tmp.put(key, new LocalVariableMap ());
Object[] dat = ProgramConverter.parseDataObject( val );
- tmp.get(key).put((String)dat[0], (Data)dat[1]);
- countAll++;
+ tmp.get(key).put((String)dat[0], (Data)dat[1]);
+ countAll++;
}
if( LOG != null ) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMerge.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMerge.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMerge.java
index 7d43475..be87b17 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMerge.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMerge.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
import org.apache.sysml.runtime.instructions.InstructionUtils;
import org.apache.sysml.runtime.matrix.data.DenseBlock;
@@ -71,10 +70,8 @@ public abstract class ResultMerge implements Serializable
* of one input matrix at a time.
*
* @return output (merged) matrix
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract MatrixObject executeSerialMerge()
- throws DMLRuntimeException;
+ public abstract MatrixObject executeSerialMerge();
/**
* Merge all given input matrices in parallel into the given output matrix.
@@ -83,10 +80,8 @@ public abstract class ResultMerge implements Serializable
*
* @param par degree of parallelism
* @return output (merged) matrix
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract MatrixObject executeParallelMerge( int par )
- throws DMLRuntimeException;
+ public abstract MatrixObject executeParallelMerge( int par );
/**
* ?
@@ -94,9 +89,8 @@ public abstract class ResultMerge implements Serializable
* @param out initially empty block
* @param in input matrix block
* @param appendOnly ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- protected void mergeWithoutComp( MatrixBlock out, MatrixBlock in, boolean appendOnly ) throws DMLRuntimeException {
+ protected void mergeWithoutComp( MatrixBlock out, MatrixBlock in, boolean appendOnly ) {
//pass through to matrix block operations
if( _isAccum )
out.binaryOperationsInPlace(PLUS, in);
@@ -111,10 +105,8 @@ public abstract class ResultMerge implements Serializable
* @param out output matrix block
* @param in input matrix block
* @param compare ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected void mergeWithComp( MatrixBlock out, MatrixBlock in, DenseBlock compare )
- throws DMLRuntimeException
{
//Notes for result correctness:
// * Always iterate over entire block in order to compare all values
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalAutomatic.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalAutomatic.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalAutomatic.java
index 135cf9c..aa42753 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalAutomatic.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalAutomatic.java
@@ -21,7 +21,6 @@ package org.apache.sysml.runtime.controlprogram.parfor;
import org.apache.sysml.hops.OptimizerUtils;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
import org.apache.sysml.runtime.controlprogram.parfor.opt.OptimizerRuleBased;
import org.apache.sysml.runtime.controlprogram.parfor.stat.Timing;
@@ -38,9 +37,7 @@ public class ResultMergeLocalAutomatic extends ResultMerge
}
@Override
- public MatrixObject executeSerialMerge()
- throws DMLRuntimeException
- {
+ public MatrixObject executeSerialMerge() {
Timing time = new Timing(true);
MatrixCharacteristics mc = _output.getMatrixCharacteristics();
@@ -60,9 +57,7 @@ public class ResultMergeLocalAutomatic extends ResultMerge
}
@Override
- public MatrixObject executeParallelMerge(int par)
- throws DMLRuntimeException
- {
+ public MatrixObject executeParallelMerge(int par) {
MatrixCharacteristics mc = _output.getMatrixCharacteristics();
long rows = mc.getRows();
long cols = mc.getCols();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalFile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalFile.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalFile.java
index b2bd267..4f7fac5 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalFile.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalFile.java
@@ -87,9 +87,7 @@ public class ResultMergeLocalFile extends ResultMerge
@Override
- public MatrixObject executeSerialMerge()
- throws DMLRuntimeException
- {
+ public MatrixObject executeSerialMerge() {
MatrixObject moNew = null; //always create new matrix object (required for nested parallelism)
if( LOG.isTraceEnabled() )
@@ -140,16 +138,12 @@ public class ResultMergeLocalFile extends ResultMerge
}
@Override
- public MatrixObject executeParallelMerge(int par)
- throws DMLRuntimeException
- {
+ public MatrixObject executeParallelMerge(int par) {
//graceful degradation to serial merge
return executeSerialMerge();
}
- private MatrixObject createNewMatrixObject(MatrixObject output, ArrayList<MatrixObject> inMO)
- throws DMLRuntimeException
- {
+ private MatrixObject createNewMatrixObject(MatrixObject output, ArrayList<MatrixObject> inMO) {
MetaDataFormat metadata = (MetaDataFormat) _output.getMetaData();
MatrixObject moNew = new MatrixObject( _output.getValueType(), _outputFName );
@@ -166,7 +160,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private void merge( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
OutputInfo oi = ((MetaDataFormat)outMo.getMetaData()).getOutputInfo();
boolean withCompare = ( outMo.getNnz() != 0 ); //if nnz exist or unknown (-1)
@@ -195,7 +188,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private static void mergeTextCellWithoutComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
try
{
@@ -262,7 +254,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private void mergeTextCellWithComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
String fnameStaging = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
String fnameStagingCompare = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
@@ -302,7 +293,6 @@ public class ResultMergeLocalFile extends ResultMerge
@SuppressWarnings("deprecation")
private static void mergeBinaryCellWithoutComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
try
{
@@ -362,7 +352,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private void mergeBinaryCellWithComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
String fnameStaging = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
String fnameStagingCompare = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
@@ -401,7 +390,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private void mergeBinaryBlockWithoutComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
String fnameStaging = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
@@ -431,7 +419,6 @@ public class ResultMergeLocalFile extends ResultMerge
}
private void mergeBinaryBlockWithComp( String fnameNew, MatrixObject outMo, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException
{
String fnameStaging = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
String fnameStagingCompare = LocalFileUtils.getUniqueWorkingDir(LocalFileUtils.CATEGORY_RESULTMERGE);
@@ -609,7 +596,7 @@ public class ResultMergeLocalFile extends ResultMerge
}
private static void appendCellBufferToStagingArea( String fnameStaging, long ID, LinkedList<Cell> buffer, int brlen, int bclen )
- throws DMLRuntimeException, IOException
+ throws IOException
{
HashMap<Long,HashMap<Long,LinkedList<Cell>>> sortedBuffer = new HashMap<>();
long brow, bcol, row_offset, col_offset;
@@ -975,7 +962,7 @@ public class ResultMergeLocalFile extends ResultMerge
}
private static void copyAllFiles( String fnameNew, ArrayList<MatrixObject> inMO )
- throws DMLRuntimeException, IOException
+ throws IOException
{
JobConf job = new JobConf(ConfigurationManager.getCachedJobConf());
Path path = new Path( fnameNew );
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalMemory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalMemory.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalMemory.java
index 1a74635..e3a2e82 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalMemory.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeLocalMemory.java
@@ -53,7 +53,6 @@ public class ResultMergeLocalMemory extends ResultMerge
@Override
public MatrixObject executeSerialMerge()
- throws DMLRuntimeException
{
MatrixObject moNew = null; //always create new matrix object (required for nested parallelism)
@@ -142,8 +141,7 @@ public class ResultMergeLocalMemory extends ResultMerge
@Override
public MatrixObject executeParallelMerge( int par )
- throws DMLRuntimeException
- {
+ {
MatrixObject moNew = null; //always create new matrix object (required for nested parallelism)
if( LOG.isTraceEnabled() )
@@ -225,9 +223,7 @@ public class ResultMergeLocalMemory extends ResultMerge
return null;
}
- private MatrixObject createNewMatrixObject( MatrixBlock data )
- throws DMLRuntimeException
- {
+ private MatrixObject createNewMatrixObject( MatrixBlock data ) {
ValueType vt = _output.getValueType();
MetaDataFormat metadata = (MetaDataFormat) _output.getMetaData();
MatrixObject moNew = new MatrixObject( vt, _outputFName );
@@ -246,8 +242,8 @@ public class ResultMergeLocalMemory extends ResultMerge
data.examSparsity();
//release new output
- moNew.acquireModify(data);
- moNew.release();
+ moNew.acquireModify(data);
+ moNew.release();
return moNew;
}
@@ -263,11 +259,8 @@ public class ResultMergeLocalMemory extends ResultMerge
* @param out output matrix block
* @param in input matrix block
* @param appendOnly ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- private void merge( MatrixBlock out, MatrixBlock in, boolean appendOnly )
- throws DMLRuntimeException
- {
+ private void merge( MatrixBlock out, MatrixBlock in, boolean appendOnly ) {
if( _compare == null )
mergeWithoutComp(out, in, appendOnly);
else
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteMR.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteMR.java
index c20f0db..0a785fd 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteMR.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteMR.java
@@ -85,16 +85,13 @@ public class ResultMergeRemoteMR extends ResultMerge
}
@Override
- public MatrixObject executeSerialMerge()
- throws DMLRuntimeException
- {
+ public MatrixObject executeSerialMerge() {
//graceful degradation to parallel merge
return executeParallelMerge( _numMappers );
}
@Override
public MatrixObject executeParallelMerge(int par)
- throws DMLRuntimeException
{
MatrixObject moNew = null; //always create new matrix object (required for nested parallelism)
if( LOG.isTraceEnabled() )
@@ -160,7 +157,6 @@ public class ResultMergeRemoteMR extends ResultMerge
@SuppressWarnings({ "unused", "deprecation" })
protected void executeMerge(String fname, String fnameNew, String[] srcFnames, InputInfo ii, OutputInfo oi, long rlen, long clen, int brlen, int bclen)
- throws DMLRuntimeException
{
String jobname = "ParFor-RMMR";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteReducer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteReducer.java
index 6fa6534..41c6b5c 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteReducer.java
@@ -277,12 +277,12 @@ public class ResultMergeRemoteReducer
}
@Override
- public MatrixObject executeParallelMerge(int par) throws DMLRuntimeException {
+ public MatrixObject executeParallelMerge(int par) {
throw new DMLRuntimeException("Unsupported operation.");
}
@Override
- public MatrixObject executeSerialMerge() throws DMLRuntimeException {
+ public MatrixObject executeSerialMerge() {
throw new DMLRuntimeException("Unsupported operation.");
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSpark.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSpark.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSpark.java
index a68c23e..e801dc8 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSpark.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSpark.java
@@ -62,16 +62,13 @@ public class ResultMergeRemoteSpark extends ResultMerge
}
@Override
- public MatrixObject executeSerialMerge()
- throws DMLRuntimeException
- {
+ public MatrixObject executeSerialMerge() {
//graceful degradation to parallel merge
return executeParallelMerge( _numMappers );
}
@Override
public MatrixObject executeParallelMerge(int par)
- throws DMLRuntimeException
{
MatrixObject moNew = null; //always create new matrix object (required for nested parallelism)
@@ -113,7 +110,6 @@ public class ResultMergeRemoteSpark extends ResultMerge
@SuppressWarnings("unchecked")
protected RDDObject executeMerge(MatrixObject compare, MatrixObject[] inputs, long rlen, long clen, int brlen, int bclen)
- throws DMLRuntimeException
{
String jobname = "ParFor-RMSP";
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSparkWCompare.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSparkWCompare.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSparkWCompare.java
index 9a755b2..82a64c0 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSparkWCompare.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/ResultMergeRemoteSparkWCompare.java
@@ -61,12 +61,12 @@ public class ResultMergeRemoteSparkWCompare extends ResultMerge implements PairF
}
@Override
- public MatrixObject executeSerialMerge() throws DMLRuntimeException {
+ public MatrixObject executeSerialMerge() {
throw new DMLRuntimeException("Unsupported operation.");
}
@Override
- public MatrixObject executeParallelMerge(int par) throws DMLRuntimeException {
+ public MatrixObject executeParallelMerge(int par) {
throw new DMLRuntimeException("Unsupported operation.");
}
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitioner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitioner.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitioner.java
index fe8311f..70f7bc9 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitioner.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitioner.java
@@ -21,7 +21,6 @@ package org.apache.sysml.runtime.controlprogram.parfor;
import java.util.List;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.instructions.cp.IntObject;
/**
@@ -60,10 +59,8 @@ public abstract class TaskPartitioner
* Creates and returns set of all tasks for given problem at once.
*
* @return list of tasks
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract List<Task> createTasks()
- throws DMLRuntimeException;
+ public abstract List<Task> createTasks();
/**
* Creates set of all tasks for given problem, but streams them directly
@@ -72,10 +69,8 @@ public abstract class TaskPartitioner
*
* @param queue queue of takss
* @return ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract long createTasks( LocalTaskQueue<Task> queue )
- throws DMLRuntimeException;
+ public abstract long createTasks( LocalTaskQueue<Task> queue );
public long getNumIterations() {
return _numIter;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFactoring.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFactoring.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFactoring.java
index 547e607..6b3f677 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFactoring.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFactoring.java
@@ -52,8 +52,7 @@ public class TaskPartitionerFactoring extends TaskPartitioner
}
@Override
- public List<Task> createTasks()
- throws DMLRuntimeException
+ public List<Task> createTasks()
{
LinkedList<Task> tasks = new LinkedList<>();
long lFrom = _fromVal.getLongValue();
@@ -107,8 +106,7 @@ public class TaskPartitionerFactoring extends TaskPartitioner
@Override
public long createTasks(LocalTaskQueue<Task> queue)
- throws DMLRuntimeException
- {
+ {
long numCreatedTasks = 0;
long lFrom = _fromVal.getLongValue();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFixedsize.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFixedsize.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFixedsize.java
index f283b69..bcc8348 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFixedsize.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/TaskPartitionerFixedsize.java
@@ -44,7 +44,6 @@ public class TaskPartitionerFixedsize extends TaskPartitioner
@Override
public List<Task> createTasks()
- throws DMLRuntimeException
{
LinkedList<Task> tasks = new LinkedList<>();
@@ -92,7 +91,6 @@ public class TaskPartitionerFixedsize extends TaskPartitioner
@Override
public long createTasks(LocalTaskQueue<Task> queue)
- throws DMLRuntimeException
{
long numCreatedTasks=0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/mqo/RuntimePiggybacking.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/mqo/RuntimePiggybacking.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/mqo/RuntimePiggybacking.java
index bab457b..5f3b04d 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/mqo/RuntimePiggybacking.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/mqo/RuntimePiggybacking.java
@@ -67,20 +67,15 @@ public class RuntimePiggybacking
// public interface to runtime piggybacking
///////
- public static boolean isActive()
- {
+ public static boolean isActive() {
return _active;
}
- public static void start( int par )
- throws DMLRuntimeException
- {
+ public static void start( int par ) {
start( DEFAULT_WORKER_TYPE, par );
}
- public static void start( PiggybackingType type, int par )
- throws DMLRuntimeException
- {
+ public static void start( PiggybackingType type, int par ) {
//activate piggybacking server
_active = true;
@@ -104,9 +99,7 @@ public class RuntimePiggybacking
_worker.start();
}
- public static void stop()
- throws DMLRuntimeException
- {
+ public static void stop() {
try
{
//deactivate piggybacking server
@@ -123,9 +116,7 @@ public class RuntimePiggybacking
}
}
- public static JobReturn submitJob(MRJobInstruction inst)
- throws DMLRuntimeException
- {
+ public static JobReturn submitJob(MRJobInstruction inst) {
JobReturn ret = null;
try
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimator.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimator.java
index 4af7920..2f5392e 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimator.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimator.java
@@ -25,7 +25,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.sysml.lops.LopProperties.ExecType;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.parfor.opt.OptNode.ParamType;
/**
@@ -63,10 +62,8 @@ public abstract class CostEstimator
* @param measure ?
* @param node internal representation of a plan alternative for program blocks and instructions
* @return estimate?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract double getLeafNodeEstimate( TestMeasure measure, OptNode node )
- throws DMLRuntimeException;
+ public abstract double getLeafNodeEstimate( TestMeasure measure, OptNode node );
/**
* Main leaf node estimation method - to be overwritten by specific cost estimators
@@ -75,10 +72,8 @@ public abstract class CostEstimator
* @param node internal representation of a plan alternative for program blocks and instructions
* @param et forced execution type for leaf node
* @return estimate?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract double getLeafNodeEstimate( TestMeasure measure, OptNode node, ExecType et )
- throws DMLRuntimeException;
+ public abstract double getLeafNodeEstimate( TestMeasure measure, OptNode node, ExecType et );
/////////
@@ -92,22 +87,16 @@ public abstract class CostEstimator
* @param node internal representation of a plan alternative for program blocks and instructions
* @param inclCondPart including conditional partitioning
* @return estimate?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public double getEstimate( TestMeasure measure, OptNode node )
- throws DMLRuntimeException
- {
+ public double getEstimate( TestMeasure measure, OptNode node ) {
return getEstimate(measure, node, null);
}
- public double getEstimate( TestMeasure measure, OptNode node, boolean inclCondPart )
- throws DMLRuntimeException
- {
+ public double getEstimate( TestMeasure measure, OptNode node, boolean inclCondPart ) {
//temporarily change local flag and get estimate
boolean oldInclCondPart = _inclCondPart;
_inclCondPart = inclCondPart;
double val = getEstimate(measure, node, null);
-
//reset local flag and return
_inclCondPart = oldInclCondPart;
return val;
@@ -120,11 +109,8 @@ public abstract class CostEstimator
* @param node plan opt tree node
* @param et execution type
* @return estimate
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public double getEstimate( TestMeasure measure, OptNode node, ExecType et )
- throws DMLRuntimeException
- {
+ public double getEstimate( TestMeasure measure, OptNode node, ExecType et ) {
double val = -1;
if( node.isLeaf() )
@@ -212,27 +198,21 @@ public abstract class CostEstimator
return -1;
}
- protected double getMaxEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et )
- throws DMLRuntimeException
- {
+ protected double getMaxEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et ) {
double max = Double.MIN_VALUE; //smallest positive value
for( OptNode n : nodes )
max = Math.max(max, getEstimate(measure, n, et));
return max;
}
- protected double getSumEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et )
- throws DMLRuntimeException
- {
+ protected double getSumEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et ) {
double sum = 0;
for( OptNode n : nodes )
sum += getEstimate( measure, n, et );
- return sum;
+ return sum;
}
- protected double getWeightedEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et )
- throws DMLRuntimeException
- {
+ protected double getWeightedEstimate( TestMeasure measure, ArrayList<OptNode> nodes, ExecType et ) {
double ret = 0;
int len = nodes.size();
for( OptNode n : nodes )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorHops.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorHops.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorHops.java
index 9646b09..55d9c0c 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorHops.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorHops.java
@@ -48,7 +48,6 @@ public class CostEstimatorHops extends CostEstimator
@Override
public double getLeafNodeEstimate(TestMeasure measure, OptNode node)
- throws DMLRuntimeException
{
if( node.getNodeType() != NodeType.HOP )
return 0; //generic optnode but no childs (e.g., PB for rmvar inst)
@@ -111,7 +110,6 @@ public class CostEstimatorHops extends CostEstimator
@Override
public double getLeafNodeEstimate(TestMeasure measure, OptNode node, ExecType et)
- throws DMLRuntimeException
{
if( node.getNodeType() != NodeType.HOP )
return 0; //generic optnode but no childs (e.g., PB for rmvar inst)
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorRuntime.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorRuntime.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorRuntime.java
index 442ad48..9a842a7 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorRuntime.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/opt/CostEstimatorRuntime.java
@@ -23,7 +23,6 @@ package org.apache.sysml.runtime.controlprogram.parfor.opt;
import org.apache.sysml.hops.OptimizerUtils;
import org.apache.sysml.hops.cost.CostEstimationWrapper;
import org.apache.sysml.lops.LopProperties.ExecType;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.ProgramBlock;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
@@ -52,9 +51,7 @@ public class CostEstimatorRuntime extends CostEstimator
}
@Override
- public double getLeafNodeEstimate( TestMeasure measure, OptNode node )
- throws DMLRuntimeException
- {
+ public double getLeafNodeEstimate( TestMeasure measure, OptNode node ) {
//use CostEstimatorHops to get the memory estimate
if( measure == TestMeasure.MEMORY_USAGE )
return _costMem.getLeafNodeEstimate(measure, node);
@@ -65,9 +62,7 @@ public class CostEstimatorRuntime extends CostEstimator
}
@Override
- public double getLeafNodeEstimate( TestMeasure measure, OptNode node, ExecType et )
- throws DMLRuntimeException
- {
+ public double getLeafNodeEstimate( TestMeasure measure, OptNode node, ExecType et ) {
//use CostEstimatorHops to get the memory estimate
if( measure == TestMeasure.MEMORY_USAGE )
return _costMem.getLeafNodeEstimate(measure, node, et);
[4/5] systemml git commit: [SYSTEMML-2191] Cleanup exception
hierarchy and handling, part 2
Posted by mb...@apache.org.
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java b/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java
index f264b48..569ef14 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/CompressedMatrixBlock.java
@@ -212,12 +212,9 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
*
* +per column sparsity
*
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @return compressed matrix block or original block if incompressible
*/
- public MatrixBlock compress()
- throws DMLRuntimeException
- {
+ public MatrixBlock compress() {
//default sequential execution
return compress(1);
}
@@ -227,11 +224,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
*
* @param k number of threads
* @return compressed matrix block or original block if incompressible
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixBlock compress(int k)
- throws DMLRuntimeException
- {
+ public MatrixBlock compress(int k) {
//check for redundant compression
if( isCompressed() ){
throw new DMLRuntimeException("Redundant compression, block already compressed.");
@@ -436,8 +430,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
private static CompressedSizeInfo[] computeCompressedSizeInfos(CompressedSizeEstimator estim, int clen, int k)
- throws DMLRuntimeException
- {
+ {
try {
ExecutorService pool = CommonThreadPool.get(k);
ArrayList<SizeEstimTask> tasks = new ArrayList<>();
@@ -455,8 +448,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
}
- private static ColGroup[] compressColGroups(MatrixBlock in, CompressedSizeEstimator estim, HashMap<Integer, Double> compRatios, int rlen, List<int[]> groups, boolean denseEst)
- {
+ private static ColGroup[] compressColGroups(MatrixBlock in, CompressedSizeEstimator estim, HashMap<Integer, Double> compRatios, int rlen, List<int[]> groups, boolean denseEst) {
ColGroup[] ret = new ColGroup[groups.size()];
for( int i=0; i<groups.size(); i++ )
ret[i] = compressColGroup(in, estim, compRatios, rlen, groups.get(i), denseEst);
@@ -465,7 +457,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
private static ColGroup[] compressColGroups(MatrixBlock in, CompressedSizeEstimator estim, HashMap<Integer, Double> compRatios, int rlen, List<int[]> groups, boolean denseEst, int k)
- throws DMLRuntimeException
{
try {
ExecutorService pool = CommonThreadPool.get(k);
@@ -614,10 +605,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
*
* @return a new uncompressed matrix block containing the contents of this
* block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixBlock decompress() throws DMLRuntimeException
- {
+ public MatrixBlock decompress() {
//early abort for not yet compressed blocks
if( !isCompressed() )
return new MatrixBlock(this);
@@ -657,10 +646,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
* @param k degree of parallelism
* @return a new uncompressed matrix block containing the contents
* of this block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixBlock decompress(int k) throws DMLRuntimeException
- {
+ public MatrixBlock decompress(int k) {
//early abort for not yet compressed blocks
if( !isCompressed() )
return new MatrixBlock(this);
@@ -943,7 +930,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixValue scalarOperations(ScalarOperator sop, MatrixValue result)
- throws DMLRuntimeException
{
//call uncompressed matrix scalar if necessary
if( !isCompressed() ) {
@@ -973,7 +959,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock append(MatrixBlock that, MatrixBlock ret)
- throws DMLRuntimeException
{
//call uncompressed matrix append if necessary
if( !isCompressed() ) {
@@ -1019,7 +1004,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock chainMatrixMultOperations(MatrixBlock v, MatrixBlock w, MatrixBlock out, ChainType ctype)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ) {
@@ -1060,7 +1044,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock chainMatrixMultOperations(MatrixBlock v, MatrixBlock w, MatrixBlock out, ChainType ctype, int k)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ){
@@ -1102,7 +1085,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock aggregateBinaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, AggregateBinaryOperator op)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ) {
@@ -1192,7 +1174,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op, MatrixValue result,
int blockingFactorRow, int blockingFactorCol, MatrixIndexes indexesIn, boolean inCP)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ) {
@@ -1328,13 +1309,13 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixValue aggregateUnaryOperations(AggregateUnaryOperator op,
MatrixValue result, int blockingFactorRow, int blockingFactorCol,
- MatrixIndexes indexesIn) throws DMLRuntimeException {
+ MatrixIndexes indexesIn) {
return aggregateUnaryOperations(op, result,
blockingFactorRow, blockingFactorCol, indexesIn, false);
}
private static void aggregateUnaryOperations(AggregateUnaryOperator op,
- ArrayList<ColGroup> groups, MatrixBlock ret, int rl, int ru) throws DMLRuntimeException
+ ArrayList<ColGroup> groups, MatrixBlock ret, int rl, int ru)
{
boolean cacheDDC1 = ColGroupValue.LOW_LEVEL_OPT
&& op.indexFn instanceof ReduceCol && op.aggOp.increOp.fn instanceof KahanPlus //rowSums
@@ -1362,7 +1343,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock transposeSelfMatrixMultOperations(MatrixBlock out, MMTSJType tstype)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ) {
@@ -1406,7 +1386,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock transposeSelfMatrixMultOperations(MatrixBlock out, MMTSJType tstype, int k)
- throws DMLRuntimeException
{
//call uncompressed matrix mult if necessary
if( !isCompressed() ){
@@ -1472,7 +1451,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
* already
*/
private void rightMultByVector(MatrixBlock vector, MatrixBlock result)
- throws DMLRuntimeException
{
// initialize and allocate the result
result.allocateDenseBlock();
@@ -1490,10 +1468,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
* @param vector matrix block vector
* @param result matrix block result
* @param k number of threads
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private void rightMultByVector(MatrixBlock vector, MatrixBlock result, int k)
- throws DMLRuntimeException
{
// initialize and allocate the result
result.allocateDenseBlock();
@@ -1529,7 +1505,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
private static void rightMultByVector(ArrayList<ColGroup> groups, MatrixBlock vect, MatrixBlock ret, boolean inclUC, int rl, int ru)
- throws DMLRuntimeException
{
ColGroupValue.setupThreadLocalMemory(getMaxNumValues(groups));
@@ -1573,10 +1548,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
* buffer to hold the result; must have the appropriate size
* already
* @param doTranspose if true, transpose vector
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private static void leftMultByVectorTranspose(List<ColGroup> colGroups, MatrixBlock vector, MatrixBlock result, boolean doTranspose, boolean allocTmp)
- throws DMLRuntimeException
{
//transpose vector if required
MatrixBlock rowVector = vector;
@@ -1604,17 +1577,12 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
result.recomputeNonZeros();
}
- private static void leftMultByVectorTranspose(List<ColGroup> colGroups, ColGroupDDC vector, MatrixBlock result)
- throws DMLRuntimeException
- {
+ private static void leftMultByVectorTranspose(List<ColGroup> colGroups, ColGroupDDC vector, MatrixBlock result) {
// initialize and allocate the result
result.reset();
-
// delegate matrix-vector operation to each column group
- for( ColGroup grp : colGroups ) {
+ for( ColGroup grp : colGroups )
((ColGroupValue)grp).leftMultByRowVector(vector, result);
- }
-
// post-processing
result.recomputeNonZeros();
}
@@ -1630,10 +1598,8 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
* already
* @param doTranspose if true, transpose vector
* @param k number of threads
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private void leftMultByVectorTranspose(List<ColGroup> colGroups,MatrixBlock vector, MatrixBlock result, boolean doTranspose, int k)
- throws DMLRuntimeException
{
//transpose vector if required
MatrixBlock rowVector = vector;
@@ -1673,7 +1639,6 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
private static void leftMultByTransposeSelf(ArrayList<ColGroup> groups, MatrixBlock result, int gl, int gu)
- throws DMLRuntimeException
{
final int numRows = groups.get(0).getNumRows();
final int numGroups = groups.size();
@@ -1792,7 +1757,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public Object call() throws DMLRuntimeException
+ public Object call()
{
// setup memory pool for reuse
ColGroupValue.setupThreadLocalMemory(getMaxNumValues(_groups));
@@ -1823,7 +1788,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public Long call() throws DMLRuntimeException {
+ public Long call() {
rightMultByVector(_groups, _vect, _ret, false, _rl, _ru);
return _ret.recomputeNonZeros(_rl, _ru-1, 0, 0);
}
@@ -1844,7 +1809,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public Object call() throws DMLRuntimeException {
+ public Object call() {
leftMultByTransposeSelf(_groups, _ret, _gl, _gu);
return null;
}
@@ -1877,7 +1842,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock call() throws DMLRuntimeException {
+ public MatrixBlock call() {
aggregateUnaryOperations(_op, _groups, _ret, _rl, _ru);
return _ret;
}
@@ -1894,7 +1859,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public CompressedSizeInfo call() throws DMLRuntimeException {
+ public CompressedSizeInfo call() {
return _estim.estimateCompressedColGroupSize(new int[] { _col });
}
}
@@ -1918,7 +1883,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public ColGroup call() throws DMLRuntimeException {
+ public ColGroup call() {
return compressColGroup(_in, _estim, _compRatios, _rlen, _colIndexes, _denseEst);
}
}
@@ -1938,7 +1903,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public Object call() throws DMLRuntimeException {
+ public Object call() {
//preallocate sparse rows to avoid repeated alloc
if( _ret.isInSparseFormat() ) {
@@ -1966,16 +1931,14 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
// Graceful fallback to uncompressed linear algebra
@Override
- public MatrixValue unaryOperations(UnaryOperator op, MatrixValue result)
- throws DMLRuntimeException {
+ public MatrixValue unaryOperations(UnaryOperator op, MatrixValue result) {
printDecompressWarning("unaryOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.unaryOperations(op, result);
}
@Override
- public MatrixValue binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result)
- throws DMLRuntimeException {
+ public MatrixValue binaryOperations(BinaryOperator op, MatrixValue thatValue, MatrixValue result) {
printDecompressWarning("binaryOperations", (MatrixBlock)thatValue);
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(thatValue);
@@ -1983,8 +1946,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public void binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue)
- throws DMLRuntimeException {
+ public void binaryOperationsInPlace(BinaryOperator op, MatrixValue thatValue) {
printDecompressWarning("binaryOperationsInPlace", (MatrixBlock)thatValue);
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(thatValue);
@@ -1992,30 +1954,26 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, MatrixValue newWithCorrection)
- throws DMLRuntimeException {
+ public void incrementalAggregate(AggregateOperator aggOp, MatrixValue correction, MatrixValue newWithCorrection) {
throw new DMLRuntimeException("CompressedMatrixBlock: incrementalAggregate not supported.");
}
@Override
- public void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection)
- throws DMLRuntimeException {
+ public void incrementalAggregate(AggregateOperator aggOp, MatrixValue newWithCorrection) {
throw new DMLRuntimeException("CompressedMatrixBlock: incrementalAggregate not supported.");
}
@Override
- public MatrixValue reorgOperations(ReorgOperator op, MatrixValue ret, int startRow, int startColumn, int length)
- throws DMLRuntimeException {
+ public MatrixValue reorgOperations(ReorgOperator op, MatrixValue ret, int startRow, int startColumn, int length) {
printDecompressWarning("reorgOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.reorgOperations(op, ret, startRow, startColumn, length);
}
@Override
- public MatrixBlock append(MatrixBlock that, MatrixBlock ret, boolean cbind)
- throws DMLRuntimeException {
+ public MatrixBlock append(MatrixBlock that, MatrixBlock ret, boolean cbind) {
if( cbind ) //use supported operation
- return append(that, ret);
+ return append(that, ret);
printDecompressWarning("append-rbind", that);
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(that);
@@ -2025,8 +1983,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void append(MatrixValue v2,
ArrayList<IndexedMatrixValue> outlist, int blockRowFactor,
- int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol)
- throws DMLRuntimeException {
+ int blockColFactor, boolean cbind, boolean m2IsLast, int nextNCol) {
printDecompressWarning("append", (MatrixBlock)v2);
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(v2);
@@ -2034,14 +1991,12 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public void permutationMatrixMultOperations(MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val)
- throws DMLRuntimeException {
+ public void permutationMatrixMultOperations(MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val) {
permutationMatrixMultOperations(m2Val, out1Val, out2Val, 1);
}
@Override
- public void permutationMatrixMultOperations(MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val, int k)
- throws DMLRuntimeException {
+ public void permutationMatrixMultOperations(MatrixValue m2Val, MatrixValue out1Val, MatrixValue out2Val, int k) {
printDecompressWarning("permutationMatrixMultOperations", (MatrixBlock)m2Val);
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(m2Val);
@@ -2049,8 +2004,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock leftIndexingOperations(MatrixBlock rhsMatrix, int rl, int ru, int cl, int cu, MatrixBlock ret, UpdateType update)
- throws DMLRuntimeException {
+ public MatrixBlock leftIndexingOperations(MatrixBlock rhsMatrix, int rl, int ru, int cl, int cu, MatrixBlock ret, UpdateType update) {
printDecompressWarning("leftIndexingOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(rhsMatrix);
@@ -2058,16 +2012,14 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock leftIndexingOperations(ScalarObject scalar, int rl, int cl, MatrixBlock ret, UpdateType update)
- throws DMLRuntimeException {
+ public MatrixBlock leftIndexingOperations(ScalarObject scalar, int rl, int cl, MatrixBlock ret, UpdateType update) {
printDecompressWarning("leftIndexingOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.leftIndexingOperations(scalar, rl, cl, ret, update);
}
@Override
- public MatrixBlock slice(int rl, int ru, int cl, int cu, CacheBlock ret)
- throws DMLRuntimeException {
+ public MatrixBlock slice(int rl, int ru, int cl, int cu, CacheBlock ret) {
printDecompressWarning("slice");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.slice(rl, ru, cl, cu, ret);
@@ -2089,15 +2041,14 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixValue zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary)
- throws DMLRuntimeException {
+ public MatrixValue zeroOutOperations(MatrixValue result, IndexRange range, boolean complementary) {
printDecompressWarning("zeroOutOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.zeroOutOperations(result, range, complementary);
}
@Override
- public CM_COV_Object cmOperations(CMOperator op) throws DMLRuntimeException {
+ public CM_COV_Object cmOperations(CMOperator op) {
printDecompressWarning("cmOperations");
if( !isCompressed() || isEmptyBlock() )
return super.cmOperations(op);
@@ -2112,8 +2063,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public CM_COV_Object cmOperations(CMOperator op, MatrixBlock weights)
- throws DMLRuntimeException {
+ public CM_COV_Object cmOperations(CMOperator op, MatrixBlock weights) {
printDecompressWarning("cmOperations");
MatrixBlock right = getUncompressed(weights);
if( !isCompressed() || isEmptyBlock() )
@@ -2125,8 +2075,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public CM_COV_Object covOperations(COVOperator op, MatrixBlock that)
- throws DMLRuntimeException {
+ public CM_COV_Object covOperations(COVOperator op, MatrixBlock that) {
printDecompressWarning("covOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(that);
@@ -2134,8 +2083,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public CM_COV_Object covOperations(COVOperator op, MatrixBlock that, MatrixBlock weights)
- throws DMLRuntimeException {
+ public CM_COV_Object covOperations(COVOperator op, MatrixBlock that, MatrixBlock weights) {
printDecompressWarning("covOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right1 = getUncompressed(that);
@@ -2144,8 +2092,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixValue sortOperations(MatrixValue weights, MatrixValue result)
- throws DMLRuntimeException {
+ public MatrixValue sortOperations(MatrixValue weights, MatrixValue result) {
printDecompressWarning("sortOperations");
MatrixBlock right = getUncompressed(weights);
if( !isCompressed() )
@@ -2170,8 +2117,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock aggregateBinaryOperations(MatrixIndexes m1Index,
MatrixBlock m1Value, MatrixIndexes m2Index, MatrixBlock m2Value,
- MatrixBlock result, AggregateBinaryOperator op)
- throws DMLRuntimeException {
+ MatrixBlock result, AggregateBinaryOperator op) {
printDecompressWarning("aggregateBinaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(m2Value);
@@ -2179,8 +2125,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock aggregateTernaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock m3, MatrixBlock ret, AggregateTernaryOperator op, boolean inCP)
- throws DMLRuntimeException {
+ public MatrixBlock aggregateTernaryOperations(MatrixBlock m1, MatrixBlock m2, MatrixBlock m3, MatrixBlock ret, AggregateTernaryOperator op, boolean inCP) {
printDecompressWarning("aggregateTernaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right1 = getUncompressed(m2);
@@ -2190,8 +2135,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock uaggouterchainOperations(MatrixBlock mbLeft, MatrixBlock mbRight,
- MatrixBlock mbOut, BinaryOperator bOp, AggregateUnaryOperator uaggOp)
- throws DMLRuntimeException {
+ MatrixBlock mbOut, BinaryOperator bOp, AggregateUnaryOperator uaggOp) {
printDecompressWarning("uaggouterchainOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(mbRight);
@@ -2199,15 +2143,13 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts, MatrixValue ret, int ngroups, Operator op)
- throws DMLRuntimeException {
+ public MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts, MatrixValue ret, int ngroups, Operator op) {
return groupedAggOperations(tgt, wghts, ret, ngroups, op, 1);
}
@Override
public MatrixBlock groupedAggOperations(MatrixValue tgt, MatrixValue wghts,
- MatrixValue ret, int ngroups, Operator op, int k)
- throws DMLRuntimeException {
+ MatrixValue ret, int ngroups, Operator op, int k) {
printDecompressWarning("groupedAggOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(wghts);
@@ -2215,16 +2157,14 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock removeEmptyOperations(MatrixBlock ret, boolean rows, boolean emptyReturn, MatrixBlock select)
- throws DMLRuntimeException {
+ public MatrixBlock removeEmptyOperations(MatrixBlock ret, boolean rows, boolean emptyReturn, MatrixBlock select) {
printDecompressWarning("removeEmptyOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.removeEmptyOperations(ret, rows, emptyReturn, select);
}
@Override
- public MatrixBlock removeEmptyOperations(MatrixBlock ret, boolean rows, boolean emptyReturn)
- throws DMLRuntimeException {
+ public MatrixBlock removeEmptyOperations(MatrixBlock ret, boolean rows, boolean emptyReturn) {
printDecompressWarning("removeEmptyOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.removeEmptyOperations(ret, rows, emptyReturn);
@@ -2232,16 +2172,14 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock rexpandOperations(MatrixBlock ret, double max,
- boolean rows, boolean cast, boolean ignore, int k)
- throws DMLRuntimeException {
+ boolean rows, boolean cast, boolean ignore, int k) {
printDecompressWarning("rexpandOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.rexpandOperations(ret, max, rows, cast, ignore, k);
}
@Override
- public MatrixValue replaceOperations(MatrixValue result, double pattern, double replacement)
- throws DMLRuntimeException {
+ public MatrixValue replaceOperations(MatrixValue result, double pattern, double replacement) {
printDecompressWarning("replaceOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
return tmp.replaceOperations(result, pattern, replacement);
@@ -2249,8 +2187,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, double scalar,
- MatrixValue that, CTableMap resultMap, MatrixBlock resultBlock)
- throws DMLRuntimeException {
+ MatrixValue that, CTableMap resultMap, MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(that);
@@ -2259,8 +2196,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, double scalar,
- double scalar2, CTableMap resultMap, MatrixBlock resultBlock)
- throws DMLRuntimeException {
+ double scalar2, CTableMap resultMap, MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
tmp.ctableOperations(op, scalar, scalar2, resultMap, resultBlock);
@@ -2269,7 +2205,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, MatrixIndexes ix1,
double scalar, boolean left, int brlen, CTableMap resultMap,
- MatrixBlock resultBlock) throws DMLRuntimeException {
+ MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock tmp = isCompressed() ? decompress() : this;
tmp.ctableOperations(op, ix1, scalar, left, brlen, resultMap, resultBlock);
@@ -2278,7 +2214,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, MatrixValue that,
double scalar, boolean ignoreZeros, CTableMap resultMap,
- MatrixBlock resultBlock) throws DMLRuntimeException {
+ MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(that);
@@ -2286,8 +2222,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public void ctableOperations(Operator op, MatrixValue that, double scalar, MatrixBlock resultBlock)
- throws DMLRuntimeException {
+ public void ctableOperations(Operator op, MatrixValue that, double scalar, MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right = getUncompressed(that);
@@ -2296,8 +2231,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, MatrixValue that,
- MatrixValue that2, CTableMap resultMap)
- throws DMLRuntimeException {
+ MatrixValue that2, CTableMap resultMap) {
printDecompressWarning("ternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right1 = getUncompressed(that);
@@ -2307,8 +2241,7 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public void ctableOperations(Operator op, MatrixValue that,
- MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock)
- throws DMLRuntimeException {
+ MatrixValue that2, CTableMap resultMap, MatrixBlock resultBlock) {
printDecompressWarning("ternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right1 = getUncompressed(that);
@@ -2318,15 +2251,13 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
@Override
public MatrixBlock quaternaryOperations(QuaternaryOperator qop,
- MatrixBlock um, MatrixBlock vm, MatrixBlock wm, MatrixBlock out)
- throws DMLRuntimeException {
+ MatrixBlock um, MatrixBlock vm, MatrixBlock wm, MatrixBlock out) {
return quaternaryOperations(qop, um, vm, wm, out, 1);
}
@Override
public MatrixBlock quaternaryOperations(QuaternaryOperator qop, MatrixBlock um,
- MatrixBlock vm, MatrixBlock wm, MatrixBlock out, int k)
- throws DMLRuntimeException {
+ MatrixBlock vm, MatrixBlock wm, MatrixBlock out, int k) {
printDecompressWarning("quaternaryOperations");
MatrixBlock left = isCompressed() ? decompress() : this;
MatrixBlock right1 = getUncompressed(um);
@@ -2336,30 +2267,26 @@ public class CompressedMatrixBlock extends MatrixBlock implements Externalizable
}
@Override
- public MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, Well1024a bigrand, long bSeed)
- throws DMLRuntimeException {
- throw new RuntimeException("CompressedMatrixBlock: randOperationsInPlace not supported.");
+ public MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, Well1024a bigrand, long bSeed) {
+ throw new DMLRuntimeException("CompressedMatrixBlock: randOperationsInPlace not supported.");
}
@Override
- public MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, Well1024a bigrand, long bSeed, int k)
- throws DMLRuntimeException {
- throw new RuntimeException("CompressedMatrixBlock: randOperationsInPlace not supported.");
+ public MatrixBlock randOperationsInPlace(RandomMatrixGenerator rgen, Well1024a bigrand, long bSeed, int k) {
+ throw new DMLRuntimeException("CompressedMatrixBlock: randOperationsInPlace not supported.");
}
@Override
- public MatrixBlock seqOperationsInPlace(double from, double to, double incr)
- throws DMLRuntimeException {
+ public MatrixBlock seqOperationsInPlace(double from, double to, double incr) {
//output should always be uncompressed
- throw new RuntimeException("CompressedMatrixBlock: seqOperationsInPlace not supported.");
+ throw new DMLRuntimeException("CompressedMatrixBlock: seqOperationsInPlace not supported.");
}
private static boolean isCompressed(MatrixBlock mb) {
return (mb instanceof CompressedMatrixBlock && ((CompressedMatrixBlock)mb).isCompressed());
}
- private static MatrixBlock getUncompressed(MatrixValue mVal)
- throws DMLRuntimeException {
+ private static MatrixBlock getUncompressed(MatrixValue mVal) {
return isCompressed((MatrixBlock)mVal) ?
((CompressedMatrixBlock)mVal).decompress() :
(MatrixBlock)mVal;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/cocode/PlanningCoCoder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/cocode/PlanningCoCoder.java b/src/main/java/org/apache/sysml/runtime/compress/cocode/PlanningCoCoder.java
index e00c734..d6f6566 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/cocode/PlanningCoCoder.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/cocode/PlanningCoCoder.java
@@ -48,7 +48,6 @@ public class PlanningCoCoder
public static List<int[]> findCocodesByPartitioning(CompressedSizeEstimator sizeEstimator, List<Integer> cols,
CompressedSizeInfo[] colInfos, int numRows, int k)
- throws DMLRuntimeException
{
// filtering out non-groupable columns as singleton groups
// weight is the ratio of its cardinality to the number of rows
@@ -92,7 +91,6 @@ public class PlanningCoCoder
}
private static List<int[]> getCocodingGroupsBruteForce(List<List<Integer>> bins, HashMap<Integer, GroupableColInfo> groupColsInfo, CompressedSizeEstimator estim, int rlen, int k)
- throws DMLRuntimeException
{
List<int[]> retGroups = new ArrayList<>();
try {
@@ -226,7 +224,7 @@ public class PlanningCoCoder
}
@Override
- public PlanningCoCodingGroup[] call() throws DMLRuntimeException {
+ public PlanningCoCodingGroup[] call() {
// brute force co-coding
return findCocodesBruteForce(_estim, _rlen,
_sgroups.toArray(new PlanningCoCodingGroup[0]));
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/estim/CompressedSizeEstimatorSample.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/estim/CompressedSizeEstimatorSample.java b/src/main/java/org/apache/sysml/runtime/compress/estim/CompressedSizeEstimatorSample.java
index f3d842a..d4c829c 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/estim/CompressedSizeEstimatorSample.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/estim/CompressedSizeEstimatorSample.java
@@ -28,7 +28,6 @@ import org.apache.commons.math3.analysis.UnivariateFunction;
import org.apache.commons.math3.analysis.solvers.UnivariateSolverUtils;
import org.apache.commons.math3.distribution.ChiSquaredDistribution;
import org.apache.commons.math3.random.RandomDataGenerator;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.BitmapEncoder;
import org.apache.sysml.runtime.compress.ReaderColumnSelection;
import org.apache.sysml.runtime.compress.CompressedMatrixBlock;
@@ -52,7 +51,6 @@ public class CompressedSizeEstimatorSample extends CompressedSizeEstimator
private HashMap<Integer, Double> _solveCache = null;
public CompressedSizeEstimatorSample(MatrixBlock data, int sampleSize)
- throws DMLRuntimeException
{
super(data);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/estim/SizeEstimatorFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/estim/SizeEstimatorFactory.java b/src/main/java/org/apache/sysml/runtime/compress/estim/SizeEstimatorFactory.java
index 63a092c..1c6f67e 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/estim/SizeEstimatorFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/estim/SizeEstimatorFactory.java
@@ -19,7 +19,6 @@
package org.apache.sysml.runtime.compress.estim;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
public class SizeEstimatorFactory
@@ -28,7 +27,7 @@ public class SizeEstimatorFactory
public static final boolean EXTRACT_SAMPLE_ONCE = true;
@SuppressWarnings("unused")
- public static CompressedSizeEstimator getSizeEstimator(MatrixBlock data, int numRows) throws DMLRuntimeException {
+ public static CompressedSizeEstimator getSizeEstimator(MatrixBlock data, int numRows) {
return (SAMPLING_RATIO == 1.0) ?
new CompressedSizeEstimatorExact(data):
new CompressedSizeEstimatorSample(data, (int) (numRows*SAMPLING_RATIO));
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
index da6ffc3..72a7b2b 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
@@ -69,12 +69,11 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* @param inputParams list of input data identifiers
* @param outputParams list of output data indentifiers
* @param baseDir base directory
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected ExternalFunctionProgramBlock(Program prog,
ArrayList<DataIdentifier> inputParams,
ArrayList<DataIdentifier> outputParams,
- String baseDir) throws DMLRuntimeException
+ String baseDir)
{
super(prog, inputParams, outputParams);
_baseDir = baseDir;
@@ -84,7 +83,7 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
ArrayList<DataIdentifier> inputParams,
ArrayList<DataIdentifier> outputParams,
HashMap<String, String> otherParams,
- String baseDir) throws DMLRuntimeException {
+ String baseDir) {
super(prog, inputParams, outputParams);
_baseDir = baseDir;
@@ -140,7 +139,6 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
*/
@Override
public void execute(ExecutionContext ec)
- throws DMLRuntimeException
{
_runID = _idSeq.getNextID();
@@ -228,9 +226,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* method to create instructions
*
- * @throws DMLRuntimeException
*/
- protected void createInstructions() throws DMLRuntimeException {
+ protected void createInstructions() {
_inst = new ArrayList<>();
@@ -267,7 +264,7 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
}
@SuppressWarnings("unchecked")
- protected PackageFunction createFunctionObject(String className, String configFile) throws DMLRuntimeException {
+ protected PackageFunction createFunctionObject(String className, String configFile) {
try {
//create instance of package function
Class<Instruction> cla = (Class<Instruction>) Class.forName(className);
@@ -287,9 +284,7 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
}
}
- protected void verifyFunctionInputsOutputs(PackageFunction fun, CPOperand[] inputs, CPOperand[] outputs)
- throws DMLRuntimeException
- {
+ protected void verifyFunctionInputsOutputs(PackageFunction fun, CPOperand[] inputs, CPOperand[] outputs) {
// verify number of outputs
if( outputs.length != fun.getNumFunctionOutputs() ) {
throw new DMLRuntimeException(
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
index 48a4f52..38a3516 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
@@ -56,13 +56,12 @@ public class ExternalFunctionProgramBlockCP extends ExternalFunctionProgramBlock
* @param outputParams list of output data identifiers
* @param otherParams map of other parameters
* @param baseDir base directory
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ExternalFunctionProgramBlockCP(Program prog,
ArrayList<DataIdentifier> inputParams,
ArrayList<DataIdentifier> outputParams,
HashMap<String, String> otherParams,
- String baseDir) throws DMLRuntimeException {
+ String baseDir) {
super(prog, inputParams, outputParams, baseDir); //w/o instruction generation
@@ -79,7 +78,7 @@ public class ExternalFunctionProgramBlockCP extends ExternalFunctionProgramBlock
* invocation
*/
@Override
- public void execute(ExecutionContext ec) throws DMLRuntimeException
+ public void execute(ExecutionContext ec)
{
if( _inst.size() != 1 )
throw new DMLRuntimeException("Invalid number of instructions: "+_inst.size());
@@ -98,7 +97,7 @@ public class ExternalFunctionProgramBlockCP extends ExternalFunctionProgramBlock
}
@Override
- protected void createInstructions() throws DMLRuntimeException
+ protected void createInstructions()
{
_inst = new ArrayList<>();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
index c28825e..400af92 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
@@ -100,9 +100,7 @@ public class ForProgramBlock extends ProgramBlock
}
@Override
- public void execute(ExecutionContext ec)
- throws DMLRuntimeException
- {
+ public void execute(ExecutionContext ec) {
// evaluate from, to, incr only once (assumption: known at for entry)
IntObject from = executePredicateInstructions( 1, _fromInstructions, ec );
IntObject to = executePredicateInstructions( 2, _toInstructions, ec );
@@ -155,7 +153,6 @@ public class ForProgramBlock extends ProgramBlock
}
protected IntObject executePredicateInstructions( int pos, ArrayList<Instruction> instructions, ExecutionContext ec )
- throws DMLRuntimeException
{
ScalarObject tmp = null;
IntObject ret = null;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
index a8e1d17..5ea84a7 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
@@ -81,8 +81,7 @@ public class FunctionProgramBlock extends ProgramBlock
@Override
public void execute(ExecutionContext ec)
- throws DMLRuntimeException
- {
+ {
//dynamically recompile entire function body (according to function inputs)
try {
if( ConfigurationManager.isDynamicRecompilation()
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
index b09a1a3..8ddf829 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
@@ -97,8 +97,7 @@ public class IfProgramBlock extends ProgramBlock
@Override
public void execute(ExecutionContext ec)
- throws DMLRuntimeException
- {
+ {
BooleanObject predResult = executePredicate(ec);
//execute if statement
@@ -151,7 +150,6 @@ public class IfProgramBlock extends ProgramBlock
}
private BooleanObject executePredicate(ExecutionContext ec)
- throws DMLRuntimeException
{
BooleanObject result = null;
try
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java b/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
index c91eec4..672e9f7 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
@@ -26,7 +26,6 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.StringTokenizer;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.caching.CacheableData;
import org.apache.sysml.runtime.controlprogram.parfor.ProgramConverter;
import org.apache.sysml.runtime.controlprogram.parfor.util.IDSequence;
@@ -131,7 +130,7 @@ public class LocalVariableMap implements Cloneable
.mapToDouble(d -> ((CacheableData<?>)d).getDataSize()).sum();
}
- public String serialize() throws DMLRuntimeException {
+ public String serialize() {
StringBuilder sb = new StringBuilder();
int count = 0;
for (Entry <String, Data> e : localMap.entrySet ()) {
@@ -144,9 +143,7 @@ public class LocalVariableMap implements Cloneable
return sb.toString();
}
- public static LocalVariableMap deserialize(String varStr)
- throws DMLRuntimeException
- {
+ public static LocalVariableMap deserialize(String varStr) {
StringTokenizer st2 = new StringTokenizer (varStr, ELEMENT_DELIM );
LocalVariableMap vars = new LocalVariableMap ();
while( st2.hasMoreTokens() ) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
index fdc4732..c46e4dd 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
@@ -369,9 +369,7 @@ public class ParForProgramBlock extends ForProgramBlock
protected HashMap<Long,ArrayList<ProgramBlock>> _pbcache = null;
protected long[] _pwIDs = null;
- public ParForProgramBlock(Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ResultVar> resultVars)
- throws DMLRuntimeException
- {
+ public ParForProgramBlock(Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ResultVar> resultVars) {
this( -1, prog, iterPredVar, params, resultVars);
}
@@ -384,7 +382,6 @@ public class ParForProgramBlock extends ForProgramBlock
* @param iterPredVars ?
* @param params map of parameters
* @param resultVars list of result variable names
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ParForProgramBlock(int ID, Program prog, String iterPredVar, HashMap<String,String> params, ArrayList<ResultVar> resultVars)
{
@@ -572,7 +569,6 @@ public class ParForProgramBlock extends ForProgramBlock
@Override
public void execute(ExecutionContext ec)
- throws DMLRuntimeException
{
ParForStatementBlock sb = (ParForStatementBlock)getStatementBlock();
@@ -723,11 +719,10 @@ public class ParForProgramBlock extends ForProgramBlock
* @param from ?
* @param to ?
* @param incr ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
* @throws InterruptedException if InterruptedException occurs
*/
private void executeLocalParFor( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
- throws DMLRuntimeException, InterruptedException
+ throws InterruptedException
{
LOG.trace("Local Par For (multi-threaded) with degree of parallelism : " + _numThreads);
/* Step 1) init parallel workers, task queue and threads
@@ -856,7 +851,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void executeRemoteMRParFor( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
- throws DMLRuntimeException, IOException
+ throws IOException
{
/* Step 0) check and recompile MR inst
* Step 1) serialize child PB and inst
@@ -940,7 +935,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void executeRemoteMRParForDP( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
- throws DMLRuntimeException, IOException
+ throws IOException
{
/* Step 0) check and recompile MR inst
* Step 1) serialize child PB and inst
@@ -1011,7 +1006,6 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void executeRemoteSparkParFor(ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr)
- throws DMLRuntimeException
{
Timing time = ( _monitor ? new Timing(true) : null );
@@ -1072,7 +1066,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void executeRemoteSparkParForDP( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
- throws DMLRuntimeException, IOException
+ throws IOException
{
Timing time = ( _monitor ? new Timing(true) : null );
@@ -1136,7 +1130,6 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void handleDataPartitioning( ExecutionContext ec )
- throws DMLRuntimeException
{
PDataPartitioner dataPartitioner = _dataPartitioner;
if( dataPartitioner != PDataPartitioner.NONE )
@@ -1205,9 +1198,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
- private void handleSparkRepartitioning( ExecutionContext ec )
- throws DMLRuntimeException
- {
+ private void handleSparkRepartitioning( ExecutionContext ec ) {
if( OptimizerUtils.isSparkExecutionMode() &&
_variablesRP != null && !_variablesRP.isEmpty() ) {
SparkExecutionContext sec = (SparkExecutionContext) ec;
@@ -1216,9 +1207,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
- private void handleSparkEagerCaching( ExecutionContext ec )
- throws DMLRuntimeException
- {
+ private void handleSparkEagerCaching( ExecutionContext ec ) {
if( OptimizerUtils.isSparkExecutionMode() &&
_variablesECache != null && !_variablesECache.isEmpty() ) {
SparkExecutionContext sec = (SparkExecutionContext) ec;
@@ -1233,11 +1222,8 @@ public class ParForProgramBlock extends ForProgramBlock
* @param ec execution context
* @param out output matrix
* @param in array of input matrix objects
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- private static void cleanWorkerResultVariables(ExecutionContext ec, MatrixObject out, MatrixObject[] in)
- throws DMLRuntimeException
- {
+ private static void cleanWorkerResultVariables(ExecutionContext ec, MatrixObject out, MatrixObject[] in) {
for( MatrixObject tmp : in ) {
//check for empty inputs (no iterations executed)
if( tmp != null && tmp != out )
@@ -1254,10 +1240,8 @@ public class ParForProgramBlock extends ForProgramBlock
*
* @param out local variable map
* @param sb statement block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private static void createEmptyUnscopedVariables( LocalVariableMap out, StatementBlock sb )
- throws DMLRuntimeException
{
VariableSet updated = sb.variablesUpdated();
VariableSet livein = sb.liveIn();
@@ -1330,9 +1314,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
- private void cleanupSharedVariables( ExecutionContext ec, boolean[] varState )
- throws DMLRuntimeException
- {
+ private void cleanupSharedVariables( ExecutionContext ec, boolean[] varState ) {
//TODO needs as precondition a systematic treatment of persistent read information.
}
@@ -1405,10 +1387,8 @@ public class ParForProgramBlock extends ForProgramBlock
* @param to ?
* @param incr ?
* @return task partitioner
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private TaskPartitioner createTaskPartitioner( IntObject from, IntObject to, IntObject incr )
- throws DMLRuntimeException
{
TaskPartitioner tp = null;
@@ -1454,10 +1434,8 @@ public class ParForProgramBlock extends ForProgramBlock
* @param dataPartitioner data partitioner
* @param ec execution context
* @return data partitioner
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private DataPartitioner createDataPartitioner(PartitionFormat dpf, PDataPartitioner dataPartitioner, ExecutionContext ec)
- throws DMLRuntimeException
{
DataPartitioner dp = null;
@@ -1491,7 +1469,6 @@ public class ParForProgramBlock extends ForProgramBlock
}
private ResultMerge createResultMerge( PResultMerge prm, MatrixObject out, MatrixObject[] in, String fname, boolean accum, ExecutionContext ec )
- throws DMLRuntimeException
{
ResultMerge rm = null;
@@ -1550,10 +1527,8 @@ public class ParForProgramBlock extends ForProgramBlock
*
* @param tid thread id
* @return true if recompile was necessary and possible
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private boolean checkMRAndRecompileToCP(long tid)
- throws DMLRuntimeException
{
//no MR instructions, ok
if( !OptTreeConverter.rContainsMRJobInstruction(this, true) )
@@ -1572,15 +1547,13 @@ public class ParForProgramBlock extends ForProgramBlock
return true;
}
- private void releaseForcedRecompile(long tid)
- throws DMLRuntimeException
- {
+ private void releaseForcedRecompile(long tid) {
Recompiler.recompileProgramBlockHierarchy2Forced(
_childBlocks, tid, new HashSet<String>(), null);
}
private static String writeTasksToFile(String fname, List<Task> tasks, int maxDigits)
- throws DMLRuntimeException, IOException
+ throws IOException
{
BufferedWriter br = null;
try
@@ -1607,7 +1580,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
private static String writeTasksToFile(String fname, LocalTaskQueue<Task> queue, int maxDigits)
- throws DMLRuntimeException, IOException
+ throws IOException
{
BufferedWriter br = null;
try
@@ -1640,7 +1613,6 @@ public class ParForProgramBlock extends ForProgramBlock
}
private void consolidateAndCheckResults(ExecutionContext ec, long expIters, long expTasks, long numIters, long numTasks, LocalVariableMap [] results)
- throws DMLRuntimeException
{
Timing time = new Timing(true);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java b/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
index 9dd4b9c..48b05b6 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
@@ -85,7 +85,7 @@ public class Program
return retVal;
}
- public synchronized FunctionProgramBlock getFunctionProgramBlock(String namespace, String fname) throws DMLRuntimeException{
+ public synchronized FunctionProgramBlock getFunctionProgramBlock(String namespace, String fname){
if (namespace == null) namespace = DMLProgram.DEFAULT_NAMESPACE;
HashMap<String,FunctionProgramBlock> namespaceFunctBlocks = _namespaceFunctions.get(namespace);
@@ -106,9 +106,7 @@ public class Program
return _programBlocks;
}
- public void execute(ExecutionContext ec)
- throws DMLRuntimeException
- {
+ public void execute(ExecutionContext ec) {
ec.initDebugProgramCounters();
try
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
index 54c9e70..308c6a5 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
@@ -126,10 +126,8 @@ public class ProgramBlock implements ParseInfo
* Executes this program block (incl recompilation if required).
*
* @param ec execution context
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public void execute(ExecutionContext ec)
- throws DMLRuntimeException
{
ArrayList<Instruction> tmp = _inst;
@@ -172,10 +170,8 @@ public class ProgramBlock implements ParseInfo
* @param retType value type of the return type
* @param ec execution context
* @return scalar object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ScalarObject executePredicate(ArrayList<Instruction> inst, Hop hops, boolean requiresRecompile, ValueType retType, ExecutionContext ec)
- throws DMLRuntimeException
{
ArrayList<Instruction> tmp = inst;
@@ -205,23 +201,17 @@ public class ProgramBlock implements ParseInfo
return executePredicateInstructions(tmp, retType, ec);
}
- protected void executeInstructions(ArrayList<Instruction> inst, ExecutionContext ec)
- throws DMLRuntimeException
- {
- for (int i = 0; i < inst.size(); i++)
- {
+ protected void executeInstructions(ArrayList<Instruction> inst, ExecutionContext ec) {
+ for (int i = 0; i < inst.size(); i++) {
//indexed access required due to dynamic add
Instruction currInst = inst.get(i);
-
//execute instruction
ec.updateDebugState(i);
executeSingleInstruction(currInst, ec);
}
}
- protected ScalarObject executePredicateInstructions(ArrayList<Instruction> inst, ValueType retType, ExecutionContext ec)
- throws DMLRuntimeException
- {
+ protected ScalarObject executePredicateInstructions(ArrayList<Instruction> inst, ValueType retType, ExecutionContext ec) {
//execute all instructions (indexed access required due to debug mode)
int pos = 0;
for( Instruction currInst : inst ) {
@@ -248,9 +238,7 @@ public class ProgramBlock implements ParseInfo
return ret;
}
- private void executeSingleInstruction( Instruction currInst, ExecutionContext ec )
- throws DMLRuntimeException
- {
+ private void executeSingleInstruction( Instruction currInst, ExecutionContext ec ) {
try
{
// start time measurement for statistics
@@ -299,9 +287,7 @@ public class ProgramBlock implements ParseInfo
}
}
- protected UpdateType[] prepareUpdateInPlaceVariables(ExecutionContext ec, long tid)
- throws DMLRuntimeException
- {
+ protected UpdateType[] prepareUpdateInPlaceVariables(ExecutionContext ec, long tid) {
if( _sb == null || _sb.getUpdateInPlaceVars().isEmpty() )
return null;
@@ -331,12 +317,9 @@ public class ProgramBlock implements ParseInfo
return flags;
}
- protected void resetUpdateInPlaceVariableFlags(ExecutionContext ec, UpdateType[] flags)
- throws DMLRuntimeException
- {
+ protected void resetUpdateInPlaceVariableFlags(ExecutionContext ec, UpdateType[] flags) {
if( flags == null )
return;
-
//reset update-in-place flag to pre-loop status
ArrayList<String> varnames = _sb.getUpdateInPlaceVars();
for( int i=0; i<varnames.size(); i++ )
@@ -347,7 +330,6 @@ public class ProgramBlock implements ParseInfo
}
private static void checkSparsity( Instruction lastInst, LocalVariableMap vars )
- throws DMLRuntimeException
{
for( String varname : vars.keySet() )
{
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/WhileProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/WhileProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/WhileProgramBlock.java
index aac1f52..d3b6e59 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/WhileProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/WhileProgramBlock.java
@@ -72,7 +72,6 @@ public class WhileProgramBlock extends ProgramBlock
}
private BooleanObject executePredicate(ExecutionContext ec)
- throws DMLRuntimeException
{
BooleanObject result = null;
try
@@ -99,7 +98,7 @@ public class WhileProgramBlock extends ProgramBlock
}
@Override
- public void execute(ExecutionContext ec) throws DMLRuntimeException
+ public void execute(ExecutionContext ec)
{
//execute while loop
try
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
index 14e1e02..0badf58 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
@@ -20,7 +20,6 @@
package org.apache.sysml.runtime.controlprogram.caching;
import org.apache.hadoop.io.Writable;
-import org.apache.sysml.runtime.DMLRuntimeException;
/**
@@ -93,10 +92,8 @@ public interface CacheBlock extends Writable
* @param cu column upper
* @param block cache block
* @return sub-block of cache block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public CacheBlock slice(int rl, int ru, int cl, int cu, CacheBlock block)
- throws DMLRuntimeException;
+ public CacheBlock slice(int rl, int ru, int cl, int cu, CacheBlock block);
/**
* Merge the given block into the current block. Both blocks needs to be of equal
@@ -104,8 +101,6 @@ public interface CacheBlock extends Writable
*
* @param that cache block
* @param appendOnly ?
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void merge(CacheBlock that, boolean appendOnly)
- throws DMLRuntimeException;
+ public void merge(CacheBlock that, boolean appendOnly);
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
index b3791e1..3c001bc 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
@@ -307,8 +307,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
return _metaData.getMatrixCharacteristics();
}
- public abstract void refreshMetaData()
- throws DMLRuntimeException;
+ public abstract void refreshMetaData();
public RDDObject getRDDHandle() {
return _rddHandle;
@@ -345,7 +344,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
return _gpuObjects.get(gCtx);
}
- public synchronized void setGPUObject(GPUContext gCtx, GPUObject gObj) throws DMLRuntimeException {
+ public synchronized void setGPUObject(GPUContext gCtx, GPUObject gObj) {
GPUObject old = _gpuObjects.put(gCtx, gObj);
if (old != null)
throw new DMLRuntimeException("GPU : Inconsistent internal state - this CacheableData already has a GPUObject assigned to the current GPUContext (" + gCtx + ")");
@@ -369,7 +368,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Out-Status: READ(+1).
*
* @return cacheable data
- * @throws DMLRuntimeException if CacheException occurs
*/
public synchronized T acquireRead()
{
@@ -465,7 +463,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Out-Status: MODIFY.
*
* @return cacheable data
- * @throws DMLRuntimeException if CacheException occurs
*/
public synchronized T acquireModify()
{
@@ -525,7 +522,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* @param newData new data
* @param opcode extended instruction opcode
* @return cacheable data
- * @throws DMLRuntimeException if error occurs
*/
public synchronized T acquireModify(T newData, String opcode)
{
@@ -568,7 +564,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
return _data;
}
- public void release() throws DMLRuntimeException {
+ public void release() {
release(null);
}
@@ -582,7 +578,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: READ, MODIFY;
* Out-Status: READ(-1), EVICTABLE, EMPTY.
*
- * @throws DMLRuntimeException if CacheException occurs
*/
public synchronized void release(String opcode)
{
@@ -654,7 +649,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: EMPTY, EVICTABLE, EVICTED;
* Out-Status: EMPTY.
*
- * @throws DMLRuntimeException if error occurs
*/
public synchronized void clearData()
{
@@ -703,7 +697,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Out-Status: EMPTY, EVICTABLE, EVICTED, READ.
*
* @param replication ?
- * @throws DMLRuntimeException if CacheException occurs
*/
public synchronized void exportData( int replication ) {
exportData(_hdfsFileName, null, replication, null);
@@ -738,7 +731,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* @param replication ?
* @param formatProperties file format properties
* @param opcode instruction opcode if available
- * @throws DMLRuntimeException if CacheException occurs
*/
public synchronized void exportData (String fName, String outputFormat, int replication, FileFormatProperties formatProperties, String opcode) {
if( LOG.isTraceEnabled() )
@@ -881,7 +873,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Low-level cache I/O method that physically restores the data blob to
* main memory. Must be defined by a subclass, never called by users.
*
- * @throws DMLRuntimeException if CacheException occurs
*/
protected void restoreBlobIntoMemory() {
String cacheFilePathAndName = getCacheFilePathAndName();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
index a37ac69..2e8801b 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
@@ -132,9 +132,7 @@ public class FrameObject extends CacheableData<FrameBlock>
}
@Override
- public void refreshMetaData()
- throws DMLRuntimeException
- {
+ public void refreshMetaData() {
if ( _data == null || _metaData ==null ) //refresh only for existing data
throw new DMLRuntimeException("Cannot refresh meta data because there is no data or meta data. ");
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
index 6aefbb3..f258ea8 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
@@ -229,11 +229,8 @@ public class MatrixObject extends CacheableData<MatrixBlock>
*
* @param pred index range
* @return matrix block
- * @throws DMLRuntimeException if CacheException occurs
*/
- public synchronized MatrixBlock readMatrixPartition( IndexRange pred )
- throws DMLRuntimeException
- {
+ public synchronized MatrixBlock readMatrixPartition( IndexRange pred ) {
if( LOG.isTraceEnabled() )
LOG.trace("Acquire partition "+hashCode()+" "+pred);
long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
@@ -347,7 +344,6 @@ public class MatrixObject extends CacheableData<MatrixBlock>
}
public String getPartitionFileName( IndexRange pred, int brlen, int bclen )
- throws DMLRuntimeException
{
if ( !_partitioned )
throw new DMLRuntimeException("MatrixObject not available to indexed read.");
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
index 5416d5d..d8dc559 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
@@ -150,7 +150,7 @@ public class ExecutionContext {
return _variables.get(name);
}
- public Data getVariable(CPOperand operand) throws DMLRuntimeException {
+ public Data getVariable(CPOperand operand) {
return operand.getDataType().isScalar() ?
getScalarInput(operand) : getVariable(operand.getName());
}
@@ -167,15 +167,11 @@ public class ExecutionContext {
return _variables.remove(name);
}
- public void setMetaData(String fname, MetaData md)
- throws DMLRuntimeException
- {
+ public void setMetaData(String fname, MetaData md) {
_variables.get(fname).setMetaData(md);
}
- public MetaData getMetaData(String varname)
- throws DMLRuntimeException
- {
+ public MetaData getMetaData(String varname) {
return _variables.get(varname).getMetaData();
}
@@ -184,9 +180,7 @@ public class ExecutionContext {
return (dat!= null && dat instanceof MatrixObject);
}
- public MatrixObject getMatrixObject(String varname)
- throws DMLRuntimeException
- {
+ public MatrixObject getMatrixObject(String varname) {
Data dat = getVariable(varname);
//error handling if non existing or no matrix
@@ -198,44 +192,32 @@ public class ExecutionContext {
return (MatrixObject) dat;
}
- public FrameObject getFrameObject(String varname)
- throws DMLRuntimeException
- {
+ public FrameObject getFrameObject(String varname) {
Data dat = getVariable(varname);
-
//error handling if non existing or no matrix
if( dat == null )
throw new DMLRuntimeException("Variable '"+varname+"' does not exist in the symbol table.");
if( !(dat instanceof FrameObject) )
throw new DMLRuntimeException("Variable '"+varname+"' is not a frame.");
-
return (FrameObject) dat;
}
- public CacheableData<?> getCacheableData(String varname)
- throws DMLRuntimeException
- {
+ public CacheableData<?> getCacheableData(String varname) {
Data dat = getVariable(varname);
-
//error handling if non existing or no matrix
if( dat == null )
throw new DMLRuntimeException("Variable '"+varname+"' does not exist in the symbol table.");
if( !(dat instanceof CacheableData<?>) )
throw new DMLRuntimeException("Variable '"+varname+"' is not a matrix or frame.");
-
return (CacheableData<?>) dat;
}
- public void releaseCacheableData(String varname)
- throws DMLRuntimeException
- {
+ public void releaseCacheableData(String varname) {
CacheableData<?> dat = getCacheableData(varname);
dat.release();
}
- public MatrixCharacteristics getMatrixCharacteristics( String varname )
- throws DMLRuntimeException
- {
+ public MatrixCharacteristics getMatrixCharacteristics( String varname ) {
return getMetaData(varname).getMatrixCharacteristics();
}
@@ -245,9 +227,8 @@ public class ExecutionContext {
* @param varName variable name
* @param opcode extended opcode
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixBlock getMatrixInput(String varName, String opcode) throws DMLRuntimeException {
+ public MatrixBlock getMatrixInput(String varName, String opcode) {
long t1 = opcode != null && DMLScript.STATISTICS && DMLScript.FINEGRAINED_STATISTICS ? System.nanoTime() : 0;
MatrixBlock mb = getMatrixInput(varName);
if(opcode != null && DMLScript.STATISTICS && DMLScript.FINEGRAINED_STATISTICS) {
@@ -265,16 +246,13 @@ public class ExecutionContext {
*
* @param varName variable name
* @return matrix block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixBlock getMatrixInput(String varName)
- throws DMLRuntimeException
- {
+ public MatrixBlock getMatrixInput(String varName) {
MatrixObject mo = getMatrixObject(varName);
return mo.acquireRead();
}
- public void setMetaData(String varName, long nrows, long ncols) throws DMLRuntimeException {
+ public void setMetaData(String varName, long nrows, long ncols) {
MatrixObject mo = getMatrixObject(varName);
if(mo.getNumRows() == nrows && mo.getNumColumns() == ncols)
return;
@@ -295,9 +273,8 @@ public class ExecutionContext {
* @param d1 dimension1
* @param d2 dimension1
* @return valid d1 or d2
- * @throws DMLRuntimeException if error occurs
*/
- private static long validateDimensions(long d1, long d2) throws DMLRuntimeException {
+ private static long validateDimensions(long d1, long d2) {
if(d1 >= 0 && d2 >= 0 && d1 != d2) {
throw new DMLRuntimeException("Incorrect dimensions:" + d1 + " != " + d2);
}
@@ -310,11 +287,8 @@ public class ExecutionContext {
* @param numRows number of rows of matrix object
* @param numCols number of columns of matrix object
* @return a pair containing the wrapping {@link MatrixObject} and a boolean indicating whether a cuda memory allocation took place (as opposed to the space already being allocated)
- * @throws DMLRuntimeException
*/
- public Pair<MatrixObject, Boolean> getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols)
- throws DMLRuntimeException
- {
+ public Pair<MatrixObject, Boolean> getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols) {
MatrixObject mo = allocateGPUMatrixObject(varName, numRows, numCols);
boolean allocated = mo.getGPUObject(getGPUContext(0)).acquireDeviceModifyDense();
mo.getMatrixCharacteristics().setNonZeros(-1);
@@ -330,26 +304,22 @@ public class ExecutionContext {
* @param numCols number of columns of matrix object
* @param nnz number of non zeroes
* @return matrix object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public Pair<MatrixObject, Boolean> getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz)
- throws DMLRuntimeException
- {
+ public Pair<MatrixObject, Boolean> getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz) {
MatrixObject mo = allocateGPUMatrixObject(varName, numRows, numCols);
mo.getMatrixCharacteristics().setNonZeros(nnz);
boolean allocated = mo.getGPUObject(getGPUContext(0)).acquireDeviceModifySparse();
return new Pair<>(mo, allocated);
}
- /**
+ /**
* Allocates the {@link GPUObject} for a given LOPS Variable (eg. _mVar3)
* @param varName variable name
* @param numRows number of rows of matrix object
* @param numCols number of columns of matrix object
* @return matrix object
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public MatrixObject allocateGPUMatrixObject(String varName, long numRows, long numCols) throws DMLRuntimeException {
+ public MatrixObject allocateGPUMatrixObject(String varName, long numRows, long numCols) {
MatrixObject mo = getMatrixObject(varName);
long dim1 = -1; long dim2 = -1;
DMLRuntimeException e = null;
@@ -381,9 +351,7 @@ public class ExecutionContext {
return mo;
}
- public MatrixObject getMatrixInputForGPUInstruction(String varName, String opcode)
- throws DMLRuntimeException
- {
+ public MatrixObject getMatrixInputForGPUInstruction(String varName, String opcode) {
GPUContext gCtx = getGPUContext(0);
MatrixObject mo = getMatrixObject(varName);
if(mo == null) {
@@ -403,9 +371,8 @@ public class ExecutionContext {
* Unpins a currently pinned matrix variable and update fine-grained statistics.
*
* @param varName variable name
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void releaseMatrixInput(String varName, String opcode) throws DMLRuntimeException {
+ public void releaseMatrixInput(String varName, String opcode) {
long t1 = opcode != null && DMLScript.STATISTICS && DMLScript.FINEGRAINED_STATISTICS ? System.nanoTime() : 0;
MatrixObject mo = getMatrixObject(varName);
mo.release(opcode);
@@ -415,14 +382,12 @@ public class ExecutionContext {
}
}
- public void releaseMatrixInput(String varName) throws DMLRuntimeException {
+ public void releaseMatrixInput(String varName) {
MatrixObject mo = getMatrixObject(varName);
mo.release(null);
}
- public void releaseMatrixInputForGPUInstruction(String varName)
- throws DMLRuntimeException
- {
+ public void releaseMatrixInputForGPUInstruction(String varName) {
MatrixObject mo = getMatrixObject(varName);
mo.getGPUObject(getGPUContext(0)).releaseInput();
}
@@ -432,11 +397,8 @@ public class ExecutionContext {
*
* @param varName variable name
* @return frame block
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public FrameBlock getFrameInput(String varName)
- throws DMLRuntimeException
- {
+ public FrameBlock getFrameInput(String varName) {
FrameObject fo = getFrameObject(varName);
return fo.acquireRead();
}
@@ -445,22 +407,17 @@ public class ExecutionContext {
* Unpins a currently pinned frame variable.
*
* @param varName variable name
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public void releaseFrameInput(String varName)
- throws DMLRuntimeException
- {
+ public void releaseFrameInput(String varName) {
FrameObject fo = getFrameObject(varName);
fo.release();
}
- public ScalarObject getScalarInput(CPOperand input) throws DMLRuntimeException {
+ public ScalarObject getScalarInput(CPOperand input) {
return getScalarInput(input.getName(), input.getValueType(), input.isLiteral());
}
- public ScalarObject getScalarInput(String name, ValueType vt, boolean isLiteral)
- throws DMLRuntimeException
- {
+ public ScalarObject getScalarInput(String name, ValueType vt, boolean isLiteral) {
if ( isLiteral ) {
return ScalarObjectFactory.createScalarObject(vt, name);
}
@@ -472,13 +429,11 @@ public class ExecutionContext {
}
}
- public void setScalarOutput(String varName, ScalarObject so)
- throws DMLRuntimeException
- {
+ public void setScalarOutput(String varName, ScalarObject so) {
setVariable(varName, so);
}
- public void releaseMatrixOutputForGPUInstruction(String varName) throws DMLRuntimeException {
+ public void releaseMatrixOutputForGPUInstruction(String varName) {
MatrixObject mo = getMatrixObject(varName);
if(mo.getGPUObject(getGPUContext(0)) == null || !mo.getGPUObject(getGPUContext(0)).isAllocated()) {
throw new DMLRuntimeException("No output is allocated on GPU");
@@ -486,20 +441,18 @@ public class ExecutionContext {
mo.getGPUObject(getGPUContext(0)).releaseOutput();
}
- public void setMatrixOutput(String varName, MatrixBlock outputData) throws DMLRuntimeException {
+ public void setMatrixOutput(String varName, MatrixBlock outputData) {
setMatrixOutput(varName, outputData, null);
}
- public void setMatrixOutput(String varName, MatrixBlock outputData, String opcode) throws DMLRuntimeException {
+ public void setMatrixOutput(String varName, MatrixBlock outputData, String opcode) {
MatrixObject mo = getMatrixObject(varName);
mo.acquireModify(outputData, opcode);
mo.release(opcode);
setVariable(varName, mo);
}
- public void setMatrixOutput(String varName, MatrixBlock outputData, UpdateType flag, String opcode)
- throws DMLRuntimeException
- {
+ public void setMatrixOutput(String varName, MatrixBlock outputData, UpdateType flag, String opcode) {
if( flag.isInPlace() ) {
//modify metadata to carry update status
MatrixObject mo = getMatrixObject(varName);
@@ -510,9 +463,7 @@ public class ExecutionContext {
setMatrixOutput(varName, outputData, opcode);
}
- public void setFrameOutput(String varName, FrameBlock outputData)
- throws DMLRuntimeException
- {
+ public void setFrameOutput(String varName, FrameBlock outputData) {
FrameObject fo = getFrameObject(varName);
fo.acquireModify(outputData);
fo.release();
@@ -604,9 +555,7 @@ public class ExecutionContext {
return ret;
}
- public void cleanupCacheableData(CacheableData<?> mo)
- throws DMLRuntimeException
- {
+ public void cleanupCacheableData(CacheableData<?> mo) {
//early abort w/o scan of symbol table if no cleanup required
boolean fileExists = (mo.isHDFSFileExists() && mo.getFileName() != null);
if( !CacheableData.isCachingActive() && !fileExists )
@@ -640,51 +589,45 @@ public class ExecutionContext {
}
}
- public void updateDebugState( int index ) throws DMLRuntimeException
- {
+ public void updateDebugState( int index ) {
if(DMLScript.ENABLE_DEBUG_MODE) {
_dbState.getPC().setProgramBlockNumber(index);
}
}
- public void updateDebugState( Instruction currInst ) throws DMLRuntimeException
- {
+ public void updateDebugState( Instruction currInst ) {
if (DMLScript.ENABLE_DEBUG_MODE) {
// New change so that shell doesnot seem like it is hanging while running MR job
// Since UI cannot accept instructions when user is submitting the program
_dbState.nextCommand = false;
// Change to stop before first instruction of a given line
//update current instruction ID and line number
- _dbState.getPC().setInstID(currInst.getInstID());
+ _dbState.getPC().setInstID(currInst.getInstID());
_dbState.getPC().setLineNumber(currInst.getLineNum());
// Change to stop before first instruction of a given line
- suspendIfAskedInDebugMode(currInst);
+ suspendIfAskedInDebugMode(currInst);
}
}
- public void clearDebugProgramCounters()
- {
+ public void clearDebugProgramCounters() {
if(DMLScript.ENABLE_DEBUG_MODE) {
_dbState.pc = null;
}
}
- public void handleDebugException( Exception ex )
- {
+ public void handleDebugException( Exception ex ) {
_dbState.getDMLStackTrace(ex);
_dbState.suspend = true;
}
- public void handleDebugFunctionEntry( FunctionCallCPInstruction funCallInst ) throws DMLRuntimeException
- {
+ public void handleDebugFunctionEntry( FunctionCallCPInstruction funCallInst ) {
//push caller frame into call stack
_dbState.pushFrame(getVariables(), _dbState.getPC());
//initialize pc for callee's frame
_dbState.pc = new DMLProgramCounter(funCallInst.getNamespace(), funCallInst.getFunctionName(), 0, 0);
}
- public void handleDebugFunctionExit( FunctionCallCPInstruction funCallInst )
- {
+ public void handleDebugFunctionExit( FunctionCallCPInstruction funCallInst ) {
//pop caller frame from call stack
DMLFrame fr = _dbState.popFrame();
//update pc to caller's frame
@@ -702,10 +645,9 @@ public class ExecutionContext {
* then it will wait until user issues a new debugger command.
*
* @param currInst current instruction
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("deprecation")
- private void suspendIfAskedInDebugMode(Instruction currInst ) throws DMLRuntimeException {
+ private void suspendIfAskedInDebugMode(Instruction currInst ) {
if (!DMLScript.ENABLE_DEBUG_MODE) {
System.err.println("ERROR: The function suspendIfAskedInDebugMode should not be called in non-debug mode.");
}
[5/5] systemml git commit: [SYSTEMML-2191] Cleanup exception
hierarchy and handling, part 2
Posted by mb...@apache.org.
[SYSTEMML-2191] Cleanup exception hierarchy and handling, part 2
Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/583f3448
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/583f3448
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/583f3448
Branch: refs/heads/master
Commit: 583f3448031cd3112a6ed16ed54dbd4b59071de8
Parents: ad41c3a
Author: Matthias Boehm <mb...@gmail.com>
Authored: Sat Mar 24 01:32:40 2018 -0700
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Sat Mar 24 01:32:40 2018 -0700
----------------------------------------------------------------------
.../org/apache/sysml/hops/ConvolutionOp.java | 9 +-
.../org/apache/sysml/hops/OptimizerUtils.java | 3 +-
.../sysml/hops/cost/CostEstimationWrapper.java | 8 +-
.../sysml/hops/cost/CostEstimatorNumMRJobs.java | 11 +-
.../apache/sysml/hops/recompile/Recompiler.java | 48 ++---
.../apache/sysml/lops/runtime/RunMRJobs.java | 10 +-
.../org/apache/sysml/parser/DMLTranslator.java | 5 +-
.../sysml/runtime/codegen/CodegenUtils.java | 42 ++--
.../sysml/runtime/codegen/SpoofCellwise.java | 46 +----
.../runtime/codegen/SpoofMultiAggregate.java | 24 +--
.../sysml/runtime/codegen/SpoofOperator.java | 24 +--
.../runtime/codegen/SpoofOuterProduct.java | 8 +-
.../sysml/runtime/codegen/SpoofRowwise.java | 17 +-
.../apache/sysml/runtime/compress/ColGroup.java | 15 +-
.../sysml/runtime/compress/ColGroupDDC.java | 2 -
.../sysml/runtime/compress/ColGroupDDC1.java | 10 +-
.../sysml/runtime/compress/ColGroupDDC2.java | 7 +-
.../sysml/runtime/compress/ColGroupOLE.java | 5 -
.../sysml/runtime/compress/ColGroupOffset.java | 9 +-
.../sysml/runtime/compress/ColGroupRLE.java | 7 +-
.../runtime/compress/ColGroupUncompressed.java | 24 +--
.../sysml/runtime/compress/ColGroupValue.java | 22 +--
.../runtime/compress/CompressedMatrixBlock.java | 197 ++++++-------------
.../compress/cocode/PlanningCoCoder.java | 4 +-
.../estim/CompressedSizeEstimatorSample.java | 2 -
.../compress/estim/SizeEstimatorFactory.java | 3 +-
.../ExternalFunctionProgramBlock.java | 15 +-
.../ExternalFunctionProgramBlockCP.java | 7 +-
.../runtime/controlprogram/ForProgramBlock.java | 5 +-
.../controlprogram/FunctionProgramBlock.java | 3 +-
.../runtime/controlprogram/IfProgramBlock.java | 4 +-
.../controlprogram/LocalVariableMap.java | 7 +-
.../controlprogram/ParForProgramBlock.java | 52 ++---
.../sysml/runtime/controlprogram/Program.java | 6 +-
.../runtime/controlprogram/ProgramBlock.java | 30 +--
.../controlprogram/WhileProgramBlock.java | 3 +-
.../controlprogram/caching/CacheBlock.java | 9 +-
.../controlprogram/caching/CacheableData.java | 15 +-
.../controlprogram/caching/FrameObject.java | 4 +-
.../controlprogram/caching/MatrixObject.java | 6 +-
.../context/ExecutionContext.java | 138 ++++---------
.../context/SparkExecutionContext.java | 94 ++-------
.../controlprogram/parfor/DataPartitioner.java | 16 +-
.../parfor/DataPartitionerLocal.java | 18 +-
.../parfor/DataPartitionerRemoteMR.java | 1 -
.../parfor/DataPartitionerRemoteSpark.java | 1 -
.../DataPartitionerRemoteSparkMapper.java | 4 +-
.../controlprogram/parfor/ParWorker.java | 13 +-
.../controlprogram/parfor/ProgramConverter.java | 132 +++----------
.../controlprogram/parfor/RemoteDPParForMR.java | 4 +-
.../parfor/RemoteDPParForSpark.java | 3 -
.../parfor/RemoteDPParForSparkWorker.java | 3 +-
.../controlprogram/parfor/RemoteParForMR.java | 4 +-
.../parfor/RemoteParForSpark.java | 2 -
.../parfor/RemoteParForSparkWorker.java | 8 +-
.../parfor/RemoteParForUtils.java | 21 +-
.../controlprogram/parfor/ResultMerge.java | 14 +-
.../parfor/ResultMergeLocalAutomatic.java | 9 +-
.../parfor/ResultMergeLocalFile.java | 23 +--
.../parfor/ResultMergeLocalMemory.java | 17 +-
.../parfor/ResultMergeRemoteMR.java | 6 +-
.../parfor/ResultMergeRemoteReducer.java | 4 +-
.../parfor/ResultMergeRemoteSpark.java | 6 +-
.../parfor/ResultMergeRemoteSparkWCompare.java | 4 +-
.../controlprogram/parfor/TaskPartitioner.java | 9 +-
.../parfor/TaskPartitionerFactoring.java | 6 +-
.../parfor/TaskPartitionerFixedsize.java | 2 -
.../parfor/mqo/RuntimePiggybacking.java | 19 +-
.../parfor/opt/CostEstimator.java | 38 +---
.../parfor/opt/CostEstimatorHops.java | 2 -
.../parfor/opt/CostEstimatorRuntime.java | 9 +-
.../parfor/opt/OptTreeConverter.java | 27 +--
.../parfor/opt/OptTreePlanChecker.java | 17 +-
.../parfor/opt/OptimizationWrapper.java | 49 ++---
.../controlprogram/parfor/opt/Optimizer.java | 7 +-
.../parfor/opt/OptimizerConstrained.java | 15 +-
.../parfor/opt/OptimizerRuleBased.java | 131 +++---------
.../parfor/opt/ProgramRecompiler.java | 44 ++---
.../apache/sysml/runtime/io/FrameReader.java | 3 +-
.../sysml/runtime/io/FrameReaderFactory.java | 11 +-
.../apache/sysml/runtime/io/FrameWriter.java | 4 +-
.../runtime/io/FrameWriterBinaryBlock.java | 3 +-
.../sysml/runtime/io/FrameWriterFactory.java | 6 +-
.../apache/sysml/runtime/io/MatrixReader.java | 3 +-
.../sysml/runtime/io/MatrixReaderFactory.java | 2 -
.../apache/sysml/runtime/io/MatrixWriter.java | 4 +-
.../sysml/runtime/io/MatrixWriterFactory.java | 5 +-
.../sysml/runtime/io/ReaderBinaryBlock.java | 3 +-
.../sysml/runtime/io/WriterBinaryBlock.java | 2 +-
.../sysml/runtime/matrix/data/MatrixBlock.java | 8 +-
.../transform/decode/DecoderFactory.java | 3 +-
.../transform/encode/EncoderFactory.java | 8 +-
.../runtime/transform/meta/TfMetaUtils.java | 8 +-
.../sysml/runtime/util/ConvolutionUtils.java | 3 +-
.../sysml/runtime/util/DataConverter.java | 30 +--
.../sysml/runtime/util/LocalFileUtils.java | 19 +-
.../ExternalFunctionInvocationInstruction.java | 10 +-
src/main/java/org/apache/sysml/udf/Matrix.java | 16 +-
.../java/org/apache/sysml/utils/Explain.java | 30 +--
.../org/apache/sysml/utils/NativeHelper.java | 3 +-
.../apache/sysml/yarn/DMLAppMasterUtils.java | 29 +--
.../apache/sysml/yarn/ropt/GridEnumeration.java | 8 +-
.../sysml/yarn/ropt/GridEnumerationEqui.java | 5 +-
.../sysml/yarn/ropt/GridEnumerationExp.java | 5 +-
.../sysml/yarn/ropt/GridEnumerationHybrid.java | 10 +-
.../sysml/yarn/ropt/GridEnumerationMemory.java | 10 +-
.../apache/sysml/yarn/ropt/ResourceConfig.java | 8 +-
.../sysml/yarn/ropt/ResourceOptimizer.java | 67 ++-----
.../conversion/RDDConverterUtilsExtTest.java | 7 +-
.../functions/data/FullReblockTest.java | 3 +-
110 files changed, 494 insertions(+), 1490 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/hops/ConvolutionOp.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/ConvolutionOp.java b/src/main/java/org/apache/sysml/hops/ConvolutionOp.java
index c137462..299f7c9 100644
--- a/src/main/java/org/apache/sysml/hops/ConvolutionOp.java
+++ b/src/main/java/org/apache/sysml/hops/ConvolutionOp.java
@@ -565,7 +565,7 @@ public class ConvolutionOp extends Hop implements MultiThreadedHop
// stride1, stride2, padding1, padding2
// input_shape1, input_shape2, input_shape3, input_shape4,
// filter_shape1, filter_shape2, filter_shape3, filter_shape4
- ConvolutionParameters parseInput() throws DMLRuntimeException {
+ ConvolutionParameters parseInput() {
Hop imageHeightHop = null; Hop filterHeightHop = null;
if(op == ConvOp.MAX_POOLING_BACKWARD || op == ConvOp.AVG_POOLING_BACKWARD
@@ -652,9 +652,8 @@ public class ConvolutionOp extends Hop implements MultiThreadedHop
* @param dim1 inferred shape
* @param dim2 given shape
* @param paramType string denoting the parameter for pretty printing of the error message
- * @throws DMLRuntimeException if dim1 != dim2
*/
- private void throwExceptionIfNotEqual(int dim1, int dim2, String paramType) throws DMLRuntimeException {
+ private void throwExceptionIfNotEqual(int dim1, int dim2, String paramType) {
if(dim1 >= 0 && dim2 >= 0 && dim1 != dim2) {
throw new DMLRuntimeException("Inferred " + paramType + " from parent doesn't match with given " + paramType + ":" + dim1 + " != " + dim2);
}
@@ -662,10 +661,8 @@ public class ConvolutionOp extends Hop implements MultiThreadedHop
/**
* Gets the values for the parameters C, H, W, P, Q from parent hops
- *
- * @throws DMLRuntimeException if error occurs
*/
- private void inferCHWPQFromParentOp() throws DMLRuntimeException {
+ private void inferCHWPQFromParentOp() {
Hop tmp = getInput().get(0);
// Skip bias_add and go to its parent
tmp = isInputBiasAdd(tmp) ? tmp.getInput().get(0) : tmp;
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/hops/OptimizerUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/OptimizerUtils.java b/src/main/java/org/apache/sysml/hops/OptimizerUtils.java
index e9fe24e..3156afd 100644
--- a/src/main/java/org/apache/sysml/hops/OptimizerUtils.java
+++ b/src/main/java/org/apache/sysml/hops/OptimizerUtils.java
@@ -262,12 +262,11 @@ public class OptimizerUtils
return (getOptLevel() == level);
}
- public static CompilerConfig constructCompilerConfig( DMLConfig dmlconf ) throws DMLRuntimeException {
+ public static CompilerConfig constructCompilerConfig( DMLConfig dmlconf ) {
return constructCompilerConfig(new CompilerConfig(), dmlconf);
}
public static CompilerConfig constructCompilerConfig( CompilerConfig cconf, DMLConfig dmlconf )
- throws DMLRuntimeException
{
//each script sets its own block size, opt level etc
cconf.set(ConfigType.BLOCK_SIZE, dmlconf.getIntValue( DMLConfig.DEFAULT_BLOCK_SIZE ));
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/hops/cost/CostEstimationWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/cost/CostEstimationWrapper.java b/src/main/java/org/apache/sysml/hops/cost/CostEstimationWrapper.java
index 91300e7..6fc1fd1 100644
--- a/src/main/java/org/apache/sysml/hops/cost/CostEstimationWrapper.java
+++ b/src/main/java/org/apache/sysml/hops/cost/CostEstimationWrapper.java
@@ -78,9 +78,7 @@ public class CostEstimationWrapper
return costs;
}
- public static double getTimeEstimate(ProgramBlock pb, ExecutionContext ec, boolean recursive)
- throws DMLRuntimeException
- {
+ public static double getTimeEstimate(ProgramBlock pb, ExecutionContext ec, boolean recursive) {
Timing time = new Timing(true);
HashMap<String,VarStats> stats = new HashMap<>();
@@ -91,9 +89,7 @@ public class CostEstimationWrapper
return costs;
}
- private static CostEstimator createCostEstimator( CostType type )
- throws DMLRuntimeException
- {
+ private static CostEstimator createCostEstimator( CostType type ) {
switch( type )
{
case NUM_MRJOBS:
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/hops/cost/CostEstimatorNumMRJobs.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/cost/CostEstimatorNumMRJobs.java b/src/main/java/org/apache/sysml/hops/cost/CostEstimatorNumMRJobs.java
index 4308a5c..07d8c09 100644
--- a/src/main/java/org/apache/sysml/hops/cost/CostEstimatorNumMRJobs.java
+++ b/src/main/java/org/apache/sysml/hops/cost/CostEstimatorNumMRJobs.java
@@ -19,24 +19,17 @@
package org.apache.sysml.hops.cost;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.instructions.Instruction;
public class CostEstimatorNumMRJobs extends CostEstimator
{
-
-
@Override
- protected double getCPInstTimeEstimate( Instruction inst, VarStats[] vs, String[] args )
- throws DMLRuntimeException
- {
+ protected double getCPInstTimeEstimate( Instruction inst, VarStats[] vs, String[] args ) {
return 0;
}
@Override
- protected double getMRJobInstTimeEstimate( Instruction inst, VarStats[] vs, String[] args )
- throws DMLRuntimeException
- {
+ protected double getMRJobInstTimeEstimate( Instruction inst, VarStats[] vs, String[] args ) {
return 1;
}
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java b/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
index e10e006..2cfeada 100644
--- a/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
+++ b/src/main/java/org/apache/sysml/hops/recompile/Recompiler.java
@@ -389,9 +389,7 @@ public class Recompiler
return newInst;
}
- private static void logExplainDAG(StatementBlock sb, ArrayList<Hop> hops, ArrayList<Instruction> inst)
- throws DMLRuntimeException
- {
+ private static void logExplainDAG(StatementBlock sb, ArrayList<Hop> hops, ArrayList<Instruction> inst) {
if( DMLScript.EXPLAIN == ExplainType.RECOMPILE_HOPS ) {
LOG.info("EXPLAIN RECOMPILE \nGENERIC (lines "+sb.getBeginLine()+"-"+sb.getEndLine()+"):\n" +
Explain.explainHops(hops, 1));
@@ -402,31 +400,18 @@ public class Recompiler
}
}
- private static void logExplainPred(Hop hops, ArrayList<Instruction> inst)
- throws DMLRuntimeException
- {
+ private static void logExplainPred(Hop hops, ArrayList<Instruction> inst) {
if( DMLScript.EXPLAIN == ExplainType.RECOMPILE_HOPS )
LOG.info("EXPLAIN RECOMPILE \nPRED (line "+hops.getBeginLine()+"):\n" + Explain.explain(hops,1));
if( DMLScript.EXPLAIN == ExplainType.RECOMPILE_RUNTIME )
LOG.info("EXPLAIN RECOMPILE \nPRED (line "+hops.getBeginLine()+"):\n" + Explain.explain(inst,1));
}
- public static void recompileProgramBlockHierarchy( ArrayList<ProgramBlock> pbs, LocalVariableMap vars, long tid, ResetType resetRecompile )
- throws DMLRuntimeException
- {
- try
- {
- RecompileStatus status = new RecompileStatus();
-
- synchronized( pbs )
- {
- for( ProgramBlock pb : pbs )
- rRecompileProgramBlock(pb, vars, status, tid, resetRecompile);
- }
- }
- catch(Exception ex)
- {
- throw new DMLRuntimeException("Unable to recompile program block hierarchy.", ex);
+ public static void recompileProgramBlockHierarchy( ArrayList<ProgramBlock> pbs, LocalVariableMap vars, long tid, ResetType resetRecompile ) {
+ RecompileStatus status = new RecompileStatus();
+ synchronized( pbs ) {
+ for( ProgramBlock pb : pbs )
+ rRecompileProgramBlock(pb, vars, status, tid, resetRecompile);
}
}
@@ -439,22 +424,11 @@ public class Recompiler
* @param tid thread id
* @param fnStack function stack
* @param et execution type
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public static void recompileProgramBlockHierarchy2Forced( ArrayList<ProgramBlock> pbs, long tid, HashSet<String> fnStack, ExecType et )
- throws DMLRuntimeException
- {
- try
- {
- synchronized( pbs )
- {
- for( ProgramBlock pb : pbs )
- rRecompileProgramBlock2Forced(pb, tid, fnStack, et);
- }
- }
- catch(Exception ex)
- {
- throw new DMLRuntimeException("Unable to recompile program block hierarchy to CP.", ex);
+ public static void recompileProgramBlockHierarchy2Forced( ArrayList<ProgramBlock> pbs, long tid, HashSet<String> fnStack, ExecType et ) {
+ synchronized( pbs ) {
+ for( ProgramBlock pb : pbs )
+ rRecompileProgramBlock2Forced(pb, tid, fnStack, et);
}
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/lops/runtime/RunMRJobs.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/lops/runtime/RunMRJobs.java b/src/main/java/org/apache/sysml/lops/runtime/RunMRJobs.java
index 3c395de..cf39048 100644
--- a/src/main/java/org/apache/sysml/lops/runtime/RunMRJobs.java
+++ b/src/main/java/org/apache/sysml/lops/runtime/RunMRJobs.java
@@ -354,9 +354,7 @@ public class RunMRJobs
throw new DMLRuntimeException("Unexpected Job Type: " + inst.getJobType());
}
- private static void checkEmptyInputs( MRJobInstruction inst, MatrixObject[] inputMatrices )
- throws DMLRuntimeException
- {
+ private static void checkEmptyInputs( MRJobInstruction inst, MatrixObject[] inputMatrices ) {
// Check if any of the input files are empty.. only for those job types
// for which empty inputs are NOT allowed
if (!inst.getJobType().areEmptyInputsAllowed()) {
@@ -445,9 +443,7 @@ public class RunMRJobs
}
- private static long[] getNNZ( MatrixObject[] inputMatrices )
- throws DMLRuntimeException
- {
+ private static long[] getNNZ( MatrixObject[] inputMatrices ) {
int len = inputMatrices.length;
long[] ret = new long[len];
for( int i=0; i<len; i++ )
@@ -463,7 +459,6 @@ public class RunMRJobs
}
private static JobReturn executeInMemoryReblockOperations( MRJobInstruction inst, String shuffleInst, MatrixObject[] inputMatrices, MatrixObject[] outputMatrices )
- throws DMLRuntimeException
{
MatrixCharacteristics[] mc = new MatrixCharacteristics[outputMatrices.length];
ReblockInstruction[] rblkSet = MRInstructionParser.parseReblockInstructions(shuffleInst);
@@ -486,7 +481,6 @@ public class RunMRJobs
}
private static JobReturn executeInMemoryDataGenOperations( MRJobInstruction inst, String randInst, MatrixObject[] outputMatrices )
- throws DMLRuntimeException
{
MatrixCharacteristics[] mc = new MatrixCharacteristics[outputMatrices.length];
DataGenMRInstruction[] dgSet = MRInstructionParser.parseDataGenInstructions(randInst);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/parser/DMLTranslator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/parser/DMLTranslator.java b/src/main/java/org/apache/sysml/parser/DMLTranslator.java
index b0b1938..9753465 100644
--- a/src/main/java/org/apache/sysml/parser/DMLTranslator.java
+++ b/src/main/java/org/apache/sysml/parser/DMLTranslator.java
@@ -94,11 +94,8 @@ public class DMLTranslator
private static final Log LOG = LogFactory.getLog(DMLTranslator.class.getName());
private DMLProgram _dmlProg = null;
- public DMLTranslator(DMLProgram dmlp)
- throws DMLRuntimeException
- {
+ public DMLTranslator(DMLProgram dmlp) {
_dmlProg = dmlp;
-
//setup default size for unknown dimensions
OptimizerUtils.resetDefaultSize();
//reinit rewriter according to opt level flags
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/CodegenUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/CodegenUtils.java b/src/main/java/org/apache/sysml/runtime/codegen/CodegenUtils.java
index 726e267..c302b0c 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/CodegenUtils.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/CodegenUtils.java
@@ -67,9 +67,7 @@ public class CodegenUtils
//javac-specific working directory for src/class files
private static String _workingDir = null;
- public static Class<?> compileClass(String name, String src)
- throws DMLRuntimeException
- {
+ public static Class<?> compileClass(String name, String src) {
//reuse existing compiled class
Class<?> ret = _cache.get(name);
if( ret != null )
@@ -94,13 +92,11 @@ public class CodegenUtils
return ret;
}
- public static Class<?> getClass(String name) throws DMLRuntimeException {
+ public static Class<?> getClass(String name) {
return getClass(name, null);
}
- public synchronized static Class<?> getClassSync(String name, byte[] classBytes)
- throws DMLRuntimeException
- {
+ public synchronized static Class<?> getClassSync(String name, byte[] classBytes) {
//In order to avoid anomalies of concurrently compiling and loading the same
//class with the same name multiple times in spark executors, this indirection
//synchronizes the class compilation. This synchronization leads to the first
@@ -110,9 +106,7 @@ public class CodegenUtils
return getClass(name, classBytes);
}
- public static Class<?> getClass(String name, byte[] classBytes)
- throws DMLRuntimeException
- {
+ public static Class<?> getClass(String name, byte[] classBytes) {
//reuse existing compiled class
Class<?> ret = _cache.get(name);
if( ret != null )
@@ -129,9 +123,7 @@ public class CodegenUtils
return ret;
}
- public static byte[] getClassData(String name)
- throws DMLRuntimeException
- {
+ public static byte[] getClassData(String name) {
//get class in a compiler-specific manner
if( SpoofCompiler.JAVA_COMPILER == CompilerType.JANINO )
return _src.get(name).getBytes();
@@ -152,13 +144,11 @@ public class CodegenUtils
iter.remove();
}
- public static SpoofOperator createInstance(Class<?> cla)
- throws DMLRuntimeException
- {
+ public static SpoofOperator createInstance(Class<?> cla) {
SpoofOperator ret = null;
try {
- ret = (SpoofOperator) cla.newInstance();
+ ret = (SpoofOperator) cla.newInstance();
}
catch( Exception ex ) {
throw new DMLRuntimeException(ex);
@@ -177,9 +167,7 @@ public class CodegenUtils
////////////////////////////
//JANINO-specific methods (used for spark environments)
- private static Class<?> compileClassJanino(String name, String src)
- throws DMLRuntimeException
- {
+ private static Class<?> compileClassJanino(String name, String src) {
try {
//compile source code
SimpleCompiler compiler = new SimpleCompiler();
@@ -201,9 +189,7 @@ public class CodegenUtils
////////////////////////////
//JAVAC-specific methods (used for hadoop environments)
- private static Class<?> compileClassJavac(String name, String src)
- throws DMLRuntimeException
- {
+ private static Class<?> compileClassJavac(String name, String src) {
try
{
//create working dir on demand
@@ -264,9 +250,7 @@ public class CodegenUtils
}
}
- private static Class<?> loadFromClassFile(String name, byte[] classBytes)
- throws DMLRuntimeException
- {
+ private static Class<?> loadFromClassFile(String name, byte[] classBytes) {
if(classBytes != null) {
//load from byte representation of class file
try(ByteClassLoader byteLoader = new ByteClassLoader(new URL[]{},
@@ -292,9 +276,7 @@ public class CodegenUtils
}
}
- private static byte[] getClassAsByteArray(String name)
- throws DMLRuntimeException
- {
+ private static byte[] getClassAsByteArray(String name) {
String classAsPath = name.replace('.', '/') + ".class";
URLClassLoader classLoader = null;
@@ -318,7 +300,7 @@ public class CodegenUtils
}
}
- private static void createWorkingDir() throws DMLRuntimeException {
+ private static void createWorkingDir() {
if( _workingDir != null )
return;
String tmp = LocalFileUtils.getWorkingDir(LocalFileUtils.CATEGORY_CODEGEN);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/SpoofCellwise.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/SpoofCellwise.java b/src/main/java/org/apache/sysml/runtime/codegen/SpoofCellwise.java
index ea070b3..20e6a95 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/SpoofCellwise.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/SpoofCellwise.java
@@ -110,9 +110,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
@Override
- public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, int k)
- throws DMLRuntimeException
- {
+ public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, int k) {
//sanity check
if( inputs==null || inputs.size() < 1 )
throw new RuntimeException("Invalid input arguments.");
@@ -188,16 +186,12 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
@Override
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out) {
return execute(inputs, scalarObjects, out, 1);
}
@Override
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int k)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int k) {
//sanity check
if( inputs==null || inputs.size() < 1 || out==null )
throw new RuntimeException("Invalid input arguments.");
@@ -292,9 +286,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
//function dispatch
private long executeDense(DenseBlock a, SideInput[] b, double[] scalars,
- MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
- {
+ MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru) {
DenseBlock c = out.getDenseBlock();
SideInput[] lb = createSparseSideInputs(b);
@@ -317,7 +309,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
private double executeDenseAndAgg(DenseBlock a, SideInput[] b, double[] scalars,
- int m, int n, boolean sparseSafe, int rl, int ru) throws DMLRuntimeException
+ int m, int n, boolean sparseSafe, int rl, int ru)
{
SideInput[] lb = createSparseSideInputs(b);
@@ -330,7 +322,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparse(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
if( sparseSafe && sblock == null )
return 0;
@@ -360,7 +351,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeSparseAndAgg(SparseBlock sblock, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
if( sparseSafe && sblock == null )
return 0;
@@ -374,7 +364,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeCompressed(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
//NOTE: we don't create sparse side inputs w/ row-major cursors because
//compressed data is access in a column-major order
@@ -403,7 +392,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
private double executeCompressedAndAgg(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
- int m, int n, boolean sparseSafe, int rl, int ru) throws DMLRuntimeException
+ int m, int n, boolean sparseSafe, int rl, int ru)
{
//NOTE: we don't create sparse side inputs w/ row-major cursors because
//compressed data is access in a column-major order
@@ -420,7 +409,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeDenseNoAgg(DenseBlock a, SideInput[] b, double[] scalars,
DenseBlock c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
long lnnz = 0;
if( a == null && !sparseSafe ) {
@@ -483,7 +471,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeDenseRowAggMxx(DenseBlock a, SideInput[] b, double[] scalars,
DenseBlock c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double[] lc = c.valuesAt(0); //single block
@@ -555,7 +542,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeDenseColAggMxx(DenseBlock a, SideInput[] b, double[] scalars,
DenseBlock c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double[] lc = c.valuesAt(0); //single block
@@ -591,7 +577,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeDenseAggSum(DenseBlock a, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -618,7 +603,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeDenseAggMxx(DenseBlock a, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
//safe aggregation for min/max w/ handling of zero entries
//note: sparse safe with zero value as min/max handled outside
@@ -647,7 +631,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseNoAggSparse(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
//note: sequential scan algorithm for both sparse-safe and -unsafe
//in order to avoid binary search for sparse-unsafe
@@ -684,7 +667,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseNoAggDense(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
//note: sequential scan algorithm for both sparse-safe and -unsafe
//in order to avoid binary search for sparse-unsafe
@@ -723,7 +705,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseRowAggSum(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -762,7 +743,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseRowAggMxx(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double initialVal = (_aggOp==AggOp.MIN) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;
ValueFunction vfun = getAggFunction();
@@ -801,7 +781,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseColAggSum(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -850,7 +829,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeSparseColAggMxx(SparseBlock sblock, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double initialVal = (_aggOp==AggOp.MIN) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;
ValueFunction vfun = getAggFunction();
@@ -892,7 +870,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeSparseAggSum(SparseBlock sblock, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -927,7 +904,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeSparseAggMxx(SparseBlock sblock, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double ret = (_aggOp==AggOp.MIN) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;
ret = (sparseSafe && sblock.size() < (long)m*n) ? 0 : ret;
@@ -963,7 +939,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeCompressedNoAgg(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
MatrixBlock out, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
double[] c = (out.getDenseBlock() != null) ?
out.getDenseBlockValues() : null;
@@ -997,7 +972,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeCompressedRowAggSum(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
double[] c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -1017,7 +991,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeCompressedRowAggMxx(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
double[] c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
Arrays.fill(c, rl, ru, (_aggOp==AggOp.MIN) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY);
ValueFunction vfun = getAggFunction();
@@ -1054,7 +1027,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private long executeCompressedColAggMxx(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
double[] c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
Arrays.fill(c, rl, ru, (_aggOp==AggOp.MIN) ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY);
ValueFunction vfun = getAggFunction();
@@ -1072,7 +1044,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeCompressedAggSum(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
KahanFunction kplus = (KahanFunction) getAggFunction();
KahanObject kbuff = new KahanObject(0, 0);
@@ -1111,7 +1082,6 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
private double executeCompressedAggMxx(CompressedMatrixBlock a, SideInput[] b, double[] scalars,
int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
//safe aggregation for min/max w/ handling of zero entries
//note: sparse safe with zero value as min/max handled outside
@@ -1154,7 +1124,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
@Override
- public Double call() throws DMLRuntimeException {
+ public Double call() {
if( _a instanceof CompressedMatrixBlock )
return executeCompressedAndAgg((CompressedMatrixBlock)_a, _b, _scalars, _rlen, _clen, _safe, _rl, _ru);
else if (!_a.isInSparseFormat())
@@ -1190,7 +1160,7 @@ public abstract class SpoofCellwise extends SpoofOperator implements Serializabl
}
@Override
- public Long call() throws DMLRuntimeException {
+ public Long call() {
if( _type==CellType.COL_AGG ) {
_c = new MatrixBlock(1,_clen, false);
_c.allocateDenseBlock();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/SpoofMultiAggregate.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/SpoofMultiAggregate.java b/src/main/java/org/apache/sysml/runtime/codegen/SpoofMultiAggregate.java
index 3801285..8db037e 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/SpoofMultiAggregate.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/SpoofMultiAggregate.java
@@ -72,16 +72,12 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
@Override
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out) {
return execute(inputs, scalarObjects, out, 1);
}
@Override
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int k)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int k) {
//sanity check
if( inputs==null || inputs.size() < 1 )
throw new RuntimeException("Invalid input arguments.");
@@ -146,7 +142,6 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
private void executeDense(DenseBlock a, SideInput[] b, double[] scalars, double[] c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
SideInput[] lb = createSparseSideInputs(b);
@@ -168,7 +163,6 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
private void executeSparse(SparseBlock sblock, SideInput[] b, double[] scalars,
double[] c, int m, int n, boolean sparseSafe, int rl, int ru)
- throws DMLRuntimeException
{
if( sblock == null && sparseSafe )
return;
@@ -202,7 +196,7 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
}
- private void executeCompressed(CompressedMatrixBlock a, SideInput[] b, double[] scalars, double[] c, int m, int n, int rl, int ru) throws DMLRuntimeException
+ private void executeCompressed(CompressedMatrixBlock a, SideInput[] b, double[] scalars, double[] c, int m, int n, int rl, int ru)
{
//core compressed aggregation operation
Iterator<IJV> iter = a.getIterator(rl, ru, true);
@@ -231,9 +225,7 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
- private void aggregatePartialResults(double[] c, ArrayList<double[]> pret)
- throws DMLRuntimeException
- {
+ private void aggregatePartialResults(double[] c, ArrayList<double[]> pret) {
ValueFunction[] vfun = getAggFunctions(_aggOps);
for( int k=0; k<_aggOps.length; k++ ) {
if( vfun[k] instanceof KahanFunction ) {
@@ -249,10 +241,8 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
}
}
-
- public static void aggregatePartialResults(AggOp[] aggOps, MatrixBlock c, MatrixBlock b)
- throws DMLRuntimeException
- {
+
+ public static void aggregatePartialResults(AggOp[] aggOps, MatrixBlock c, MatrixBlock b) {
ValueFunction[] vfun = getAggFunctions(aggOps);
for( int k=0; k< aggOps.length; k++ ) {
@@ -310,7 +300,7 @@ public abstract class SpoofMultiAggregate extends SpoofOperator implements Seria
}
@Override
- public double[] call() throws DMLRuntimeException {
+ public double[] call() {
double[] c = new double[_aggOps.length];
setInitialOutputValues(c);
if( _a instanceof CompressedMatrixBlock )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/SpoofOperator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/SpoofOperator.java b/src/main/java/org/apache/sysml/runtime/codegen/SpoofOperator.java
index af0a22b..f6b225d 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/SpoofOperator.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/SpoofOperator.java
@@ -44,47 +44,41 @@ public abstract class SpoofOperator implements Serializable
protected static final long PAR_MINFLOP_THRESHOLD = 2L*1024*1024; //MIN 2 MFLOP
- public abstract MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, MatrixBlock out)
- throws DMLRuntimeException;
+ public abstract MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, MatrixBlock out);
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, MatrixBlock out, int k)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, MatrixBlock out, int k) {
//default implementation serial execution
return execute(inputs, scalars, out);
}
public abstract String getSpoofType();
- public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars) throws DMLRuntimeException {
- throw new RuntimeException("Invalid invocation in base class.");
+ public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars) {
+ throw new DMLRuntimeException("Invalid invocation in base class.");
}
- public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, int k)
- throws DMLRuntimeException
- {
+ public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalars, int k) {
//default implementation serial execution
return execute(inputs, scalars);
}
- protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs) throws DMLRuntimeException {
+ protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs) {
return prepInputMatrices(inputs, 1, inputs.size()-1, false, false);
}
- protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, boolean denseOnly) throws DMLRuntimeException {
+ protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, boolean denseOnly) {
return prepInputMatrices(inputs, 1, inputs.size()-1, denseOnly, false);
}
- protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, int offset, boolean denseOnly) throws DMLRuntimeException {
+ protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, int offset, boolean denseOnly) {
return prepInputMatrices(inputs, offset, inputs.size()-offset, denseOnly, false);
}
- protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, boolean denseOnly, boolean tB1) throws DMLRuntimeException {
+ protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, boolean denseOnly, boolean tB1) {
return prepInputMatrices(inputs, 1, inputs.size()-1, denseOnly, tB1);
}
protected SideInput[] prepInputMatrices(ArrayList<MatrixBlock> inputs, int offset, int len, boolean denseOnly, boolean tB1)
- throws DMLRuntimeException
{
SideInput[] b = new SideInput[len];
for(int i=offset; i<offset+len; i++) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/SpoofOuterProduct.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/SpoofOuterProduct.java b/src/main/java/org/apache/sysml/runtime/codegen/SpoofOuterProduct.java
index 1ec98ce..ee137c4 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/SpoofOuterProduct.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/SpoofOuterProduct.java
@@ -73,7 +73,6 @@ public abstract class SpoofOuterProduct extends SpoofOperator
@Override
public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects)
- throws DMLRuntimeException
{
//sanity check
if( inputs==null || inputs.size() < 3 )
@@ -106,7 +105,6 @@ public abstract class SpoofOuterProduct extends SpoofOperator
@Override
public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, int numThreads)
- throws DMLRuntimeException
{
//sanity check
if( inputs==null || inputs.size() < 3 )
@@ -153,7 +151,6 @@ public abstract class SpoofOuterProduct extends SpoofOperator
@Override
public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out)
- throws DMLRuntimeException
{
//sanity check
if( inputs==null || inputs.size() < 3 || out==null )
@@ -233,7 +230,6 @@ public abstract class SpoofOuterProduct extends SpoofOperator
@Override
public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int numThreads)
- throws DMLRuntimeException
{
//sanity check
if( inputs==null || inputs.size() < 3 || out==null )
@@ -675,7 +671,7 @@ public abstract class SpoofOuterProduct extends SpoofOperator
}
@Override
- public Long call() throws DMLRuntimeException {
+ public Long call() {
switch(_type)
{
case LEFT_OUTER_PRODUCT:
@@ -740,7 +736,7 @@ public abstract class SpoofOuterProduct extends SpoofOperator
}
@Override
- public Double call() throws DMLRuntimeException {
+ public Double call() {
MatrixBlock out = new MatrixBlock(1, 1, false);
out.allocateDenseBlock();
if( _a instanceof CompressedMatrixBlock )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/codegen/SpoofRowwise.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/codegen/SpoofRowwise.java b/src/main/java/org/apache/sysml/runtime/codegen/SpoofRowwise.java
index 7f308e6..6e5646d 100644
--- a/src/main/java/org/apache/sysml/runtime/codegen/SpoofRowwise.java
+++ b/src/main/java/org/apache/sysml/runtime/codegen/SpoofRowwise.java
@@ -108,9 +108,7 @@ public abstract class SpoofRowwise extends SpoofOperator
}
@Override
- public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, int k)
- throws DMLRuntimeException
- {
+ public ScalarObject execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, int k) {
MatrixBlock out = ( k > 1 ) ?
execute(inputs, scalarObjects, new MatrixBlock(1,1,false), k) :
execute(inputs, scalarObjects, new MatrixBlock(1,1,false));
@@ -118,15 +116,11 @@ public abstract class SpoofRowwise extends SpoofOperator
}
@Override
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out) {
return execute(inputs, scalarObjects, out, true, false);
}
- public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, boolean allocTmp, boolean aggIncr)
- throws DMLRuntimeException
- {
+ public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, boolean allocTmp, boolean aggIncr) {
//sanity check
if( inputs==null || inputs.size() < 1 || out==null )
throw new RuntimeException("Invalid input arguments.");
@@ -177,7 +171,6 @@ public abstract class SpoofRowwise extends SpoofOperator
@Override
public MatrixBlock execute(ArrayList<MatrixBlock> inputs, ArrayList<ScalarObject> scalarObjects, MatrixBlock out, int k)
- throws DMLRuntimeException
{
//redirect to serial execution
if( k <= 1 || (_type.isColumnAgg() && !LibMatrixMult.checkParColumnAgg(inputs.get(0), k, false))
@@ -367,7 +360,7 @@ public abstract class SpoofRowwise extends SpoofOperator
}
@Override
- public DenseBlock call() throws DMLRuntimeException {
+ public DenseBlock call() {
//allocate vector intermediates and partial output
if( _reqVectMem > 0 )
@@ -413,7 +406,7 @@ public abstract class SpoofRowwise extends SpoofOperator
}
@Override
- public Long call() throws DMLRuntimeException {
+ public Long call() {
//allocate vector intermediates
if( _reqVectMem > 0 )
LibSpoofPrimitives.setupThreadLocalMemory(_reqVectMem, _clen, _clen2);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroup.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroup.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroup.java
index 1938d17..adf4721 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroup.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroup.java
@@ -26,7 +26,6 @@ import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.data.IJV;
import org.apache.sysml.runtime.matrix.data.MatrixBlock;
import org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator;
@@ -247,12 +246,11 @@ public abstract class ColGroup implements Serializable
* accumulator for holding the result
* @param rl row lower
* @param ru row upper
- * @throws DMLRuntimeException
* if the internal SystemML code that performs the
* multiplication experiences an error
*/
public abstract void rightMultByVector(MatrixBlock vector,
- MatrixBlock result, int rl, int ru) throws DMLRuntimeException;
+ MatrixBlock result, int rl, int ru);
/**
@@ -262,10 +260,8 @@ public abstract class ColGroup implements Serializable
*
* @param vector row vector
* @param result matrix block result
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract void leftMultByRowVector(MatrixBlock vector,
- MatrixBlock result) throws DMLRuntimeException;
+ public abstract void leftMultByRowVector(MatrixBlock vector, MatrixBlock result);
/**
* Perform the specified scalar operation directly on the compressed column
@@ -274,13 +270,10 @@ public abstract class ColGroup implements Serializable
* @param op
* operation to perform
* @return version of this column group with the operation applied
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- public abstract ColGroup scalarOperation(ScalarOperator op)
- throws DMLRuntimeException;
+ public abstract ColGroup scalarOperation(ScalarOperator op);
- public abstract void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result)
- throws DMLRuntimeException;
+ public abstract void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result);
/**
* Create a column group iterator for a row index range.
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC.java
index 9973ec2..40eef8e 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC.java
@@ -22,7 +22,6 @@ package org.apache.sysml.runtime.compress;
import java.util.Arrays;
import java.util.Iterator;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.functionobjects.Builtin;
import org.apache.sysml.runtime.functionobjects.KahanFunction;
import org.apache.sysml.runtime.functionobjects.KahanPlus;
@@ -118,7 +117,6 @@ public abstract class ColGroupDDC extends ColGroupValue
@Override
public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
//sum and sumsq (reduceall/reducerow over tuples and counts)
if( op.aggOp.increOp.fn instanceof KahanPlus || op.aggOp.increOp.fn instanceof KahanPlusSq )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC1.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC1.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC1.java
index 1861bba..635d8c3 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC1.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC1.java
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.utils.ConverterUtils;
import org.apache.sysml.runtime.functionobjects.KahanFunction;
import org.apache.sysml.runtime.functionobjects.KahanPlus;
@@ -249,7 +248,6 @@ public class ColGroupDDC1 extends ColGroupDDC
@Override
public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
double[] b = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -272,7 +270,6 @@ public class ColGroupDDC1 extends ColGroupDDC
}
public static void rightMultByVector(ColGroupDDC1[] grps, MatrixBlock vector, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
double[] b = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -299,7 +296,7 @@ public class ColGroupDDC1 extends ColGroupDDC
}
@Override
- public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result) throws DMLRuntimeException {
+ public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result) {
double[] a = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
final int nrow = getNumRows();
@@ -317,7 +314,7 @@ public class ColGroupDDC1 extends ColGroupDDC
}
@Override
- public void leftMultByRowVector(ColGroupDDC a, MatrixBlock result) throws DMLRuntimeException {
+ public void leftMultByRowVector(ColGroupDDC a, MatrixBlock result) {
double[] c = result.getDenseBlockValues();
final int nrow = getNumRows();
final int numVals = getNumValues();
@@ -376,7 +373,6 @@ public class ColGroupDDC1 extends ColGroupDDC
}
public static void computeRowSums(ColGroupDDC1[] grps, MatrixBlock result, KahanFunction kplus, int rl, int ru)
- throws DMLRuntimeException
{
//note: due to corrections the output might be a large dense block
DenseBlock c = result.getDenseBlock();
@@ -417,7 +413,7 @@ public class ColGroupDDC1 extends ColGroupDDC
}
@Override
- public ColGroup scalarOperation(ScalarOperator op) throws DMLRuntimeException {
+ public ColGroup scalarOperation(ScalarOperator op) {
//fast path: sparse-safe and -unsafe operations
//as zero are represented, it is sufficient to simply apply the scalar op
return new ColGroupDDC1(_colIndexes, _numRows, applyScalarOp(op), _data);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC2.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC2.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC2.java
index 28e565c..3e5c477 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC2.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupDDC2.java
@@ -24,7 +24,6 @@ import java.io.DataOutput;
import java.io.IOException;
import java.util.Arrays;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.utils.ConverterUtils;
import org.apache.sysml.runtime.functionobjects.KahanFunction;
import org.apache.sysml.runtime.functionobjects.KahanPlus;
@@ -223,7 +222,7 @@ public class ColGroupDDC2 extends ColGroupDDC
}
@Override
- public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru) throws DMLRuntimeException {
+ public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru) {
double[] b = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
final int numCols = getNumCols();
@@ -245,7 +244,6 @@ public class ColGroupDDC2 extends ColGroupDDC
@Override
public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result)
- throws DMLRuntimeException
{
double[] a = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -279,7 +277,6 @@ public class ColGroupDDC2 extends ColGroupDDC
@Override
public void leftMultByRowVector(ColGroupDDC a, MatrixBlock result)
- throws DMLRuntimeException
{
double[] c = result.getDenseBlockValues();
final int nrow = getNumRows();
@@ -361,7 +358,7 @@ public class ColGroupDDC2 extends ColGroupDDC
}
@Override
- public ColGroup scalarOperation(ScalarOperator op) throws DMLRuntimeException {
+ public ColGroup scalarOperation(ScalarOperator op) {
//fast path: sparse-safe and -unsafe operations
//as zero are represented, it is sufficient to simply apply the scalar op
return new ColGroupDDC2(_colIndexes, _numRows, applyScalarOp(op), _data);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupOLE.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupOLE.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupOLE.java
index 4561c14..011e3f0 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupOLE.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupOLE.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.utils.ConverterUtils;
import org.apache.sysml.runtime.compress.utils.LinearAlgebraUtils;
import org.apache.sysml.runtime.functionobjects.Builtin;
@@ -263,7 +262,6 @@ public class ColGroupOLE extends ColGroupOffset
@Override
public ColGroup scalarOperation(ScalarOperator op)
- throws DMLRuntimeException
{
double val0 = op.executeScalar(0);
@@ -296,7 +294,6 @@ public class ColGroupOLE extends ColGroupOffset
@Override
public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
double[] b = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -386,7 +383,6 @@ public class ColGroupOLE extends ColGroupOffset
@Override
public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result)
- throws DMLRuntimeException
{
double[] a = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -460,7 +456,6 @@ public class ColGroupOLE extends ColGroupOffset
@Override
public void leftMultByRowVector(ColGroupDDC a, MatrixBlock result)
- throws DMLRuntimeException
{
//note: this method is only applicable for numrows < blocksize
double[] c = result.getDenseBlockValues();
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupOffset.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupOffset.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupOffset.java
index a312419..2aa23bf 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupOffset.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupOffset.java
@@ -26,7 +26,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.utils.LinearAlgebraUtils;
import org.apache.sysml.runtime.functionobjects.Builtin;
import org.apache.sysml.runtime.functionobjects.KahanFunction;
@@ -267,22 +266,17 @@ public abstract class ColGroupOffset extends ColGroupValue
*
* @param ind row indicator vector of non zeros
* @return offsets
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- protected int[] computeOffsets(boolean[] ind)
- throws DMLRuntimeException
- {
+ protected int[] computeOffsets(boolean[] ind) {
//determine number of offsets
int numOffsets = 0;
for( int i=0; i<ind.length; i++ )
numOffsets += ind[i] ? 1 : 0;
-
//create offset lists
int[] ret = new int[numOffsets];
for( int i=0, pos=0; i<ind.length; i++ )
if( ind[i] )
ret[pos++] = i;
-
return ret;
}
@@ -371,7 +365,6 @@ public abstract class ColGroupOffset extends ColGroupValue
@Override
public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
//sum and sumsq (reduceall/reducerow over tuples and counts)
if( op.aggOp.increOp.fn instanceof KahanPlus || op.aggOp.increOp.fn instanceof KahanPlusSq )
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupRLE.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupRLE.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupRLE.java
index cbdf4a5..865e09e 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupRLE.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupRLE.java
@@ -24,7 +24,6 @@ import java.util.Iterator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.compress.utils.ConverterUtils;
import org.apache.sysml.runtime.compress.utils.LinearAlgebraUtils;
import org.apache.sysml.runtime.functionobjects.Builtin;
@@ -267,7 +266,6 @@ public class ColGroupRLE extends ColGroupOffset
@Override
public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
{
double[] b = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
@@ -363,8 +361,7 @@ public class ColGroupRLE extends ColGroupOffset
@Override
public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result)
- throws DMLRuntimeException
- {
+ {
double[] a = ConverterUtils.getDenseVector(vector);
double[] c = result.getDenseBlockValues();
final int numCols = getNumCols();
@@ -441,7 +438,6 @@ public class ColGroupRLE extends ColGroupOffset
@Override
public void leftMultByRowVector(ColGroupDDC a, MatrixBlock result)
- throws DMLRuntimeException
{
//note: this method is only applicable for numrows < blocksize
double[] c = result.getDenseBlockValues();
@@ -472,7 +468,6 @@ public class ColGroupRLE extends ColGroupOffset
@Override
public ColGroup scalarOperation(ScalarOperator op)
- throws DMLRuntimeException
{
double val0 = op.executeScalar(0);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupUncompressed.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupUncompressed.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupUncompressed.java
index 2cc5b4b..d03343e 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupUncompressed.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupUncompressed.java
@@ -27,7 +27,6 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.functionobjects.ReduceRow;
import org.apache.sysml.runtime.matrix.data.IJV;
import org.apache.sysml.runtime.matrix.data.LibMatrixAgg;
@@ -68,11 +67,9 @@ public class ColGroupUncompressed extends ColGroup
* @param rawblock
* the uncompressed block; uncompressed data must be present at
* the time that the constructor is called
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unused")
public ColGroupUncompressed(List<Integer> colIndicesList, MatrixBlock rawblock)
- throws DMLRuntimeException
{
super(colIndicesList,
CompressedMatrixBlock.TRANSPOSE_INPUT ?
@@ -270,9 +267,7 @@ public class ColGroupUncompressed extends ColGroup
}
@Override
- public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException
- {
+ public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int rl, int ru) {
// Pull out the relevant rows of the vector
int clen = _colIndexes.length;
@@ -287,9 +282,7 @@ public class ColGroupUncompressed extends ColGroup
LibMatrixMult.matrixMult(_data, shortVector, result, rl, ru);
}
- public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int k)
- throws DMLRuntimeException
- {
+ public void rightMultByVector(MatrixBlock vector, MatrixBlock result, int k) {
// Pull out the relevant rows of the vector
int clen = _colIndexes.length;
@@ -306,7 +299,6 @@ public class ColGroupUncompressed extends ColGroup
@Override
public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result)
- throws DMLRuntimeException
{
MatrixBlock pret = new MatrixBlock(1, _colIndexes.length, false);
LibMatrixMult.matrixMult(vector, _data, pret);
@@ -321,7 +313,6 @@ public class ColGroupUncompressed extends ColGroup
}
public void leftMultByRowVector(MatrixBlock vector, MatrixBlock result, int k)
- throws DMLRuntimeException
{
MatrixBlock pret = new MatrixBlock(1, _colIndexes.length, false);
LibMatrixMult.matrixMult(vector, _data, pret, k);
@@ -336,21 +327,16 @@ public class ColGroupUncompressed extends ColGroup
}
@Override
- public ColGroup scalarOperation(ScalarOperator op)
- throws DMLRuntimeException
- {
+ public ColGroup scalarOperation(ScalarOperator op) {
//execute scalar operations
MatrixBlock retContent = (MatrixBlock) _data
- .scalarOperations(op, new MatrixBlock());
-
+ .scalarOperations(op, new MatrixBlock());
//construct new uncompressed column group
return new ColGroupUncompressed(getColIndices(), _data.getNumRows(), retContent);
}
@Override
- public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock ret)
- throws DMLRuntimeException
- {
+ public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock ret) {
//execute unary aggregate operations
LibMatrixAgg.aggregateUnaryMatrix(_data, ret, op);
http://git-wip-us.apache.org/repos/asf/systemml/blob/583f3448/src/main/java/org/apache/sysml/runtime/compress/ColGroupValue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/compress/ColGroupValue.java b/src/main/java/org/apache/sysml/runtime/compress/ColGroupValue.java
index 2e5dc78..a09512c 100644
--- a/src/main/java/org/apache/sysml/runtime/compress/ColGroupValue.java
+++ b/src/main/java/org/apache/sysml/runtime/compress/ColGroupValue.java
@@ -21,7 +21,6 @@ package org.apache.sysml.runtime.compress;
import java.util.Arrays;
-import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.functionobjects.Builtin;
import org.apache.sysml.runtime.functionobjects.Builtin.BuiltinCode;
import org.apache.sysml.runtime.functionobjects.KahanFunction;
@@ -325,8 +324,7 @@ public abstract class ColGroupValue extends ColGroup
}
//additional vector-matrix multiplication to avoid DDC uncompression
- public abstract void leftMultByRowVector(ColGroupDDC vector, MatrixBlock result)
- throws DMLRuntimeException;
+ public abstract void leftMultByRowVector(ColGroupDDC vector, MatrixBlock result);
/**
@@ -336,23 +334,17 @@ public abstract class ColGroupValue extends ColGroup
* @param op
* scalar operation to perform
* @return transformed copy of value metadata for this column group
- * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
- protected double[] applyScalarOp(ScalarOperator op)
- throws DMLRuntimeException
- {
+ protected double[] applyScalarOp(ScalarOperator op) {
//scan over linearized values
double[] ret = new double[_values.length];
for (int i = 0; i < _values.length; i++) {
ret[i] = op.executeScalar(_values[i]);
}
-
return ret;
}
- protected double[] applyScalarOp(ScalarOperator op, double newVal, int numCols)
- throws DMLRuntimeException
- {
+ protected double[] applyScalarOp(ScalarOperator op, double newVal, int numCols) {
//scan over linearized values
double[] ret = new double[_values.length + numCols];
for( int i = 0; i < _values.length; i++ ) {
@@ -366,9 +358,7 @@ public abstract class ColGroupValue extends ColGroup
}
@Override
- public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result)
- throws DMLRuntimeException
- {
+ public void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result) {
unaryAggregateOperations(op, result, 0, getNumRows());
}
@@ -378,10 +368,8 @@ public abstract class ColGroupValue extends ColGroup
* @param result output matrix block
* @param rl row lower index, inclusive
* @param ru row upper index, exclusive
- * @throws DMLRuntimeException on invalid inputs
*/
- public abstract void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result, int rl, int ru)
- throws DMLRuntimeException;
+ public abstract void unaryAggregateOperations(AggregateUnaryOperator op, MatrixBlock result, int rl, int ru);
//dynamic memory management