Search in sources :

Example 1 with Edge

use of edu.iu.dsc.tws.api.compute.graph.Edge in project twister2 by DSC-SPIDAL.

the class JoinConfig method connect.

public ComputeConnection connect() {
    Edge leftEdge = this.buildEdge();
    leftEdge.setEdgeIndex(0);
    leftEdge.setNumberOfEdges(2);
    Edge rightEdge = this.buildRightEdge();
    rightEdge.setEdgeIndex(1);
    rightEdge.setNumberOfEdges(2);
    rightEdge.setMessageSchema(this.rightMessageSchema);
    // we generate the name
    if (group == null) {
        group = edgeName + "-" + rightEdgeName + "-" + source + "-" + rightSource;
    }
    leftEdge.setTargetEdge(group);
    rightEdge.setTargetEdge(group);
    ComputeConnectionUtils.connectEdge(this.computeConnection, this.source, leftEdge);
    ComputeConnectionUtils.connectEdge(this.computeConnection, this.rightSource, rightEdge);
    return this.computeConnection;
}
Also used : Edge(edu.iu.dsc.tws.api.compute.graph.Edge)

Example 2 with Edge

use of edu.iu.dsc.tws.api.compute.graph.Edge in project twister2 by DSC-SPIDAL.

the class JoinConfig method buildRightEdge.

Edge buildRightEdge() {
    Edge edge = new Edge(this.rightEdgeName, this.operationName);
    edge.setDataType(rightOpDataType);
    edge.addProperties(propertiesMap);
    edge.setMessageSchema(this.rightMessageSchema);
    updateEdge(edge);
    edge.setKeyed(true);
    edge.setKeyType(opKeyType);
    edge.setPartitioner(this.tPartitioner);
    return edge;
}
Also used : Edge(edu.iu.dsc.tws.api.compute.graph.Edge)

Example 3 with Edge

use of edu.iu.dsc.tws.api.compute.graph.Edge in project twister2 by DSC-SPIDAL.

the class AllReduceTLink method getEdge.

@Override
public Edge getEdge() {
    Edge e = new Edge(getId(), OperationNames.ALLREDUCE, this.getSchema().getDataType(), reduceFn);
    TLinkUtils.generateCommsSchema(getSchema(), e);
    return e;
}
Also used : Edge(edu.iu.dsc.tws.api.compute.graph.Edge)

Example 4 with Edge

use of edu.iu.dsc.tws.api.compute.graph.Edge in project twister2 by DSC-SPIDAL.

the class DirectTLink method getEdge.

@Override
public Edge getEdge() {
    Edge e = new Edge(getId(), OperationNames.DIRECT, this.getSchema().getDataType());
    e.addProperty(CommunicationContext.USE_DISK, this.useDisk);
    TLinkUtils.generateCommsSchema(getSchema(), e);
    return e;
}
Also used : Edge(edu.iu.dsc.tws.api.compute.graph.Edge)

Example 5 with Edge

use of edu.iu.dsc.tws.api.compute.graph.Edge in project twister2 by DSC-SPIDAL.

the class JoinTLink method buildJoin.

private void buildJoin(GraphBuilder graphBuilder, TBase s, TBase t, int idx, String groupName, MessageType kType, MessageType dType, boolean lengthsSpecified, int keyLength, int totalLength) {
    Edge e = new Edge(getId(), OperationNames.JOIN, dType);
    // override edge name with join_source_target
    e.setName(e.getName() + "_" + s.getId() + "_" + t.getId());
    e.setKeyed(true);
    e.setPartitioner(partitioner);
    e.setEdgeIndex(idx);
    e.setNumberOfEdges(2);
    e.setTargetEdge(groupName);
    e.addProperty(CommunicationContext.JOIN_TYPE, joinType);
    e.addProperty(CommunicationContext.JOIN_ALGORITHM, algorithm);
    e.addProperty(CommunicationContext.KEY_COMPARATOR, keyComparator);
    e.addProperty(CommunicationContext.USE_DISK, useDisk);
    e.setKeyType(kType);
    if (lengthsSpecified) {
        e.setMessageSchema(MessageSchema.ofSize(totalLength, keyLength));
    } else {
        TLinkUtils.generateCommsSchema(e);
    }
    graphBuilder.connect(s.getId(), t.getId(), e);
}
Also used : Edge(edu.iu.dsc.tws.api.compute.graph.Edge)

Aggregations

Edge (edu.iu.dsc.tws.api.compute.graph.Edge)32 HashSet (java.util.HashSet)2 HashBasedTable (com.google.common.collect.HashBasedTable)1 Table (com.google.common.collect.Table)1 CheckpointingClient (edu.iu.dsc.tws.api.checkpointing.CheckpointingClient)1 Communicator (edu.iu.dsc.tws.api.comms.Communicator)1 LogicalPlan (edu.iu.dsc.tws.api.comms.LogicalPlan)1 ExecutionPlan (edu.iu.dsc.tws.api.compute.executor.ExecutionPlan)1 ExecutorContext (edu.iu.dsc.tws.api.compute.executor.ExecutorContext)1 IExecutionPlanBuilder (edu.iu.dsc.tws.api.compute.executor.IExecutionPlanBuilder)1 INodeInstance (edu.iu.dsc.tws.api.compute.executor.INodeInstance)1 IParallelOperation (edu.iu.dsc.tws.api.compute.executor.IParallelOperation)1 ComputeGraph (edu.iu.dsc.tws.api.compute.graph.ComputeGraph)1 OperationMode (edu.iu.dsc.tws.api.compute.graph.OperationMode)1 Vertex (edu.iu.dsc.tws.api.compute.graph.Vertex)1 ICompute (edu.iu.dsc.tws.api.compute.nodes.ICompute)1 INode (edu.iu.dsc.tws.api.compute.nodes.INode)1 ISource (edu.iu.dsc.tws.api.compute.nodes.ISource)1 TaskInstancePlan (edu.iu.dsc.tws.api.compute.schedule.elements.TaskInstancePlan)1 TaskSchedulePlan (edu.iu.dsc.tws.api.compute.schedule.elements.TaskSchedulePlan)1