Package org.apache.sysds.api.jmlc
Class PreparedScript
- java.lang.Object
- 
- org.apache.sysds.api.jmlc.PreparedScript
 
- 
- All Implemented Interfaces:
- ConfigurableAPI
 
 public class PreparedScript extends Object implements ConfigurableAPI Representation of a prepared (precompiled) DML/PyDML script.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearParameters()Remove all current values bound to input or output variables.voidclearPinnedData()Remove all references to pinned variables from this script.Objectclone()PreparedScriptclone(boolean deep)Creates a cloned instance of the prepared script, which allows for concurrent execution without side effects.voidenableFunctionRecompile(String fnamespace, String... fnames)Enables function recompilation, selectively for the given functions.ResultVariablesexecuteScript()Executes the prepared script over the bound inputs, creating the result variables according to bound and registered outputs.Stringexplain()Explain the DML/PyDML program and view result as a string.CompilerConfiggetCompilerConfig()Get the compiler configuration object associated with the prepared script instance.DMLConfiggetDMLConfig()Get the dml configuration object associated with the prepared script instance.StringgetLineageTrace(String var)Capture lineage of the DML/PyDML program and view result as a string.voidresetConfig()Reset configuration settings to default settings.voidsetConfigProperty(String propertyName, String propertyValue)Set configuration property, such assetConfigProperty("sysds.localtmpdir", "/tmp/systemds").voidsetFrame(String varname, String[][] frame)Binds a frame object to a registered input variable.voidsetFrame(String varname, String[][] frame, boolean reuse)Binds a frame object to a registered input variable.voidsetFrame(String varname, String[][] frame, List<Types.ValueType> schema)Binds a frame object to a registered input variable.voidsetFrame(String varname, String[][] frame, List<Types.ValueType> schema, boolean reuse)Binds a frame object to a registered input variable.voidsetFrame(String varname, String[][] frame, List<Types.ValueType> schema, List<String> colnames)Binds a frame object to a registered input variable.voidsetFrame(String varname, String[][] frame, List<Types.ValueType> schema, List<String> colnames, boolean reuse)Binds a frame object to a registered input variable.voidsetFrame(String varname, FrameBlock frame, boolean reuse)Binds a frame object to a registered input variable.voidsetMatrix(String varname, double[][] matrix)Binds a matrix object to a registered input variable.voidsetMatrix(String varname, double[][] matrix, boolean reuse)Binds a matrix object to a registered input variable.voidsetMatrix(String varname, MatrixBlock matrix, boolean reuse)Binds a matrix object to a registered input variable.voidsetScalar(String varname, boolean scalar)Binds a scalar boolean to a registered input variable.voidsetScalar(String varname, boolean scalar, boolean reuse)Binds a scalar boolean to a registered input variable.voidsetScalar(String varname, double scalar)Binds a scalar double to a registered input variable.voidsetScalar(String varname, double scalar, boolean reuse)Binds a scalar double to a registered input variable.voidsetScalar(String varname, long scalar)Binds a scalar long to a registered input variable.voidsetScalar(String varname, long scalar, boolean reuse)Binds a scalar long to a registered input variable.voidsetScalar(String varname, String scalar)Binds a scalar string to a registered input variable.voidsetScalar(String varname, String scalar, boolean reuse)Binds a scalar string to a registered input variable.voidsetScalar(String varname, ScalarObject scalar, boolean reuse)Binds a scalar object to a registered input variable.Stringstatistics()Return a string containing runtime statistics.
 
- 
- 
- 
Method Detail- 
resetConfigpublic void resetConfig() Description copied from interface:ConfigurableAPIReset configuration settings to default settings.- Specified by:
- resetConfigin interface- ConfigurableAPI
 
 - 
setConfigPropertypublic void setConfigProperty(String propertyName, String propertyValue) Description copied from interface:ConfigurableAPISet configuration property, such assetConfigProperty("sysds.localtmpdir", "/tmp/systemds").- Specified by:
- setConfigPropertyin interface- ConfigurableAPI
- Parameters:
- propertyName- property name
- propertyValue- property value
 
 - 
getDMLConfigpublic DMLConfig getDMLConfig() Get the dml configuration object associated with the prepared script instance.- Returns:
- dml configuration
 
 - 
getCompilerConfigpublic CompilerConfig getCompilerConfig() Get the compiler configuration object associated with the prepared script instance.- Returns:
- compiler configuration
 
 - 
setScalarpublic void setScalar(String varname, boolean scalar) Binds a scalar boolean to a registered input variable.- Parameters:
- varname- input variable name
- scalar- boolean value
 
 - 
setScalarpublic void setScalar(String varname, boolean scalar, boolean reuse) Binds a scalar boolean to a registered input variable.- Parameters:
- varname- input variable name
- scalar- boolean value
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setScalarpublic void setScalar(String varname, long scalar) Binds a scalar long to a registered input variable.- Parameters:
- varname- input variable name
- scalar- long value
 
 - 
