Package org.apache.sysds.hops.fedplanner
Class FederatedPlannerUtils
- java.lang.Object
-
- org.apache.sysds.hops.fedplanner.FederatedPlannerUtils
-
public class FederatedPlannerUtils extends Object
Utility class for federated planners.
-
-
Constructor Summary
Constructors Constructor Description FederatedPlannerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Hop>
getParamMap(FunctionOp funcOp)
Return parameter map containing the mapping from parameter name to input hop for all parameters of the function hop.static ArrayList<Hop>
getTransientInputs(Hop currentHop, Map<String,Hop> paramMap, Map<String,Hop> transientWrites, LocalVariableMap localVariableMap)
Get transient inputs from either paramMap or transientWrites.static void
mapFunctionOutputs(FunctionOp sbHop, FunctionStatement funcStatement, Map<String,Hop> transientWrites)
Saves the HOPs (TWrite) of the function return values for the variable name used when calling the function.
-
-
-
Method Detail
-
getTransientInputs
public static ArrayList<Hop> getTransientInputs(Hop currentHop, Map<String,Hop> paramMap, Map<String,Hop> transientWrites, LocalVariableMap localVariableMap)
Get transient inputs from either paramMap or transientWrites. Inputs from paramMap has higher priority than inputs from transientWrites.- Parameters:
currentHop
- hop for which inputs are read from mapsparamMap
- of local parameterstransientWrites
- map of transient writeslocalVariableMap
- map of local variables- Returns:
- inputs of currentHop
-
getParamMap
public static Map<String,Hop> getParamMap(FunctionOp funcOp)
Return parameter map containing the mapping from parameter name to input hop for all parameters of the function hop.- Parameters:
funcOp
- hop for which the mapping of parameter names to input hops are made- Returns:
- parameter map or empty map if function has no parameters
-
mapFunctionOutputs
public static void mapFunctionOutputs(FunctionOp sbHop, FunctionStatement funcStatement, Map<String,Hop> transientWrites)
Saves the HOPs (TWrite) of the function return values for the variable name used when calling the function. Example:f = function() return (matrix[double] model) {a = rand(1, 1);} b = f();
This function saves the HOP writing toa
for identifierb
.- Parameters:
sbHop
- TheFunctionOp
for the callfuncStatement
- TheFunctionStatement
of the called functiontransientWrites
- map of transient writes
-
-