use of edu.iu.dsc.tws.api.compute.nodes.ICompute in project twister2 by DSC-SPIDAL.
the class BTAllGatherExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelism = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
MessageType dataType = MessageTypes.INTEGER_ARRAY;
String edge = "edge";
ISource g = new SourceTask(edge);
ICompute r = new AllGatherSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.allgather(SOURCE).viaEdge(edge).withDataType(dataType);
return computeGraphBuilder;
}
use of edu.iu.dsc.tws.api.compute.nodes.ICompute in project twister2 by DSC-SPIDAL.
the class BTBroadCastExample method buildTaskGraph.
@Override
public ComputeGraphBuilder buildTaskGraph() {
List<Integer> taskStages = jobParameters.getTaskStages();
int sourceParallelism = taskStages.get(0);
int sinkParallelism = taskStages.get(1);
String edge = "edge";
BaseSource g = new SourceTask(edge);
ICompute r = new BroadcastSinkTask();
computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
computeConnection.broadcast(SOURCE).viaEdge(edge);
return computeGraphBuilder;
}
Aggregations