Class FederationUtils
- java.lang.Object
-
- org.apache.sysds.runtime.controlprogram.federated.FederationUtils
-
public class FederationUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description FederationUtils()
-
Method Summary
-
-
-
Method Detail
-
resetFedDataID
public static void resetFedDataID()
-
getNextFedDataID
public static long getNextFedDataID()
-
checkFedMapType
public static void checkFedMapType(MatrixObject mo)
-
callInstruction
public static FederatedRequest callInstruction(String inst, CPOperand varOldOut, CPOperand[] varOldIn, long[] varNewIn, boolean rmFedOutFlag)
-
callInstruction
public static FederatedRequest callInstruction(String inst, CPOperand varOldOut, CPOperand[] varOldIn, long[] varNewIn)
-
callInstruction
public static FederatedRequest[] callInstruction(String[] inst, CPOperand varOldOut, CPOperand[] varOldIn, long[] varNewIn)
-
callInstruction
public static FederatedRequest[] callInstruction(String[] inst, CPOperand varOldOut, long outputId, CPOperand[] varOldIn, long[] varNewIn, Types.ExecType type)
-
callInstruction
public static FederatedRequest callInstruction(String inst, CPOperand varOldOut, long outputId, CPOperand[] varOldIn, long[] varNewIn, Types.ExecType type, boolean rmFedOutputFlag)
-
aggAdd
public static MatrixBlock aggAdd(Future<FederatedResponse>[] ffr)
-
aggMean
public static MatrixBlock aggMean(Future<FederatedResponse>[] ffr, FederationMap map)
-
getResults
public static MatrixBlock[] getResults(Future<FederatedResponse>[] ffr)
-
bind
public static MatrixBlock bind(Future<FederatedResponse>[] ffr, boolean cbind)
-
aggMinMax
public static MatrixBlock aggMinMax(Future<FederatedResponse>[] ffr, boolean isMin, boolean isScalar, Optional<FTypes.FType> fedType)
-
aggProd
public static MatrixBlock aggProd(Future<FederatedResponse>[] ffr, FederationMap fedMap, AggregateUnaryOperator aop)
-
aggMinMaxIndex
public static MatrixBlock aggMinMaxIndex(Future<FederatedResponse>[] ffr, boolean isMin, FederationMap map)
-
aggVar
public static MatrixBlock aggVar(Future<FederatedResponse>[] ffr, Future<FederatedResponse>[] meanFfr, FederationMap map, boolean isRowAggregate, boolean isScalar)
-
aggScalar
public static ScalarObject aggScalar(AggregateUnaryOperator aop, Future<FederatedResponse>[] ffr, Future<FederatedResponse>[] meanFfr, FederationMap map)
-
aggMatrix
public static MatrixBlock aggMatrix(AggregateUnaryOperator aop, Future<FederatedResponse>[] ffr, Future<FederatedResponse>[] meanFfr, FederationMap map)
-
waitFor
public static void waitFor(List<Future<FederatedResponse>> responses)
-
aggScalar
public static ScalarObject aggScalar(AggregateUnaryOperator aop, Future<FederatedResponse>[] ffr)
-
aggScalar
public static ScalarObject aggScalar(AggregateUnaryOperator aop, Future<FederatedResponse>[] ffr, FederationMap map)
-
aggBooleanScalar
public static boolean aggBooleanScalar(Future<FederatedResponse>[] tmp)
-
aggMatrix
public static MatrixBlock aggMatrix(AggregateUnaryOperator aop, Future<FederatedResponse>[] ffr, FederationMap map)
-
federateLocalData
public static FederationMap federateLocalData(CacheableData<?> data)
-
bindResponses
public static MatrixBlock bindResponses(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> readResponses, long[] dims) throws Exception
Bind data from federated workers based on non-overlapping federated ranges.- Parameters:
readResponses
- responses from federated workers containing the federated ranges and datadims
- dimensions of output MatrixBlock- Returns:
- MatrixBlock of consolidated data
- Throws:
Exception
- in case of problems with getting data from responses
-
aggregateResponses
public static MatrixBlock aggregateResponses(List<org.apache.commons.lang3.tuple.Pair<FederatedRange,Future<FederatedResponse>>> readResponses)
Aggregate partially aggregated data from federated workers by adding values with the same index in different federated locations.- Parameters:
readResponses
- responses from federated workers containing the federated data- Returns:
- MatrixBlock of consolidated, aggregated data
-
decoder
public static io.netty.handler.codec.serialization.ObjectDecoder decoder()
-
sumNonZeros
public static long sumNonZeros(Future<FederatedResponse>[] responses)
-
-