Package org.apache.sysds.runtime.controlprogram.parfor.opt

# Class OptTreeConverter

java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.opt.OptTreeConverter

public class OptTreeConverter extends Object
Converter for creating an internal plan representation for a given runtime program and to modify/create the runtime program according to the optimized plan. NOTE: currently only one abstract and one runtime plan at a time. This implies that only one parfor optimization can happen at a time.

## Field Summary

Fields
Modifier and Type
Field
Description
`static boolean`
`INCLUDE_FUNCTIONS`

## Constructor Summary

Constructors
Constructor
Description
`OptTreeConverter()`

## Method Summary

Modifier and Type
Method
Description
`static boolean`
`containsFunctionCallInstruction(BasicProgramBlock pb)`
`static boolean`
`containsSparkInstruction(ArrayList<Instruction> instSet, boolean inclCPFile)`
`static boolean`
`containsSparkInstruction(BasicProgramBlock pb, boolean inclCPFile)`
`static ArrayList<OptNode>`
`createAbstractOptNodes(ArrayList<Hop> hops, LocalVariableMap vars, OptTreePlanMapping hlMap, Set<String> memo)`
`static OptTree`
`createAbstractOptTree(int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, OptTreePlanMapping hlMap, Set<String> memo, ExecutionContext ec)`
`static OptTree`
`createOptTree(int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, ExecutionContext ec)`
`static boolean`
`rContainsSparkInstruction(List<ProgramBlock> pbs, boolean inclFunctions)`
`static boolean`
`rContainsSparkInstruction(ProgramBlock pb, boolean inclFunctions)`
`static OptNode`
`rCreateAbstractOptNode(StatementBlock sb, ProgramBlock pb, LocalVariableMap vars, boolean topLevel, OptTreePlanMapping hlMap, Set<String> memo)`
`static List<OptNode>`
`rCreateAbstractOptNodes(Hop hop, LocalVariableMap vars, OptTreePlanMapping hlMap, Set<String> memo)`
`static void`
`replaceProgramBlock(List<ProgramBlock> pbs, ProgramBlock pbOld, ProgramBlock pbNew)`
`static void`
`replaceProgramBlock(OptNode parent, OptNode n, ProgramBlock pbOld, ProgramBlock pbNew, OptTreePlanMapping hlMap)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INCLUDE_FUNCTIONS

public static boolean INCLUDE_FUNCTIONS

## Constructor Details

### OptTreeConverter

public OptTreeConverter()

## Method Details

### createOptTree

public static OptTree createOptTree(int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, ExecutionContext ec)

### createAbstractOptTree

public static OptTree createAbstractOptTree(int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, OptTreePlanMapping hlMap, Set<String> memo, ExecutionContext ec)

### rCreateAbstractOptNode

public static OptNode rCreateAbstractOptNode(StatementBlock sb, ProgramBlock pb, LocalVariableMap vars, boolean topLevel, OptTreePlanMapping hlMap, Set<String> memo)

### createAbstractOptNodes

public static ArrayList<OptNode> createAbstractOptNodes(ArrayList<Hop> hops, LocalVariableMap vars, OptTreePlanMapping hlMap, Set<String> memo)

### rCreateAbstractOptNodes

public static List<OptNode> rCreateAbstractOptNodes(Hop hop, LocalVariableMap vars, OptTreePlanMapping hlMap, Set<String> memo)

### rContainsSparkInstruction

public static boolean rContainsSparkInstruction(List<ProgramBlock> pbs, boolean inclFunctions)

### rContainsSparkInstruction

public static boolean rContainsSparkInstruction(ProgramBlock pb, boolean inclFunctions)

### containsSparkInstruction

public static boolean containsSparkInstruction(BasicProgramBlock pb, boolean inclCPFile)

### containsSparkInstruction

public static boolean containsSparkInstruction(ArrayList<Instruction> instSet, boolean inclCPFile)

### containsFunctionCallInstruction

public static boolean containsFunctionCallInstruction(BasicProgramBlock pb)

### replaceProgramBlock

public static void replaceProgramBlock(OptNode parent, OptNode n, ProgramBlock pbOld, ProgramBlock pbNew, OptTreePlanMapping hlMap)

### replaceProgramBlock

public static void replaceProgramBlock(List<ProgramBlock> pbs, ProgramBlock pbOld, ProgramBlock pbNew)