Class ExecutionContext

    • Method Detail

      • getProgram

        public Program getProgram()
      • setProgram

        public void setProgram​(Program prog)
      • getLineage

        public Lineage getLineage()
      • setLineage

        public void setLineage​(Lineage lineage)
      • isAutoCreateVars

        public boolean isAutoCreateVars()
      • setAutoCreateVars

        public void setAutoCreateVars​(boolean flag)
      • setTID

        public void setTID​(long tid)
      • getTID

        public long getTID()
      • setSealClient

        public void setSealClient​(SEALClient seal_client)
      • getSealClient

        public SEALClient getSealClient()
      • getGPUContext

        public GPUContext getGPUContext​(int index)
        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

        public void setGPUContexts​(List<GPUContext> gpuContexts)
        Sets the list of GPUContexts
        Parameters:
        gpuContexts - a collection of GPUContexts
      • getGPUContexts

        public List<GPUContext> 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

        public Data getVariable​(String name)
      • setVariable

        public void setVariable​(String name,
                                Data val)
      • containsVariable

        public boolean containsVariable​(CPOperand operand)
      • containsVariable

        public boolean containsVariable​(String name)
      • removeVariable

        public Data removeVariable​(String name)
      • setMetaData

        public void setMetaData​(String fname,
                                MetaData md)
      • isMatrixObject

        public boolean isMatrixObject​(String varname)
      • isFrameObject

        public boolean isFrameObject​(String varname)
      • releaseCacheableData

        public void releaseCacheableData​(String varname)
      • getMatrixInput

        public MatrixBlock getMatrixInput​(String varName)
        Pins a matrix variable into memory and returns the internal matrix block.
        Parameters:
        varName - variable name
        Returns:
        matrix block
      • getTensorInput

        public TensorBlock getTensorInput​(String varName)
        Pins a matrix variable into memory and returns the internal matrix block.
        Parameters:
        varName - variable name
        Returns:
        matrix block
      • setMetaData

        public void setMetaData​(String varName,
                                long nrows,
                                long ncols)
      • 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 this ExecutionContext)
        numRows - number of rows of matrix object
        numCols - number of columns of matrix object
        Returns:
        a pair containing the wrapping MatrixObject and 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 name
        numRows - number of rows of matrix object
        numCols - number of columns of matrix object
        nnz - number of non zeroes
        Returns:
        matrix object
      • getSparseMatrixOutputForGPUInstruction

        public Pair<MatrixObject,​Boolean> getSparseMatrixOutputForGPUInstruction​(String varName,
                                                                                       long numRows,
                                                                                       long numCols,
                                                                                       long nnz,
                                                                                       boolean initialize)
      • allocateGPUMatrixObject

        public MatrixObject allocateGPUMatrixObject​(String varName,
                                                    long numRows,
                                                    long numCols)
        Allocates the GPUObject for a given LOPS Variable (eg. _mVar3)
        Parameters:
        varName - variable name
        numRows - number of rows of matrix object
        numCols - number of columns of matrix object
        Returns:
        matrix object
      • getGPUDensePointerAddress

        public long getGPUDensePointerAddress​(MatrixObject obj)
      • getMatrixInputForGPUInstruction

        public MatrixObject getMatrixInputForGPUInstruction​(String varName,
                                                            String opcode)
      • releaseMatrixInput

        public void releaseMatrixInput​(String varName)
        Unpins a currently pinned matrix variable and update fine-grained statistics.
        Parameters:
        varName - variable name
      • releaseMatrixInput

        public void releaseMatrixInput​(String... varNames)
      • releaseMatrixInputForGPUInstruction

        public void releaseMatrixInputForGPUInstruction​(String varName)
      • getFrameInput

        public FrameBlock getFrameInput​(String varName)
        Pins a frame variable into memory and returns the internal frame block.
        Parameters:
        varName - variable name
        Returns:
        frame block
      • releaseFrameInput

        public void releaseFrameInput​(String varName)
        Unpins a currently pinned frame variable.
        Parameters:
        varName - variable name
      • releaseTensorInput

        public void releaseTensorInput​(String varName)
      • releaseTensorInput

        public void releaseTensorInput​(String... varNames)
      • releaseMatrixOutputForGPUInstruction

        public void releaseMatrixOutputForGPUInstruction​(String varName)
      • setMatrixOutput

        public void setMatrixOutput​(String varName,
                                    MatrixBlock outputData)
      • setTensorOutput

        public void setTensorOutput​(String varName,
                                    TensorBlock outputData)
      • setFrameOutput

        public void setFrameOutput​(String varName,
                                   FrameBlock outputData)
      • releaseMatrixInputs

        public void releaseMatrixInputs​(CPOperand[] inputs)
      • releaseMatrixInputs

        public void releaseMatrixInputs​(CPOperand[] inputs,
                                        boolean includeList)
      • pinVariables

        public boolean[] pinVariables​(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). 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

        public void unpinVariables​(List<String> varList,
                                   boolean[] varsState)
        Unpin the a given list of variables by setting their "cleanup" status to the values specified by varsStats. Typical usage: oldStatus = pinVariables(varList); ... unpinVariables(varList, oldStatus); i.e., a call to unpinVariables() is preceded by pinVariables().
        Parameters:
        varList - variable list
        varsState - variable state
      • getVarList

        public ArrayList<String> getVarList()
        NOTE: No order guaranteed, so keep same list for pin and unpin.
        Returns:
        list of all variable names.
      • getVarListPartitioned

        public ArrayList<String> getVarListPartitioned()
        NOTE: No order guaranteed, so keep same list for pin and unpin.
        Returns:
        list of all variable names of partitioned matrices.
      • cleanupDataObject

        public final void cleanupDataObject​(Data dat)
      • cleanupCacheableData

        public void cleanupCacheableData​(CacheableData<?> mo)
      • isFederated

        public boolean isFederated​(CPOperand input)
      • traceLineage

        public void traceLineage​(Instruction inst)
      • maintainLineageDebuggerInfo

        public void maintainLineageDebuggerInfo​(Instruction inst)
      • addTmpParforFunction

        public void addTmpParforFunction​(String fname)
      • getTmpParforFunctions

        public Set<String> getTmpParforFunctions()