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.
  • Constructor Details

  • Method Details

    • getNodeType

      public OptNode.NodeType getNodeType()
    • setNodeType

      public void setNodeType(OptNode.NodeType type)
    • isNodeType

      public boolean isNodeType(OptNode.NodeType... types)
    • getExecType

      public OptNode.ExecType getExecType()
    • setExecType

      public void setExecType(OptNode.ExecType type)
    • setID

      public void setID(long id)
    • getID

      public long getID()
    • addParam

      public void addParam(OptNode.ParamType ptype, String val)
    • setParams

      public void setParams(HashMap<OptNode.ParamType,String> params)
    • getParam

      public String getParam(OptNode.ParamType type)
    • 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

      public void addChild(OptNode child)
    • addChilds

      public void addChilds(List<OptNode> childs)
    • setChilds

      public void setChilds(List<OptNode> childs)
    • getChilds

      public List<OptNode> getChilds()
    • getK

      public int getK()
    • setK

      public void setK(int k)
    • exchangeChild

      public boolean exchangeChild(OptNode oldNode, OptNode newNode)
    • isLeaf

      public boolean isLeaf()
    • hasOnlySimpleChilds

      public boolean hasOnlySimpleChilds()
    • getInstructionName

      public String getInstructionName()
    • isRecursive

      public boolean isRecursive()
    • getNodeList

      public Collection<OptNode> getNodeList()
    • getNodeList

      public Collection<OptNode> getNodeList(OptNode.ExecType et)
    • getRelevantNodeList

      public Collection<OptNode> 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

      public void checkAndCleanupRecursiveFunc(Set<String> stack)
    • explain

      public String explain(int level, boolean withDetails)
      Explain tool: prints the hierarchical plan to stdout.
      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