Class OptNode
java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.opt.OptNode
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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionOptNode(OptNode.NodeType type) OptNode(OptNode.NodeType ntype, OptNode.ExecType etype) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidaddParam(OptNode.ParamType ptype, String val) voidvoidcheckAndCleanupRecursiveFunc(Set<String> stack) booleanexchangeChild(OptNode oldNode, OptNode newNode) explain(int level, boolean withDetails) Explain tool: prints the hierarchical plan tostdout.intintlonggetID()intgetK()longgetMaxC(long N) longDetermines the maximum problem size, in terms of the maximum total number of inner loop iterations, of the entire subtree.getParam(OptNode.ParamType type) intbooleanhasNestedParallelism(boolean flagNested) booleanhasNestedPartitionReads(boolean flagNested) booleanbooleanisCPOnly()Determines if all program blocks and instructions exhibit the execution type CP.booleanisLeaf()booleanisNodeType(OptNode.NodeType... types) booleanvoidsetBeginLine(int line) voidvoidsetEndLine(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) voidSet the plan to a parallel degree of 1 (serial execution).intsize()Gets the number of plan nodes.
-
Constructor Details
-
OptNode
-
OptNode
-
-
Method Details
-
getNodeType
-
setNodeType
-
isNodeType
-
getExecType
-
setExecType
-
setID
public void setID(long id) -
getID
public long getID() -
addParam
-
setParams
-
getParam
-
getBeginLine
public int getBeginLine() -
setBeginLine
public void setBeginLine(int line) -
getEndLine
public int getEndLine() -
setEndLine
public void setEndLine(int line) -
setLineNumbers
public void setLineNumbers(int begin, int end) -
addChild
-
addChilds
-
setChilds
-
getChilds
-
getK
public int getK() -
setK
public void setK(int k) -
exchangeChild
-
isLeaf
public boolean isLeaf() -
hasOnlySimpleChilds
public boolean hasOnlySimpleChilds() -
getInstructionName
-
isRecursive
public boolean isRecursive() -
getNodeList
-
getNodeList
-
getRelevantNodeList
-
setSerialParFor
public void setSerialParFor()Set the plan to a parallel degree of 1 (serial execution). -
size
public int size()Gets the number of plan nodes.- Returns:
- number of plan nodes
-
isCPOnly
public 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
-
getTotalK
public int getTotalK() -
getMaxC
public long getMaxC(long N) -
hasNestedParallelism
public boolean hasNestedParallelism(boolean flagNested) -
hasNestedPartitionReads
public boolean hasNestedPartitionReads(boolean flagNested) -
checkAndCleanupLeafNodes
public void checkAndCleanupLeafNodes() -
checkAndCleanupRecursiveFunc
-
explain
Explain tool: prints the hierarchical plan tostdout.- Parameters:
level- depth to print?withDetails- if true, explain details- Returns:
- string explanation
-
getMaxProblemSize
public 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
-