Search in sources :

Example 16 with GeneralPartUpdateParam

use of com.tencent.angel.ml.matrix.psf.update.base.GeneralPartUpdateParam in project angel by Tencent.

the class LongKeysUpdateParam method split.

@Override
public List<PartitionUpdateParam> split() {
    MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
    PartitionKey[] parts = meta.getPartitionKeys();
    KeyValuePart[] splits = RouterUtils.split(meta, 0, nodeIds, neighbors);
    assert parts.length == splits.length;
    List<PartitionUpdateParam> partParams = new ArrayList<>(parts.length);
    for (int i = 0; i < parts.length; i++) {
        if (splits[i] != null && splits[i].size() > 0) {
            partParams.add(new GeneralPartUpdateParam(matrixId, parts[i], splits[i]));
        }
    }
    return partParams;
}
Also used : MatrixMeta(com.tencent.angel.ml.matrix.MatrixMeta) PartitionUpdateParam(com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam) ArrayList(java.util.ArrayList) GeneralPartUpdateParam(com.tencent.angel.ml.matrix.psf.update.base.GeneralPartUpdateParam) PartitionKey(com.tencent.angel.PartitionKey) KeyValuePart(com.tencent.angel.psagent.matrix.transport.router.KeyValuePart)

Aggregations

GeneralPartUpdateParam (com.tencent.angel.ml.matrix.psf.update.base.GeneralPartUpdateParam)16 ServerLongAnyRow (com.tencent.angel.ps.storage.vector.ServerLongAnyRow)12 IElement (com.tencent.angel.ps.storage.vector.element.IElement)12 ILongKeyAnyValuePartOp (com.tencent.angel.psagent.matrix.transport.router.operator.ILongKeyAnyValuePartOp)12 GraphNode (com.tencent.angel.graph.data.GraphNode)7 PartitionKey (com.tencent.angel.PartitionKey)4 MatrixMeta (com.tencent.angel.ml.matrix.MatrixMeta)4 PartitionUpdateParam (com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam)4 KeyValuePart (com.tencent.angel.psagent.matrix.transport.router.KeyValuePart)4 ArrayList (java.util.ArrayList)4 DynamicNeighborElement (com.tencent.angel.graph.model.neighbor.dynamic.DynamicNeighborElement)1 LongArrayElement (com.tencent.angel.ps.storage.vector.element.LongArrayElement)1