Package org.apache.sysds.api

## Class DMLScript

- java.lang.Object
- - org.apache.sysds.api.DMLScript

-     public class DMLScript
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static boolean` | `_activeAM` |
    `static boolean` | `_suppressPrint2Stdout` |
    `static String` | `_uuid` |
    `static boolean` | `CHECK_PRIVACY` |
    `static String` | `DML_FILE_PATH_ANTLR_PARSER` |
    `static boolean` | `EAGER_CUDA_FREE` |
    `static long` | `EVICTION_SHADOW_BUFFER_CURR_BYTES` |
    `static long` | `EVICTION_SHADOW_BUFFER_MAX_BYTES` |
    `static Explain.ExplainType` | `EXPLAIN` |
    `static boolean` | `FED_STATISTICS` |
    `static int` | `FED_STATISTICS_COUNT` |
    `static boolean` | `FED_WORKER` |
    `static String` | `FLOATING_POINT_PRECISION` |
    `static boolean` | `FORCE_ACCELERATOR` |
    `static String` | `GPU_MEMORY_ALLOCATOR` |
    `static double` | `GPU_MEMORY_UTILIZATION_FACTOR` |
    `static boolean` | `JMLC_MEM_STATISTICS` |
    `static boolean` | `LINEAGE` |
    `static boolean` | `LINEAGE_DEBUGGER` |
    `static boolean` | `LINEAGE_DEDUP` |
    `static boolean` | `LINEAGE_ESTIMATE` |
    `static LineageCacheConfig.LineageCachePolicy` | `LINEAGE_POLICY` |
    `static LineageCacheConfig.ReuseCacheType` | `LINEAGE_REUSE` |
    `static boolean` | `PRINT_GPU_MEMORY_INFO` |
    `static int` | `SEED` |
    `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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `DMLScript()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `cleanupHadoopExecution​(DMLConfig config)` |
    `static void` | `errorPrint​(Exception e)` | Print the error in a user friendly manner.
    `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 Types.ExecMode` | `getGlobalExecMode()` |
    `static String` | `getUUID()` |
    `static void` | `initHadoopExecution​(DMLConfig config)` |
    `static boolean` | `isActiveAM()` |
    `static void` | `loadConfiguration​(String fnameOptConfig)` |
    `static void` | `main​(String[] args)` | Main entry point for systemDS dml script execution
    `static String` | `readDMLScript​(boolean isFile, String scriptOrFilename)` | Reads the DML/PyDML script into a String
    `static void` | `setActiveAM()` |
    `static void` | `setGlobalExecMode​(Types.ExecMode mode)` |
    `static void` | `setGlobalFlags​(DMLConfig dmlconf)` | Sets the global flags in DMLScript based on user provided configuration
    `static void` | `setUUID​(String uuid)` | Used to set master UUID on all nodes (in parfor remote, where DMLScript passed) in order to simplify cleanup of scratch_space and local working dirs.
    `static boolean` | `suppressPrint2Stdout()` |

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

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

- - ### Field Detail

    - #### STATISTICS

          public static boolean STATISTICS

    - #### JMLC_MEM_STATISTICS

          public static boolean JMLC_MEM_STATISTICS

    - #### STATISTICS_COUNT

          public static int STATISTICS_COUNT

    - #### STATISTICS_MAX_WRAP_LEN

          public static int STATISTICS_MAX_WRAP_LEN

    - #### FED_STATISTICS

          public static boolean FED_STATISTICS

    - #### FED_STATISTICS_COUNT

          public static int FED_STATISTICS_COUNT

    - #### FED_WORKER

          public static boolean FED_WORKER

    - #### EXPLAIN

          public static Explain.ExplainType EXPLAIN

    - #### DML_FILE_PATH_ANTLR_PARSER

          public static String DML_FILE_PATH_ANTLR_PARSER

    - #### FLOATING_POINT_PRECISION

          public static String FLOATING_POINT_PRECISION

    - #### PRINT_GPU_MEMORY_INFO

          public static boolean PRINT_GPU_MEMORY_INFO

    - #### EVICTION_SHADOW_BUFFER_MAX_BYTES

          public static long EVICTION_SHADOW_BUFFER_MAX_BYTES

    - #### EVICTION_SHADOW_BUFFER_CURR_BYTES

          public static long EVICTION_SHADOW_BUFFER_CURR_BYTES

    - #### GPU_MEMORY_UTILIZATION_FACTOR

          public static double GPU_MEMORY_UTILIZATION_FACTOR

    - #### GPU_MEMORY_ALLOCATOR

          public static String GPU_MEMORY_ALLOCATOR

    - #### LINEAGE

          public static boolean LINEAGE

    - #### LINEAGE_DEDUP

          public static boolean LINEAGE_DEDUP

    - #### LINEAGE_REUSE

          public static LineageCacheConfig.ReuseCacheType LINEAGE_REUSE

    - #### LINEAGE_POLICY

          public static LineageCacheConfig.LineageCachePolicy LINEAGE_POLICY

    - #### LINEAGE_ESTIMATE

          public static boolean LINEAGE_ESTIMATE

    - #### LINEAGE_DEBUGGER

          public static boolean LINEAGE_DEBUGGER

    - #### CHECK_PRIVACY

          public static boolean CHECK_PRIVACY

    - #### USE_ACCELERATOR

          public static boolean USE_ACCELERATOR

    - #### FORCE_ACCELERATOR

          public static boolean FORCE_ACCELERATOR

    - #### SYNCHRONIZE_GPU

          public static boolean SYNCHRONIZE_GPU

    - #### EAGER_CUDA_FREE

          public static boolean EAGER_CUDA_FREE

    - #### SEED

          public static int SEED

    - #### _suppressPrint2Stdout

          public static boolean _suppressPrint2Stdout

    - #### USE_LOCAL_SPARK_CONFIG

          public static boolean USE_LOCAL_SPARK_CONFIG

    - #### _activeAM

          public static boolean _activeAM

    - #### VALIDATOR_IGNORE_ISSUES

          public static boolean VALIDATOR_IGNORE_ISSUES

      If true, allow DMLProgram to be generated while not halting due to validation errors/warnings

    - #### _uuid

          public static String _uuid

  - ### Constructor Detail

    - #### DMLScript

          public DMLScript()

  - ### Method Detail

    - #### getUUID

          public static String getUUID()

    - #### setUUID

          public static void setUUID​(String uuid)

      Used to set master UUID on all nodes (in parfor remote, where DMLScript passed) in order to simplify cleanup of scratch_space and local working dirs.
      Parameters:
        `uuid` - master UUID to set on all nodes

    - #### suppressPrint2Stdout

          public static boolean suppressPrint2Stdout()

    - #### setActiveAM

          public static void setActiveAM()

    - #### isActiveAM

          public static boolean isActiveAM()

    - #### main

          public static void main​(String[] args)

      Main entry point for systemDS dml script execution
      Parameters:
        `args` - command-line arguments

    - #### executeScript

          public static boolean executeScript​(org.apache.hadoop.conf.Configuration conf,
                                              String[] args)
                                       throws IOException,
                                              ParseException,
                                              DMLScriptException

      Single entry point for all public invocation alternatives (e.g., main, executeScript, JaqlUdf etc)
      Parameters:
        `conf` - Hadoop configuration
        `args` - arguments
      Returns:
        true if success, false otherwise
      Throws:
        `IOException` - If an internal IOException happens.
        `ParseException`
        `DMLScriptException`

    - #### readDMLScript

          public static String readDMLScript​(boolean isFile,
                                             String scriptOrFilename)
                                      throws IOException

      Reads the DML/PyDML script into a String
      Parameters:
        `isFile` - Whether the string argument is a path to a file or the script itself
        `scriptOrFilename` - script or filename
      Returns:
        a string representation of the script
      Throws:
        `IOException` - if error

    - #### loadConfiguration

          public static void loadConfiguration​(String fnameOptConfig)
                                        throws IOException

      Throws:
        `IOException`

    - #### setGlobalFlags

          public static void setGlobalFlags​(DMLConfig dmlconf)

      Sets the global flags in DMLScript based on user provided configuration
      Parameters:
        `dmlconf` - user provided configuration

    - #### initHadoopExecution

          public static void initHadoopExecution​(DMLConfig config)
                                          throws IOException,
                                                 ParseException,
                                                 DMLRuntimeException

      Throws:
        `IOException`
        `ParseException`
        `DMLRuntimeException`

    - #### cleanupHadoopExecution

          public static void cleanupHadoopExecution​(DMLConfig config)
                                             throws IOException,
                                                    ParseException

      Throws:
        `IOException`
        `ParseException`

    - #### getGlobalExecMode

          public static Types.ExecMode getGlobalExecMode()

    - #### setGlobalExecMode

          public static void setGlobalExecMode​(Types.ExecMode mode)

    - #### errorPrint

          public static void errorPrint​(Exception e)

      Print the error in a user friendly manner.
      Parameters:
        `e` - The exception thrown.