use of edu.iu.dsc.tws.graphapi.partition.GraphDataSource in project twister2 by DSC-SPIDAL.
the class SingleSourceShortestPathWorker method buildDataPointsTG.
public static ComputeGraph buildDataPointsTG(String dataDirectory, int dsize, int parallelismValue, String soruceVertex, Config conf) {
GraphDataSource dataObjectSource = new GraphDataSource(Context.TWISTER2_DIRECT_EDGE, dataDirectory, dsize);
GraphDataCompute graphDataCompute = new GraphDataCompute(Context.TWISTER2_DIRECT_EDGE, dsize, parallelismValue, soruceVertex);
GraphDataSink graphDataSink = new GraphDataSink("PartitionSink");
ComputeGraphBuilder datapointsTaskGraphBuilder = ComputeGraphBuilder.newBuilder(conf);
// Add source, compute, and sink tasks to the task graph builder for the first task graph
datapointsTaskGraphBuilder.addSource("Graphdatasource", dataObjectSource, parallelismValue);
ComputeConnection datapointComputeConnection = datapointsTaskGraphBuilder.addCompute("Graphdatacompute", graphDataCompute, parallelismValue);
ComputeConnection firstGraphComputeConnection = datapointsTaskGraphBuilder.addCompute("Graphdatasink", graphDataSink, parallelismValue);
// Creating the communication edges between the tasks for the second task graph
datapointComputeConnection.direct("Graphdatasource").viaEdge(Context.TWISTER2_DIRECT_EDGE).withDataType(MessageTypes.OBJECT);
firstGraphComputeConnection.direct("Graphdatacompute").viaEdge(Context.TWISTER2_DIRECT_EDGE).withDataType(MessageTypes.OBJECT);
datapointsTaskGraphBuilder.setMode(OperationMode.BATCH);
datapointsTaskGraphBuilder.setTaskGraphName("datapointsTG");
// Build the first taskgraph
return datapointsTaskGraphBuilder.build();
}
Aggregations