Package org.apache.sysds.resource
Class ResourceCompiler
java.lang.Object
org.apache.sysds.resource.ResourceCompiler
This class does full or partial program recompilation
based on given runtime program. It uses the methods provided
by
hops.recompile.Recompiler).
It keeps a state of the current recompilation phase in order
to decide when to do full recompilation and when not.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final intstatic final longstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Programstatic Programstatic ProgramdoFullRecompilation(Program program) Recompiling a given program for resource optimization.static voidreplaceFilename(DMLProgram dmlp, HashMap<String, String> replaceVars) static voidsetSingleNodeResourceConfigs(long nodeMemory, int nodeCores) Sets resource configurations for executions in single-node mode including the hardware configurations for the node running the CP.static voidsetSparkClusterResourceConfigs(long driverMemory, int driverCores, int numExecutors, long executorMemory, int executorCores) Sets resource configurations for executions in hybrid mode including the hardware configurations for the node running the CP and the worker nodes running Spark executors
-
Field Details
-
DEFAULT_DRIVER_MEMORY
public static final long DEFAULT_DRIVER_MEMORY- See Also:
-
DEFAULT_DRIVER_THREADS
public static final int DEFAULT_DRIVER_THREADS- See Also:
-
DEFAULT_EXECUTOR_MEMORY
public static final long DEFAULT_EXECUTOR_MEMORY- See Also:
-
DEFAULT_EXECUTOR_THREADS
public static final int DEFAULT_EXECUTOR_THREADS- See Also:
-
DEFAULT_NUMBER_EXECUTORS
public static final int DEFAULT_NUMBER_EXECUTORS- See Also:
-
-
Constructor Details
-
ResourceCompiler
public ResourceCompiler()
-
-
Method Details
-
compile
- Throws:
IOException
-
compile
public static Program compile(String filePath, Map<String, String> args, HashMap<String, throws IOExceptionString> replaceVars) - Throws:
IOException
-
replaceFilename
-
doFullRecompilation
Recompiling a given program for resource optimization. This method should always be called after setting the target resources toInfrastructureAnalyzerandSparkExecutionContext- Parameters:
program- program to be recompiled- Returns:
- the recompiled program as a new
Programinstance
-
setSingleNodeResourceConfigs
public static void setSingleNodeResourceConfigs(long nodeMemory, int nodeCores) Sets resource configurations for executions in single-node mode including the hardware configurations for the node running the CP.- Parameters:
nodeMemory- memory budget for the node running CPnodeCores- number of CPU cores for the node running CP
-
setSparkClusterResourceConfigs
public static void setSparkClusterResourceConfigs(long driverMemory, int driverCores, int numExecutors, long executorMemory, int executorCores) Sets resource configurations for executions in hybrid mode including the hardware configurations for the node running the CP and the worker nodes running Spark executors- Parameters:
driverMemory- memory budget for the node running CPdriverCores- number of CPU cores for the node running CPnumExecutors- number of nodes in clusterexecutorMemory- memory budget for the nodes running executorsexecutorCores- number of CPU cores for the nodes running executors
-