public class DMLScript extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DMLScript.DMLOptions
Set of DMLOptions that can be set through the command line
and
MLContext
The values have been initialized with the default values
Despite there being a DML and PyDML, this class is named DMLOptions
to keep it consistent with DMLScript and DMLScript.DMLOptions |
static class |
DMLScript.RUNTIME_PLATFORM |
Modifier and Type | Field and Description |
---|---|
static boolean |
_activeAM |
static boolean |
_suppressPrint2Stdout |
static String |
_uuid |
static String |
DML_FILE_PATH_ANTLR_PARSER |
static boolean |
EAGER_CUDA_FREE |
static boolean |
ENABLE_DEBUG_MODE |
static org.apache.sysml.utils.Explain.ExplainType |
EXPLAIN |
static boolean |
FINEGRAINED_STATISTICS |
static String |
FLOATING_POINT_PRECISION |
static boolean |
FORCE_ACCELERATOR |
static DMLScript.RUNTIME_PLATFORM |
rtplatform |
static ScriptType |
SCRIPT_TYPE
Global variable indicating the script type (DML or PYDML).
|
static boolean |
STATISTICS |
static int |
STATISTICS_COUNT |
static int |
STATISTICS_MAX_WRAP_LEN |
static boolean |
SYNCHRONIZE_GPU |
static boolean |
USE_ACCELERATOR |
static boolean |
USE_LOCAL_SPARK_CONFIG |
static boolean |
VALIDATOR_IGNORE_ISSUES
If true, allow DMLProgram to be generated while not halting due to validation errors/warnings
|
Constructor and Description |
---|
DMLScript() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupHadoopExecution(org.apache.sysml.conf.DMLConfig config) |
static org.apache.commons.cli.Options |
createCLIOptions()
Creates an
Options instance for the command line parameters
As of SystemML 0.13, Apache Commons CLI 1.2 is transitively in the classpath
However the most recent version of Apache Commons CLI is 1.4
Creating CLI options is done using Static methods. |
static boolean |
executeScript(org.apache.hadoop.conf.Configuration conf,
String[] args)
Single entry point for all public invocation alternatives (e.g.,
main, executeScript, JaqlUdf etc)
|
static String |
getUUID() |
static void |
initHadoopExecution(org.apache.sysml.conf.DMLConfig config) |
static boolean |
isActiveAM() |
static void |
main(String[] args) |
static DMLScript.DMLOptions |
parseCLArguments(String[] args,
org.apache.commons.cli.Options options)
Parses command line arguments to create a
DMLScript.DMLOptions instance with the correct options |
protected static String |
readDMLScript(boolean isFile,
String scriptOrFilename)
Reads the DML/PyDML script into a String
|
static void |
setActiveAM() |
static void |
setUUID(String uuid)
Used to set master UUID on all nodes (in parfor remote_mr, where DMLScript passed)
in order to simplify cleanup of scratch_space and local working dirs.
|
static boolean |
suppressPrint2Stdout() |
public static DMLScript.RUNTIME_PLATFORM rtplatform
public static boolean STATISTICS
public static boolean FINEGRAINED_STATISTICS
public static int STATISTICS_COUNT
public static int STATISTICS_MAX_WRAP_LEN
public static boolean ENABLE_DEBUG_MODE
public static org.apache.sysml.utils.Explain.ExplainType EXPLAIN
public static String DML_FILE_PATH_ANTLR_PARSER
public static String FLOATING_POINT_PRECISION
public static ScriptType SCRIPT_TYPE
public static boolean USE_ACCELERATOR
public static boolean FORCE_ACCELERATOR
public static boolean SYNCHRONIZE_GPU
public static boolean EAGER_CUDA_FREE
public static boolean _suppressPrint2Stdout
public static boolean USE_LOCAL_SPARK_CONFIG
public static boolean _activeAM
public static boolean VALIDATOR_IGNORE_ISSUES
public static String _uuid
public static String getUUID()
public static void setUUID(String uuid)
uuid
- master UUID to set on all nodespublic static boolean suppressPrint2Stdout()
public static void setActiveAM()
public static boolean isActiveAM()
public static void main(String[] args) throws IOException, DMLException
args
- command-line argumentsIOException
- if an IOException occursDMLException
- if a DMLException occurspublic static DMLScript.DMLOptions parseCLArguments(String[] args, org.apache.commons.cli.Options options) throws org.apache.commons.cli.ParseException
DMLScript.DMLOptions
instance with the correct optionsargs
- arguments from the command lineoptions
- an Options
instance containing the options that need to be parsedOptions
that contain the correct Option
s.org.apache.commons.cli.ParseException
- if there is an incorrect option specified in the CLIpublic static org.apache.commons.cli.Options createCLIOptions()
Options
instance for the command line parameters
As of SystemML 0.13, Apache Commons CLI 1.2 is transitively in the classpath
However the most recent version of Apache Commons CLI is 1.4
Creating CLI options is done using Static methods. This obviously makes it
thread unsafe. Instead of OptionBuilder
, CLI 1.4 uses Option.Builder which
has non-static methods.Options
public static boolean executeScript(org.apache.hadoop.conf.Configuration conf, String[] args) throws DMLException
conf
- Hadoop configurationargs
- argumentsDMLException
- if DMLException occursorg.apache.sysml.parser.ParseException
- if ParseException occursprotected static String readDMLScript(boolean isFile, String scriptOrFilename) throws IOException, org.apache.sysml.parser.LanguageException
isFile
- Whether the string argument is a path to a file or the script itselfscriptOrFilename
- script or filenameIOException
- if errororg.apache.sysml.parser.LanguageException
- if errorpublic static void initHadoopExecution(org.apache.sysml.conf.DMLConfig config) throws IOException, org.apache.sysml.parser.ParseException, DMLRuntimeException
IOException
org.apache.sysml.parser.ParseException
DMLRuntimeException
public static void cleanupHadoopExecution(org.apache.sysml.conf.DMLConfig config) throws IOException, org.apache.sysml.parser.ParseException
IOException
org.apache.sysml.parser.ParseException
Copyright © 2017 The Apache Software Foundation. All rights reserved.