org.apache.sysds.runtime.controlprogram.parfor

## Class ResultMergeLocalFile

- java.lang.Object
- - org.apache.sysds.runtime.controlprogram.parfor.ResultMerge
  - - org.apache.sysds.runtime.controlprogram.parfor.ResultMergeLocalFile

All Implemented Interfaces:
  Serializable

    public class ResultMergeLocalFile
    extends ResultMerge

TODO potential extension: parallel merge (create individual staging files concurrently) NOTE: file merge typically used due to memory constraints - parallel merge would increase the memory consumption again.

See Also:
  Serialized Form

### Field Summary

Fields
`static boolean` `ALLOW_COPY_CELLFILES`

### Constructor Summary

Constructors
Constructor and Description
`ResultMergeLocalFile(MatrixObject out, MatrixObject[] in, String outputFilename, boolean accum)`

### Method Summary

All Methods Instance Methods Concrete Methods
`MatrixObject` `executeParallelMerge(int par)` Merge all given input matrices in parallel into the given output matrix.
`MatrixObject` `executeSerialMerge()` Merge all given input matrices sequentially into the given output matrix.

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

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

### Field Detail

#### ALLOW_COPY_CELLFILES

    public static final boolean ALLOW_COPY_CELLFILES

See Also:
  Constant Field Values

### Constructor Detail

#### ResultMergeLocalFile

    public ResultMergeLocalFile(MatrixObject out,
                                MatrixObject[] in,
                                String outputFilename,
                                boolean accum)

### Method Detail

#### executeSerialMerge

    public MatrixObject executeSerialMerge()

Description copied from class: `ResultMerge`
Merge all given input matrices sequentially into the given output matrix. The required space in-memory is the size of the output matrix plus the size of one input matrix at a time.

Specified by:
  `executeSerialMerge` in class `ResultMerge`
Returns:
  output (merged) matrix

#### executeParallelMerge

    public MatrixObject executeParallelMerge(int par)

Description copied from class: `ResultMerge`
Merge all given input matrices in parallel into the given output matrix. The required space in-memory is the size of the output matrix plus the size of all input matrices.

Specified by:
  `executeParallelMerge` in class `ResultMerge`
Parameters:
  `par` - degree of parallelism
Returns:
  output (merged) matrix