setScalarpublic void setScalar(String varname, long scalar, boolean reuse) Binds a scalar long to a registered input variable.- Parameters:
- varname- input variable name
- scalar- long value
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setScalarpublic void setScalar(String varname, double scalar) Binds a scalar double to a registered input variable.- Parameters:
- varname- input variable name
- scalar- double value
 
 - 
setScalarpublic void setScalar(String varname, double scalar, boolean reuse) Binds a scalar double to a registered input variable.- Parameters:
- varname- input variable name
- scalar- double value
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setScalarpublic void setScalar(String varname, String scalar) Binds a scalar string to a registered input variable.- Parameters:
- varname- input variable name
- scalar- string value
 
 - 
setScalarpublic void setScalar(String varname, String scalar, boolean reuse) Binds a scalar string to a registered input variable.- Parameters:
- varname- input variable name
- scalar- string value
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setScalarpublic void setScalar(String varname, ScalarObject scalar, boolean reuse) Binds a scalar object to a registered input variable. If reuse requested, then the input is guaranteed to be preserved over multipleexecuteScriptcalls.- Parameters:
- varname- input variable name
- scalar- scalar object
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setMatrixpublic void setMatrix(String varname, double[][] matrix) Binds a matrix object to a registered input variable.- Parameters:
- varname- input variable name
- matrix- two-dimensional double array matrix representation
 
 - 
setMatrixpublic void setMatrix(String varname, double[][] matrix, boolean reuse) Binds a matrix object to a registered input variable.- Parameters:
- varname- input variable name
- matrix- two-dimensional double array matrix representation
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setMatrixpublic void setMatrix(String varname, MatrixBlock matrix, boolean reuse) Binds a matrix object to a registered input variable. If reuse requested, then the input is guaranteed to be preserved over multipleexecuteScriptcalls.- Parameters:
- varname- input variable name
- matrix- matrix represented as a MatrixBlock
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setFramepublic void setFrame(String varname, String[][] frame) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
 
 - 
setFramepublic void setFrame(String varname, String[][] frame, List<Types.ValueType> schema) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
- schema- list representing the types of the frame columns
 
 - 
setFramepublic void setFrame(String varname, String[][] frame, List<Types.ValueType> schema, List<String> colnames) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
- schema- list representing the types of the frame columns
- colnames- frame column names
 
 - 
setFramepublic void setFrame(String varname, String[][] frame, boolean reuse) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setFramepublic void setFrame(String varname, String[][] frame, List<Types.ValueType> schema, boolean reuse) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
- schema- list representing the types of the frame columns
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setFramepublic void setFrame(String varname, String[][] frame, List<Types.ValueType> schema, List<String> colnames, boolean reuse) Binds a frame object to a registered input variable.- Parameters:
- varname- input variable name
- frame- two-dimensional string array frame representation
- schema- list representing the types of the frame columns
- colnames- frame column names
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
setFramepublic void setFrame(String varname, FrameBlock frame, boolean reuse) Binds a frame object to a registered input variable. If reuse requested, then the input is guaranteed to be preserved over multipleexecuteScriptcalls.- Parameters:
- varname- input variable name
- frame- frame represented as a FrameBlock
- reuse- if- true, preserve value over multiple- executeScriptcalls
 
 - 
clearParameterspublic void clearParameters() Remove all current values bound to input or output variables.
 - 
clearPinnedDatapublic void clearPinnedData() Remove all references to pinned variables from this script. Note: this *does not* remove the underlying data. It merely removes a reference to it from this prepared script. This is useful if you want to maintain an independent cache of weights and allow the JVM to garbage collect under memory pressure.
 - 
executeScriptpublic ResultVariables executeScript() Executes the prepared script over the bound inputs, creating the result variables according to bound and registered outputs.- Returns:
- ResultVariables object encapsulating output results
 
 - 
explainpublic String explain() Explain the DML/PyDML program and view result as a string.- Returns:
- string results of explain
 
 - 
getLineageTracepublic String getLineageTrace(String var) Capture lineage of the DML/PyDML program and view result as a string.- Parameters:
- var- the output variable name on which lineage trace is sought
- Returns:
- string results of lineage trace
 
 - 
statisticspublic String statistics() Return a string containing runtime statistics. Note: these are not thread local and will reflect execution in all threads- Returns:
- string containing statistics
 
 - 
enableFunctionRecompilepublic void enableFunctionRecompile(String fnamespace, String... fnames) Enables function recompilation, selectively for the given functions. If dynamic recompilation is globally enabled this has no additional effect; otherwise the given functions are dynamically recompiled once on every entry but not at the granularity of individually last-level program blocks. Use this fine-grained recompilation option for important functions in small-data scenarios where dynamic recompilation overheads might not be amortized.- Parameters:
- fnamespace- function namespace, null for default namespace
- fnames- function name
 
 - 
clonepublic PreparedScript clone(boolean deep) Creates a cloned instance of the prepared script, which allows for concurrent execution without side effects.- Parameters:
- deep- indicator if a deep copy needs to be created; if false, only a shallow (i.e., by reference) copy of the program and read-only meta data is created.
- Returns:
- an equivalent prepared script
 
 - 
clonepublic Object clone() 
 
- 
 
-