Package org.apache.sysds.resource.enumeration

## Class GridBasedEnumerator

- java.lang.Object
- - org.apache.sysds.resource.enumeration.Enumerator
  - - org.apache.sysds.resource.enumeration.GridBasedEnumerator

    public class GridBasedEnumerator
    extends Enumerator

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.sysds.resource.enumeration.Enumerator

`Enumerator.Builder, Enumerator.EnumerationStrategy, Enumerator.OptimizationStrategy`

### Field Summary

### Fields inherited from class org.apache.sysds.resource.enumeration.Enumerator

`COST_DELTA_FRACTION, DEFAULT_MAX_EXECUTORS, DEFAULT_MIN_EXECUTORS`

### Constructor Summary

Constructors
`GridBasedEnumerator​(Enumerator.Builder builder, int stepSizeExecutors, int expBaseExecutors)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ArrayList<Integer>` `estimateRangeExecutors​(int driverCores, long executorMemory, int executorCores)` Estimates the minimum and maximum number of executors based on given VM instance characteristics, the enumeration strategy and the user-defined configurations
`boolean` `evaluateSingleNodeExecution​(long driverMemory, int cores)`
`int` `getExpBase()` Meant to be used for testing purposes
`int` `getStepSize()` Meant to be used for testing purposes
`void` `preprocessing()` Initializes the pool for driver and executor instances parsed at processing with all the available instances

### Methods inherited from class org.apache.sysds.resource.enumeration.Enumerator

`getCostsWeightFactor, getDriverSpace, getEnumStrategy, getExecutorSpace, getInstances, getMaxPrice, getMaxTime, getOptimalSolution, getOptStrategy, postprocessing, processing, setCostsWeightFactor, setCpuQuota, setDriverSpace, setExecutorSpace, setMinPrice, setMinTime, updateOptimalSolution`

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

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

### Constructor Detail

#### GridBasedEnumerator

    public GridBasedEnumerator​(Enumerator.Builder builder,
                               int stepSizeExecutors,
                               int expBaseExecutors)

### Method Detail

#### preprocessing

    public void preprocessing()

Initializes the pool for driver and executor instances parsed at processing with all the available instances

Specified by:
  `preprocessing` in class `Enumerator`

#### evaluateSingleNodeExecution

    public boolean evaluateSingleNodeExecution​(long driverMemory,
                                               int cores)

Specified by:
  `evaluateSingleNodeExecution` in class `Enumerator`

#### estimateRangeExecutors

    public ArrayList<Integer> estimateRangeExecutors​(int driverCores,
                                                     long executorMemory,
                                                     int executorCores)

Description copied from class: `Enumerator`
Estimates the minimum and maximum number of executors based on given VM instance characteristics, the enumeration strategy and the user-defined configurations

Specified by:
  `estimateRangeExecutors` in class `Enumerator`
Parameters:
  `driverCores` - CPU cores for the currently evaluated driver node
  `executorMemory` - memory of currently evaluated executor node
  `executorCores` - CPU cores of currently evaluated executor node
Returns:
  - [min, max]

#### getStepSize

    public int getStepSize()

Meant to be used for testing purposes

Returns:
  the set step size for the grid search

#### getExpBase

    public int getExpBase()

Meant to be used for testing purposes

Returns:
  the set exponential base for the grid search