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
`static boolean` `INCLUDE_FUNCTIONS`

### Constructor Summary

Constructors
Constructor and Description
`OptTreeConverter()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `clear()`
`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, Set<String> memo)`
`static OptTree` `createAbstractOptTree(int ck, double cm, ParForStatementBlock pfsb, ParForProgramBlock pfpb, Set<String> memo, ExecutionContext ec)`
`static OptNode` `createOptNode(Instruction inst, LocalVariableMap vars, boolean storeObjs)`
`static ArrayList<OptNode>` `createOptNodes(ArrayList<Instruction> instset, LocalVariableMap vars, boolean storeObjs)`
`static OptTree` `createOptTree(int ck, double cm, Optimizer.PlanInputType type, ParForStatementBlock pfsb, ParForProgramBlock pfpb, ExecutionContext ec)`
`static OptTreePlanMappingAbstract` `getAbstractPlanMapping()`
`static boolean` `rContainsSparkInstruction(ProgramBlock pb, boolean inclFunctions)`
`static OptNode` `rCreateAbstractOptNode(StatementBlock sb, ProgramBlock pb, LocalVariableMap vars, boolean topLevel, Set<String> memo)`
`static ArrayList<OptNode>` `rCreateAbstractOptNodes(Hop hop, LocalVariableMap vars, Set<String> memo)`
`static OptNode` `rCreateOptNode(ProgramBlock pb, LocalVariableMap vars, boolean topLevel, boolean storeObjs)`
`static void` `replaceProgramBlock(List<ProgramBlock> pbs, ProgramBlock pbOld, ProgramBlock pbNew)`
`static void` `replaceProgramBlock(OptNode parent, OptNode n, ProgramBlock pbOld, ProgramBlock pbNew, boolean rtMap)`

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

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

### Field Detail

#### INCLUDE_FUNCTIONS

    public static boolean INCLUDE_FUNCTIONS

### Constructor Detail

#### OptTreeConverter

    public OptTreeConverter()

### Method Detail

#### createOptTree

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

#### createAbstractOptTree

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

#### rCreateOptNode

    public static OptNode rCreateOptNode(ProgramBlock pb,
                                         LocalVariableMap vars,
                                         boolean topLevel,
                                         boolean storeObjs)

#### createOptNodes

    public static ArrayList<OptNode> createOptNodes(ArrayList<Instruction> instset,
                                                    LocalVariableMap vars,
                                                    boolean storeObjs)

#### createOptNode

    public static OptNode createOptNode(Instruction inst,
                                        LocalVariableMap vars,
                                        boolean storeObjs)

#### rCreateAbstractOptNode

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

#### createAbstractOptNodes

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

#### rCreateAbstractOptNodes

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

#### 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,
                                           boolean rtMap)

#### replaceProgramBlock

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

#### getAbstractPlanMapping

    public static OptTreePlanMappingAbstract getAbstractPlanMapping()

#### clear

    public static void clear()