Search in sources :

Example 11 with BaseSource

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

the class BTKeyedReduceExample method buildTaskGraph.

@Override
public ComputeGraphBuilder buildTaskGraph() {
    List<Integer> taskStages = jobParameters.getTaskStages();
    int sourceParallelsim = taskStages.get(0);
    int sinkParallelism = taskStages.get(1);
    Op operation = Op.SUM;
    MessageType keyType = MessageTypes.INTEGER;
    MessageType dataType = MessageTypes.INTEGER_ARRAY;
    String edge = "edge";
    BaseSource g = new SourceTask(edge, true);
    ICompute r = new KeyedReduceSinkTask();
    computeGraphBuilder.addSource(SOURCE, g, sourceParallelsim);
    computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
    computeConnection.keyedReduce(SOURCE).viaEdge(edge).withOperation(operation, dataType).withKeyType(keyType);
    return computeGraphBuilder;
}
Also used : Op(edu.iu.dsc.tws.api.comms.Op) BaseSource(edu.iu.dsc.tws.api.compute.nodes.BaseSource) ICompute(edu.iu.dsc.tws.api.compute.nodes.ICompute) MessageType(edu.iu.dsc.tws.api.comms.messaging.types.MessageType)

Example 12 with BaseSource

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

the class STBroadCastExample 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);
    computeGraphBuilder.addCompute(SINK, r, sinkParallelism).broadcast(SOURCE).viaEdge(edge).withDataType(MessageTypes.INTEGER_ARRAY);
    return computeGraphBuilder;
}
Also used : BaseSource(edu.iu.dsc.tws.api.compute.nodes.BaseSource) ICompute(edu.iu.dsc.tws.api.compute.nodes.ICompute)

Example 13 with BaseSource

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

the class STKeyedGatherExample method buildTaskGraph.

@Override
public ComputeGraphBuilder buildTaskGraph() {
    List<Integer> taskStages = jobParameters.getTaskStages();
    int sourceParallelism = taskStages.get(0);
    int sinkParallelism = taskStages.get(1);
    MessageType keyType = MessageTypes.INTEGER;
    MessageType dataType = MessageTypes.INTEGER_ARRAY;
    String edge = "edge";
    BaseSource g = new SourceTask(edge, true);
    ICompute r = new KeyedGatherSinkTask();
    computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
    computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
    computeConnection.keyedGather(SOURCE).viaEdge(edge).withKeyType(keyType).withDataType(dataType);
    return computeGraphBuilder;
}
Also used : BaseSource(edu.iu.dsc.tws.api.compute.nodes.BaseSource) ICompute(edu.iu.dsc.tws.api.compute.nodes.ICompute) MessageType(edu.iu.dsc.tws.api.comms.messaging.types.MessageType)

Example 14 with BaseSource

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

the class STReduceExample 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 ReduceSinkTask();
    computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
    computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
    computeConnection.reduce(SOURCE).viaEdge(edge).withOperation(Op.SUM, MessageTypes.INTEGER_ARRAY);
    return computeGraphBuilder;
}
Also used : BaseSource(edu.iu.dsc.tws.api.compute.nodes.BaseSource) ICompute(edu.iu.dsc.tws.api.compute.nodes.ICompute)

Example 15 with BaseSource

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

the class BTDirectExample 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";
    BaseSource g = new SourceTask(edge);
    ICompute r = new PartitionSinkTask();
    computeGraphBuilder.addSource(SOURCE, g, sourceParallelism);
    computeConnection = computeGraphBuilder.addCompute(SINK, r, sinkParallelism);
    computeConnection.direct(SOURCE).viaEdge(edge).withDataType(dataType);
    return computeGraphBuilder;
}
Also used : BaseSource(edu.iu.dsc.tws.api.compute.nodes.BaseSource) ICompute(edu.iu.dsc.tws.api.compute.nodes.ICompute) MessageType(edu.iu.dsc.tws.api.comms.messaging.types.MessageType)

Aggregations

BaseSource (edu.iu.dsc.tws.api.compute.nodes.BaseSource)20 ICompute (edu.iu.dsc.tws.api.compute.nodes.ICompute)19 MessageType (edu.iu.dsc.tws.api.comms.messaging.types.MessageType)13 Op (edu.iu.dsc.tws.api.comms.Op)2 TaskPartitioner (edu.iu.dsc.tws.api.compute.TaskPartitioner)2 JobConfig (edu.iu.dsc.tws.api.JobConfig)1 ExecutionPlan (edu.iu.dsc.tws.api.compute.executor.ExecutionPlan)1 ComputeGraph (edu.iu.dsc.tws.api.compute.graph.ComputeGraph)1 Config (edu.iu.dsc.tws.api.config.Config)1 BenchmarkResultsRecorder (edu.iu.dsc.tws.examples.utils.bench.BenchmarkResultsRecorder)1 DeterministicTaskPartitioner (edu.iu.dsc.tws.examples.utils.partitioners.DeterministicTaskPartitioner)1 ComputeEnvironment (edu.iu.dsc.tws.task.ComputeEnvironment)1 ComputeGraphBuilder (edu.iu.dsc.tws.task.impl.ComputeGraphBuilder)1 KeyedGatherConfig (edu.iu.dsc.tws.task.impl.ops.KeyedGatherConfig)1 HashingPartitioner (edu.iu.dsc.tws.tset.fn.HashingPartitioner)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Set (java.util.Set)1