Class ExecutionContext
java.lang.Object
org.apache.sysds.runtime.controlprogram.context.ExecutionContext
- Direct Known Subclasses:
SparkExecutionContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTmpParforFunction(String fname) allocateGPUMatrixObject(String varName, long numRows, long numCols) Allocates theGPUObjectfor a given LOPS Variable (eg.voidfinal voidcleanupDataObject(Data dat) booleancontainsVariable(String name) booleancontainsVariable(CPOperand operand) static CacheableData<?>createCacheableData(CacheBlock<?> cb) static FrameObjectstatic FrameObjectstatic MatrixObjectstatic MatrixObjectgetCacheableData(String varname) getCacheableData(CPOperand input) getDataCharacteristics(String varname) getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols) Allocates a dense matrix on the GPU (for output)getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, boolean initialize) getFrameInput(String varName) Pins a frame variable into memory and returns the internal frame block.getFrameInput(CPOperand input) getFrameInputs(CPOperand[] inputs) getFrameObject(String varname) getFrameObject(CPOperand input) getGPUContext(int index) Get the i-th GPUContextGets the list of GPUContextslonggetLineageItem(String varname) getLineageItem(CPOperand input) getListObject(String name) getListObject(CPOperand input) getMatrixInput(String varName) Pins a matrix variable into memory and returns the internal matrix block.getMatrixInput(CPOperand input) getMatrixInputForGPUInstruction(String varName, String opcode) getMatrixInputs(CPOperand[] inputs) getMatrixInputs(CPOperand[] inputs, boolean includeList) getMatrixLineagePair(String varname) getMatrixObject(String varname) getMatrixObject(CPOperand input) getMetaData(String varname) intGets the number of GPUContextsgetOrCreateLineageItem(CPOperand input) getScalarInput(String name, Types.ValueType vt, boolean isLiteral) getScalarInput(CPOperand input) getScalarInputs(CPOperand[] inputs) getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz) Allocates a sparse matrix in CSR format on the GPU.getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz, boolean initialize) getTensorInput(String varName) Pins a matrix variable into memory and returns the internal matrix block.getTensorObject(String varname) longgetTID()getVariable(String name) getVariable(CPOperand operand) NOTE: No order guaranteed, so keep same list for pin and unpin.NOTE: No order guaranteed, so keep same list for pin and unpin.booleanbooleanisFederated(CPOperand input) booleanisFederated(CPOperand input, FTypes.FType type) booleanisFrameObject(String varname) booleanisMatrixObject(String varname) voidpinVariables(List<String> varList) Pin a given list of variables i.e., set the "clean up" state in corresponding matrix objects, so that the cached data inside these objects is not cleared and the corresponding HDFS files are not deleted (through rmvar instructions).voidreleaseCacheableData(String varname) voidreleaseFrameInput(String varName) Unpins a currently pinned frame variable.voidreleaseFrameInputs(CPOperand[] inputs) voidreleaseMatrixInput(String varName) Unpins a currently pinned matrix variable and update fine-grained statistics.voidreleaseMatrixInput(String... varNames) voidvoidreleaseMatrixInputs(CPOperand[] inputs) voidreleaseMatrixInputs(CPOperand[] inputs, boolean includeList) voidvoidreleaseTensorInput(String varName) voidreleaseTensorInput(String... varNames) removeVariable(String name) voidreplaceLineageItem(String varname, LineageItem li) voidsetAutoCreateVars(boolean flag) voidsetFrameOutput(String varName, FrameBlock outputData) voidsetGPUContexts(List<GPUContext> gpuContexts) Sets the list of GPUContextsvoidsetLineage(Lineage lineage) voidsetMatrixOutput(String varName, Future<MatrixBlock> fmb) voidsetMatrixOutput(String varName, MatrixBlock outputData) voidsetMatrixOutput(String varName, MatrixBlock outputData, MatrixObject.UpdateType flag) voidsetMatrixOutputAndLineage(String varName, Future<MatrixBlock> fmb, LineageItem li) voidsetMatrixOutputAndLineage(String varName, MatrixBlock outputData, LineageItem li) voidsetMatrixOutputAndLineage(CPOperand var, MatrixBlock outputData, LineageItem li) voidsetMetaData(String varName, long nrows, long ncols) voidsetMetaData(String fname, MetaData md) voidsetProgram(Program prog) voidsetScalarOutput(String varName, ScalarObject so) voidsetSealClient(SEALClient seal_client) voidsetTensorOutput(String varName, TensorBlock outputData) voidsetTID(long tid) voidsetVariable(String name, Data val) voidsetVariables(LocalVariableMap vars) toString()voidtraceLineage(Instruction inst) voidunpinVariables(List<String> varList, Queue<Boolean> varsState) Unpin the a given list of variables by setting their "cleanup" status to the values specified byvarsStats.
-
Constructor Details
-
ExecutionContext
-
-
Method Details
-
getProgram
-
setProgram
-
getVariables
-
setVariables
-
getLineage
-
setLineage
-
isAutoCreateVars
public boolean isAutoCreateVars() -
setAutoCreateVars
public void setAutoCreateVars(boolean flag) -
setTID
public void setTID(long tid) -
getTID
public long getTID() -
setSealClient
-
getSealClient
-
getGPUContext
Get the i-th GPUContext- Parameters:
index- index of the GPUContext- Returns:
- a valid GPUContext or null if the indexed GPUContext does not exist.
-
setGPUContexts
Sets the list of GPUContexts- Parameters:
gpuContexts- a collection of GPUContexts
-
getGPUContexts
Gets the list of GPUContexts- Returns:
- a list of GPUContexts
-
getNumGPUContexts
public int getNumGPUContexts()Gets the number of GPUContexts- Returns:
- number of GPUContexts
-
getVariable
-
getVariable
-
setVariable
-
containsVariable
-
containsVariable
-
removeVariable
-
setMetaData
-
getMetaData
-
isMatrixObject
-
getMatrixObject
-
getMatrixObject
-
getMatrixLineagePair
-
getMatrixLineagePair
-
getTensorObject
-
isFrameObject
-
getFrameObject
-
getFrameObject
-
getCacheableData
-
getCacheableData
-
releaseCacheableData
-
getDataCharacteristics
-
getMatrixInput
Pins a matrix variable into memory and returns the internal matrix block.- Parameters:
varName- variable name- Returns:
- matrix block
-
getMatrixInput
-
getTensorInput
Pins a matrix variable into memory and returns the internal matrix block.- Parameters:
varName- variable name- Returns:
- matrix block
-
setMetaData
-
getDenseMatrixOutputForGPUInstruction
public Pair<MatrixObject,Boolean> getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols) Allocates a dense matrix on the GPU (for output)- Parameters:
varName- name of the output matrix (known by thisExecutionContext)numRows- number of rows of matrix objectnumCols- number of columns of matrix object- Returns:
- a pair containing the wrapping
MatrixObjectand a boolean indicating whether a cuda memory allocation took place (as opposed to the space already being allocated)
-
getDenseMatrixOutputForGPUInstruction
public Pair<MatrixObject,Boolean> getDenseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, boolean initialize) -
getSparseMatrixOutputForGPUInstruction
public Pair<MatrixObject,Boolean> getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz) Allocates a sparse matrix in CSR format on the GPU. Assumes that mat.getNumRows() returns a valid number- Parameters:
varName- variable namenumRows- number of rows of matrix objectnumCols- number of columns of matrix objectnnz- number of non zeroes- Returns:
- matrix object
-
getSparseMatrixOutputForGPUInstruction
public Pair<MatrixObject,Boolean> getSparseMatrixOutputForGPUInstruction(String varName, long numRows, long numCols, long nnz, boolean initialize) -
allocateGPUMatrixObject
Allocates theGPUObjectfor a given LOPS Variable (eg. _mVar3)- Parameters:
varName- variable namenumRows- number of rows of matrix objectnumCols- number of columns of matrix object- Returns:
- matrix object
-
getGPUDensePointerAddress
-
getGPUSparsePointerAddress
-
getMatrixInputForGPUInstruction
-
releaseMatrixInput
Unpins a currently pinned matrix variable and update fine-grained statistics.- Parameters:
varName- variable name
-
releaseMatrixInput
-
releaseMatrixInputForGPUInstruction
-
getFrameInput
-
getFrameInput
Pins a frame variable into memory and returns the internal frame block.- Parameters:
varName- variable name- Returns:
- frame block
-
releaseFrameInput
Unpins a currently pinned frame variable.- Parameters:
varName- variable name
-
releaseFrameInputs
-
releaseTensorInput
-
releaseTensorInput
-
getScalarInput
-
getScalarInput
-
setScalarOutput
-
getListObject
-
getListObject
-
releaseMatrixOutputForGPUInstruction
-
setMatrixOutput
-
setMatrixOutputAndLineage
-
setMatrixOutputAndLineage
-
setMatrixOutputAndLineage
-
setMatrixOutput
-
setMatrixOutput
-
setTensorOutput
-
setFrameOutput
-
createCacheableData
-
createMatrixObject
-
createMatrixObject
-
createFrameObject
-
createFrameObject
-
getMatrixInputs
-
getMatrixInputs
-
getScalarInputs
-
getFrameInputs
-
releaseMatrixInputs
-
releaseMatrixInputs
-
pinVariables
Pin a given list of variables i.e., set the "clean up" state in corresponding matrix objects, so that the cached data inside these objects is not cleared and the corresponding HDFS files are not deleted (through rmvar instructions). This is necessary for: function input variables, parfor result variables, parfor shared inputs that are passed to functions. The function returns the OLD "clean up" state of matrix objects.- Parameters:
varList- variable list- Returns:
- indicator vector of old cleanup state of matrix objects
-
unpinVariables
Unpin the a given list of variables by setting their "cleanup" status to the values specified byvarsStats. Typical usage:oldStatus = pinVariables(varList); ... unpinVariables(varList, oldStatus);i.e., a call to unpinVariables() is preceded by pinVariables().- Parameters:
varList- variable listvarsState- variable state
-
getVarList
NOTE: No order guaranteed, so keep same list for pin and unpin.- Returns:
- list of all variable names.
-
getVarListPartitioned
NOTE: No order guaranteed, so keep same list for pin and unpin.- Returns:
- list of all variable names of partitioned matrices.
-
cleanupDataObject
-
cleanupCacheableData
-
isFederated
-
isFederated
-
traceLineage
-
maintainLineageDebuggerInfo
-
getLineageItem
-
getLineageItem
-
getOrCreateLineageItem
-
replaceLineageItem
-
addTmpParforFunction
-
getTmpParforFunctions
-
toString
-