Package org.apache.sysds.lops
Class PartialAggregate
- java.lang.Object
- 
- org.apache.sysds.lops.Lop
- 
- org.apache.sysds.lops.PartialAggregate
 
 
- 
 public class PartialAggregate extends Lop Lop to perform a partial aggregation. It was introduced to do some initial aggregation operations on blocks in the mapper/reducer.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.sysds.lops.LopLop.SimpleInstType, Lop.Type, Lop.VisitStatus
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.sysds.lops.Lop_beginColumn, _beginLine, _endColumn, _endLine, _filename, CP_CHILD_THREAD, CP_ROOT_THREAD_ID, DATATYPE_PREFIX, FILE_SEPARATOR, FRAME_VAR_NAME_PREFIX, INSTRUCTION_DELIMITOR, LITERAL_PREFIX, MATRIX_VAR_NAME_PREFIX, NAME_VALUE_SEPARATOR, OPERAND_DELIMITOR, PROCESS_PREFIX, SAMPLE_FRACTION, SCALAR_VAR_NAME_PREFIX, UPDATE_INPLACE_PREFIX, VALUETYPE_PREFIX, VARIABLE_NAME_PLACEHOLDER
 
- 
 - 
Constructor SummaryConstructors Constructor Description PartialAggregate(Lop input, Types.AggOp op, Types.Direction direct, Types.DataType dt, Types.ValueType vt, Types.ExecType et, int k)PartialAggregate(Lop input, Types.AggOp op, Types.Direction direct, Types.DataType dt, Types.ValueType vt, AggBinaryOp.SparkAggType aggtype, Types.ExecType et)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AggBinaryOp.SparkAggTypegetAggType()Method to get aggregate type if applicable.Types.CorrectionLocationTypegetCorrectionLocation()This method computes the location of "correction" terms in the output produced by PartialAgg instruction.static Types.CorrectionLocationTypegetCorrectionLocation(Types.AggOp operation, Types.Direction direction)StringgetInstructions(String input1, String output)Instruction generation for CP and Sparkstatic StringgetOpcode(Types.AggOp op, Types.Direction dir)voidsetDimensionsBasedOnDirection(long dim1, long dim2, long blen)static voidsetDimensionsBasedOnDirection(Lop lop, long dim1, long dim2, long blen, Types.Direction dir)StringtoString()Method to have Lops print their state.- 
Methods inherited from class org.apache.sysds.lops.LopactivatePrefetch, addInput, addOutput, addToDag, createReachable, getBeginColumn, getBeginLine, getBroadcastInput, getDataType, getEndColumn, getEndLine, getExecType, getFederatedOutput, getFilename, getID, getInputs, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getInstructions, getLevel, getOutputParameters, getOutputs, getPrivacyConstraint, getProducesIntermediateOutput, getReachable, getSimpleInstructionType, getType, getValueType, getVisited, isAllOutputsCP, isDataExecLocation, isVariable, prefetchActivated, prepInputOperand, prepInputOperand, prepOperand, prepOperand, prepOutputOperand, prepOutputOperand, prepOutputOperand, prepScalarInputOperand, prepScalarInputOperand, prepScalarLabel, prepScalarOperand, printErrorLocation, removeConsumer, removeOutput, replaceInput, resetVisitStatus, setAllPositions, setBeginColumn, setBeginLine, setConsumerCount, setDataType, setEndColumn, setEndLine, setExecType, setFederatedOutput, setFilename, setPrivacyConstraint, setValueType, setVisited
 
- 
 
- 
- 
- 
Constructor Detail- 
PartialAggregatepublic PartialAggregate(Lop input, Types.AggOp op, Types.Direction direct, Types.DataType dt, Types.ValueType vt, Types.ExecType et, int k) 
 - 
PartialAggregatepublic PartialAggregate(Lop input, Types.AggOp op, Types.Direction direct, Types.DataType dt, Types.ValueType vt, AggBinaryOp.SparkAggType aggtype, Types.ExecType et) 
 
- 
 - 
Method Detail- 
getCorrectionLocationpublic Types.CorrectionLocationType getCorrectionLocation() This method computes the location of "correction" terms in the output produced by PartialAgg instruction. When computing the stable sum, "correction" refers to the compensation as defined by the original Kahan algorithm. When computing the stable mean, "correction" refers to two extra values (the running mean, count) produced by each Mapper i.e., by each PartialAgg instruction. This method is invoked during hop-to-lop translation, while creating the corresponding Aggregate lop Computed information is encoded in the PartialAgg instruction so that the appropriate aggregate operator is used at runtime (see: dml.runtime.matrix.operator.AggregateOperator.java and dml.runtime.matrix)- Returns:
- correct location
 
 - 
getCorrectionLocationpublic static Types.CorrectionLocationType getCorrectionLocation(Types.AggOp operation, Types.Direction direction) 
 - 
getAggTypepublic AggBinaryOp.SparkAggType getAggType() Description copied from class:LopMethod to get aggregate type if applicable. This method is overridden by the Lops with aggregate types (e.g. MapMult)- Overrides:
- getAggTypein class- Lop
- Returns:
- SparkAggType
 
 - 
setDimensionsBasedOnDirectionpublic void setDimensionsBasedOnDirection(long dim1, long dim2, long blen)
 - 
setDimensionsBasedOnDirectionpublic static void setDimensionsBasedOnDirection(Lop lop, long dim1, long dim2, long blen, Types.Direction dir) 
 - 
toStringpublic String toString() Description copied from class:LopMethod to have Lops print their state. This is for debugging purposes.
 - 
getInstructionspublic String getInstructions(String input1, String output) Instruction generation for CP and Spark- Overrides:
- getInstructionsin class- Lop
- Parameters:
- input1- input 1
- output- output
- Returns:
- instructions as string
 
 - 
getOpcodepublic static String getOpcode(Types.AggOp op, Types.Direction dir) 
 
- 
 
-