use of edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceStreamingFinalReceiver in project twister2 by DSC-SPIDAL.
the class MPIDataFlowAllReduce method init.
/**
* Initialize
* @param config
* @param t
* @param instancePlan
* @param edge
*/
public void init(Config config, MessageType t, TaskPlan instancePlan, int edge) {
this.type = t;
this.executor = instancePlan.getThisExecutor();
this.taskPlan = instancePlan;
this.executor = taskPlan.getThisExecutor();
broadcast = new MPIDataFlowBroadcast(channel, middleTask, destinations, new BCastReceiver(finalReceiver));
broadcast.init(config, t, instancePlan, broadCastEdge);
MessageReceiver receiver;
if (streaming) {
this.partialReceiver = new ReduceStreamingPartialReceiver(middleTask, reduceFunction);
receiver = new AllReduceStreamingFinalReceiver(reduceFunction, broadcast, middleTask);
} else {
this.partialReceiver = new ReduceBatchPartialReceiver(middleTask, reduceFunction);
receiver = new AllReduceBatchFinalReceiver(reduceFunction, broadcast);
}
reduce = new MPIDataFlowReduce(channel, sources, middleTask, receiver, partialReceiver);
reduce.init(config, t, instancePlan, reduceEdge);
}
Aggregations