Class ProgramRecompiler
- java.lang.Object
 - 
- org.apache.sysds.runtime.controlprogram.parfor.opt.ProgramRecompiler
 
 
- 
public class ProgramRecompiler extends Object
 
- 
- 
Constructor Summary
Constructors Constructor Description ProgramRecompiler() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontainsAtLeastOneFunction(ProgramBlock pb)static ArrayList<ProgramBlock>generatePartitialRuntimeProgram(Program rtprog, ArrayList<StatementBlock> sbs)static LocalVariableMapgetReusableScalarVariables(DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars)static booleanisApplicableForReuseVariable(DMLProgram prog, StatementBlock parforSB, String var)This function determines if an parfor input variable is guaranteed to be read-only across multiple invocations of parfor optimization (e.g., in a surrounding while loop).static voidreplaceConstantScalarVariables(StatementBlock sb, LocalVariableMap vars)static voidrFindAndRecompileIndexingHOP(StatementBlock sb, ProgramBlock pb, String var, ExecutionContext ec, boolean force)NOTE: if force is set, we set and recompile the respective indexing hops; otherwise, we release the forced exec type and recompile again. 
 - 
 
- 
- 
Method Detail
- 
generatePartitialRuntimeProgram
public static ArrayList<ProgramBlock> generatePartitialRuntimeProgram(Program rtprog, ArrayList<StatementBlock> sbs)
 
- 
rFindAndRecompileIndexingHOP
public static void rFindAndRecompileIndexingHOP(StatementBlock sb, ProgramBlock pb, String var, ExecutionContext ec, boolean force)
NOTE: if force is set, we set and recompile the respective indexing hops; otherwise, we release the forced exec type and recompile again. Hence, any changes can be exactly reverted with the same access behavior.- Parameters:
 sb- statement blockpb- program blockvar- variableec- execution contextforce- if true, set and recompile the respective indexing hops
 
- 
getReusableScalarVariables
public static LocalVariableMap getReusableScalarVariables(DMLProgram prog, StatementBlock parforSB, LocalVariableMap vars)
 
- 
replaceConstantScalarVariables
public static void replaceConstantScalarVariables(StatementBlock sb, LocalVariableMap vars)
 
- 
isApplicableForReuseVariable
public static boolean isApplicableForReuseVariable(DMLProgram prog, StatementBlock parforSB, String var)
This function determines if an parfor input variable is guaranteed to be read-only across multiple invocations of parfor optimization (e.g., in a surrounding while loop). In case of invariant variables we can reuse partitioned matrices and propagate constants for better size estimation.- Parameters:
 prog- dml programparforSB- parfor statement blockvar- variable- Returns:
 - true if can reuse variable
 
 
- 
containsAtLeastOneFunction
public static boolean containsAtLeastOneFunction(ProgramBlock pb)
 
 - 
 
 -