Package org.apache.sysds.parser

# Class ParForStatementBlock

java.lang.Object
org.apache.sysds.parser.LiveVariableAnalysis
org.apache.sysds.parser.StatementBlock
org.apache.sysds.parser.ForStatementBlock
org.apache.sysds.parser.ParForStatementBlock

All Implemented Interfaces:
  `ParseInfo`

public class ParForStatementBlock extends ForStatementBlock
This ParForStatementBlock is essentially identical to a ForStatementBlock, except an extended validate for checking/setting optional parfor parameters and running the loop dependency analysis.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ParForStatementBlock.ResultVar`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CHECK`
`static final String`
`DATA_PARTITIONER`
`static final String`
`EXEC_MODE`
`static final String`
`INTERAL_FN_INDEX_COL`
`static final String`
`INTERAL_FN_INDEX_ROW`
`static final String`
`OPT_LOG`
`static final String`
`OPT_MODE`
`static final String`
`PAR`
`static final String`
`PROFILE`
`static final String`
`RESULT_MERGE`
`static final String`
`TASK_PARTITIONER`
`static final String`
`TASK_SIZE`

### Fields inherited from class org.apache.sysds.parser.StatementBlock

`DEFAULT_LOOP_REPETITIONS`

## Constructor Summary

Constructors
Constructor
Description
`ParForStatementBlock()`

## Method Summary

Modifier and Type
Method
Description
`ParForProgramBlock.PartitionFormat`
`determineDataPartitionFormat(String var)`
Determines the PDataPartitioningFormat for read-only parent variables according to the access pattern of that variable within the parfor statement block.
`long`
`getID()`
`List<String>`
`getReadOnlyParentMatrixVars()`
`ArrayList<ParForStatementBlock.ResultVar>`
`getResultVariables()`
`void`
`setResultVariables(ArrayList<ParForStatementBlock.ResultVar> rvars)`
`VariableSet`
`validate(DMLProgram dmlProg, VariableSet ids, HashMap<String,ConstIdentifier> constVars, boolean conditional)`

### Methods inherited from class org.apache.sysds.parser.ForStatementBlock

`analyze, getEstimateReps, getFromHops, getFromLops, getIncrementHops, getIncrementLops, getInputstoSB, getIterPredicate, getToHops, getToLops, initializebackwardLV, initializeforwardLV, performConstantPropagation, requiresFromRecompilation, requiresIncrementRecompilation, requiresPredicateRecompilation, requiresToRecompilation, setFromHops, setFromLops, setIncrementHops, setIncrementLops, setToHops, setToLops, updatePredicateRecompilationFlags`

### Methods inherited from class org.apache.sysds.parser.StatementBlock

`addStatement, addStatementBlock, getBeginColumn, getBeginLine, getCheckpointPositions, getConstIn, getConstOut, getDMLProg, getEndColumn, getEndLine, getFilename, getHops, getLoopDepRatio, getLops, getName, getNumStatements, getOutputNamesofSB, getOutputsofSB, getSBID, getStatement, getStatements, getText, getUpdateInPlaceVars, hasHops, isMergeableFunctionCallBlock, isNondeterministic, isRecompileOnce, isRewritableFunctionCall, isSplitDag, mergeable, mergeFunctionCalls, mergeStatementBlocks, printBlockErrorLocation, printErrorLocation, printWarningLocation, raiseValidateError, raiseValidateError, requiresRecompilation, rewriteFunctionCallStatements, rHoistFunctionCallsFromExpressions, rHoistFunctionCallsFromExpressions, rHoistFunctionCallsFromExpressions, setBeginColumn, setBeginLine, setCheckpointPosition, setDMLProg, setEndColumn, setEndLine, setFilename, setHops, setLoopDepRatio, setLops, setNondeterministic, setParseInfo, setRecompileOnce, setSplitDag, setStatementFormatType, setStatementFormatType, setStatements, setText, setUpdateInPlaceVars, toString, updateRecompilationFlag`

### Methods inherited from class org.apache.sysds.parser.LiveVariableAnalysis

`getGen, getKill, getWarn, liveIn, liveOut, setGen, setKill, setLiveIn, setLiveOut, setReadVariables, setUpdatedVariables, updateLiveVariablesOut, variablesRead, variablesUpdated`

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

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

## Field Details

### CHECK

public static final String CHECK

See Also:
  - Constant Field Values

### PAR

public static final String PAR

See Also:
  - Constant Field Values

### TASK_PARTITIONER

public static final String TASK_PARTITIONER

See Also:
  - Constant Field Values

### TASK_SIZE

public static final String TASK_SIZE

See Also:
  - Constant Field Values

### DATA_PARTITIONER

public static final String DATA_PARTITIONER

See Also:
  - Constant Field Values

### RESULT_MERGE

public static final String RESULT_MERGE

See Also:
  - Constant Field Values

### EXEC_MODE

public static final String EXEC_MODE

See Also:
  - Constant Field Values

### OPT_MODE

public static final String OPT_MODE

See Also:
  - Constant Field Values

### OPT_LOG

public static final String OPT_LOG

See Also:
  - Constant Field Values

### PROFILE

public static final String PROFILE

See Also:
  - Constant Field Values

### INTERAL_FN_INDEX_ROW

public static final String INTERAL_FN_INDEX_ROW

See Also:
  - Constant Field Values

### INTERAL_FN_INDEX_COL

public static final String INTERAL_FN_INDEX_COL

See Also:
  - Constant Field Values

## Constructor Details

### ParForStatementBlock

public ParForStatementBlock()

## Method Details

### getID

public long getID()

### getResultVariables

public ArrayList<ParForStatementBlock.ResultVar> getResultVariables()

### setResultVariables

public void setResultVariables(ArrayList<ParForStatementBlock.ResultVar> rvars)

### validate

public VariableSet validate(DMLProgram dmlProg, VariableSet ids, HashMap<String,ConstIdentifier> constVars, boolean conditional)

Overrides:
  `validate` in class `ForStatementBlock`

### getReadOnlyParentMatrixVars

public List<String> getReadOnlyParentMatrixVars()

### determineDataPartitionFormat

public ParForProgramBlock.PartitionFormat determineDataPartitionFormat(String var)
Determines the PDataPartitioningFormat for read-only parent variables according to the access pattern of that variable within the parfor statement block. Row-wise or column wise partitioning is only suggested if we see pure row-wise or column-wise access patterns.

Parameters:
  `var` - variables
Returns:
  partition format