Class OptNode
- java.lang.Object
- 
- org.apache.sysds.runtime.controlprogram.parfor.opt.OptNode
 
- 
 public class OptNode extends Object Internal representation of a plan alternative for program blocks and instructions in order to enable efficient and simple recursive enumeration and plan changes. This is only used within the optimizer and therefore not visible to any other component.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classOptNode.ExecTypestatic classOptNode.NodeTypestatic classOptNode.ParamType
 - 
Constructor SummaryConstructors Constructor Description OptNode(OptNode.NodeType type)OptNode(OptNode.NodeType ntype, OptNode.ExecType etype)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(OptNode child)voidaddChilds(ArrayList<OptNode> childs)voidaddParam(OptNode.ParamType ptype, String val)voidcheckAndCleanupLeafNodes()voidcheckAndCleanupRecursiveFunc(Set<String> stack)booleanexchangeChild(OptNode oldNode, OptNode newNode)Stringexplain(int level, boolean withDetails)Explain tool: prints the hierarchical plan tostdout.intgetBeginLine()ArrayList<OptNode>getChilds()intgetEndLine()OptNode.ExecTypegetExecType()longgetID()StringgetInstructionName()intgetK()longgetMaxC(long N)longgetMaxProblemSize()Determines the maximum problem size, in terms of the maximum total number of inner loop iterations, of the entire subtree.Collection<OptNode>getNodeList()Collection<OptNode>getNodeList(OptNode.ExecType et)OptNode.NodeTypegetNodeType()StringgetParam(OptNode.ParamType type)Collection<OptNode>getRelevantNodeList()intgetTotalK()booleanhasNestedParallelism(boolean flagNested)booleanhasNestedPartitionReads(boolean flagNested)booleanhasOnlySimpleChilds()booleanisCPOnly()Determines if all program blocks and instructions exhibit the execution type CP.booleanisLeaf()booleanisNodeType(OptNode.NodeType... types)booleanisRecursive()voidsetBeginLine(int line)voidsetChilds(ArrayList<OptNode> childs)voidsetEndLine(int line)voidsetExecType(OptNode.ExecType type)voidsetID(long id)voidsetK(int k)voidsetLineNumbers(int begin, int end)voidsetNodeType(OptNode.NodeType type)voidsetParams(HashMap<OptNode.ParamType,String> params)voidsetSerialParFor()Set the plan to a parallel degree of 1 (serial execution).intsize()Gets the number of plan nodes.
 
- 
- 
- 
Constructor Detail- 
OptNodepublic OptNode(OptNode.NodeType type) 
 - 
OptNodepublic OptNode(OptNode.NodeType ntype, OptNode.ExecType etype) 
 
- 
 - 
Method Detail- 
getNodeTypepublic OptNode.NodeType getNodeType() 
 - 
setNodeTypepublic void setNodeType(OptNode.NodeType type) 
 - 
isNodeTypepublic boolean isNodeType(OptNode.NodeType... types) 
 - 
getExecTypepublic OptNode.ExecType getExecType() 
 - 
setExecTypepublic void setExecType(OptNode.ExecType type) 
 - 
setIDpublic void setID(long id) 
 - 
getIDpublic long getID() 
 - 
addParampublic void addParam(OptNode.ParamType ptype, String val) 
 - 
setParamspublic void setParams(HashMap<OptNode.ParamType,String> params) 
 - 
getParampublic String getParam(OptNode.ParamType type) 
 - 
getBeginLinepublic int getBeginLine() 
 - 
setBeginLinepublic void setBeginLine(int line) 
 - 
getEndLinepublic int getEndLine() 
 - 
setEndLinepublic void setEndLine(int line) 
 - 
setLineNumberspublic void setLineNumbers(int begin, int end)
 - 
addChildpublic void addChild(OptNode child) 
 - 
getKpublic int getK() 
 - 
setKpublic void setK(int k) 
 - 
isLeafpublic boolean isLeaf() 
 - 
hasOnlySimpleChildspublic boolean hasOnlySimpleChilds() 
 - 
getInstructionNamepublic String getInstructionName() 
 - 
isRecursivepublic boolean isRecursive() 
 - 
getNodeListpublic Collection<OptNode> getNodeList() 
 - 
getNodeListpublic Collection<OptNode> getNodeList(OptNode.ExecType et) 
 - 
getRelevantNodeListpublic Collection<OptNode> getRelevantNodeList() 
 - 
setSerialParForpublic void setSerialParFor() Set the plan to a parallel degree of 1 (serial execution).
 - 
sizepublic int size() Gets the number of plan nodes.- Returns:
- number of plan nodes
 
 - 
isCPOnlypublic boolean isCPOnly() Determines if all program blocks and instructions exhibit the execution type CP.- Returns:
- true of all program blocks and instructions execute on CP
 
 - 
getTotalKpublic int getTotalK() 
 - 
getMaxCpublic long getMaxC(long N) 
 - 
hasNestedParallelismpublic boolean hasNestedParallelism(boolean flagNested) 
 - 
hasNestedPartitionReadspublic boolean hasNestedPartitionReads(boolean flagNested) 
 - 
checkAndCleanupLeafNodespublic void checkAndCleanupLeafNodes() 
 - 
explainpublic String explain(int level, boolean withDetails) Explain tool: prints the hierarchical plan tostdout.- Parameters:
- level- depth to print?
- withDetails- if true, explain details
- Returns:
- string explanation
 
 - 
getMaxProblemSizepublic long getMaxProblemSize() Determines the maximum problem size, in terms of the maximum total number of inner loop iterations, of the entire subtree.- Returns:
- maximum problem size
 
 
- 
 
-