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

## Class OptimizerConstrained

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.parfor.opt.Optimizer
  - - org.apache.sysds.runtime.controlprogram.parfor.opt.OptimizerRuleBased
    - - org.apache.sysds.runtime.controlprogram.parfor.opt.OptimizerConstrained

-     public class OptimizerConstrained
      extends OptimizerRuleBased

  Rule-Based ParFor Optimizer (time: O(n)): Applied rule-based rewrites: - see base class. Checked constraints: - 1) rewrite set data partitioner (incl. recompile RIX) - 4) rewrite set execution strategy - 9) rewrite set degree of parallelism - 10) rewrite set task partitioner - 11) rewrite set result merge

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.sysds.runtime.controlprogram.parfor.opt.Optimizer

      `Optimizer.CostModelType, Optimizer.PlanInputType`

  - ### Field Summary

    - ### Fields inherited from class org.apache.sysds.runtime.controlprogram.parfor.opt.OptimizerRuleBased

      `ALLOW_REMOTE_NESTED_PARALLELISM, FUNCTION_UNFOLD_NAMEPREFIX, MAX_REPLICATION_FACTOR_EXPORT, MAX_REPLICATION_FACTOR_PARTITIONING, PAR_K_FACTOR, PAR_K_MR_FACTOR, PROB_SIZE_THRESHOLD_MB, PROB_SIZE_THRESHOLD_PARTITIONING, PROB_SIZE_THRESHOLD_REMOTE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OptimizerConstrained()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ParForProgramBlock.POptMode` | `getOptMode()` |
    `boolean` | `optimize​(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, ExecutionContext ec)` | Main optimization procedure.

    - ### Methods inherited from class org.apache.sysds.runtime.controlprogram.parfor.opt.OptimizerRuleBased

      `allowsBinaryCellPartitions, getCostModelType, getPlanInputType, isInMemoryResultMerge, toMB`

    - ### Methods inherited from class org.apache.sysds.runtime.controlprogram.parfor.opt.Optimizer

      `getNumEvaluatedPlans, getNumTotalPlans`

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

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

- - ### Constructor Detail

    - #### OptimizerConstrained

          public OptimizerConstrained()

  - ### Method Detail

    - #### getOptMode

          public ParForProgramBlock.POptMode getOptMode()

      Overrides:
        `getOptMode` in class `OptimizerRuleBased`

    - #### optimize

          public boolean optimize​(ParForStatementBlock sb,
                                  ParForProgramBlock pb,
                                  OptTree plan,
                                  CostEstimator est,
                                  ExecutionContext ec)

      Main optimization procedure. Transformation-based heuristic (rule-based) optimization (no use of sb, direct change of pb).
      Overrides:
        `optimize` in class `OptimizerRuleBased`
      Parameters:
        `sb` - parfor statement block
        `pb` - parfor program block
        `plan` - complete plan of a top-level parfor
        `est` - cost estimator
        `ec` - execution context
      Returns:
        true if plan changed, false otherwise