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;
}
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;
}
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;
}
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;
}
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);
}
Aggregations