Search in sources :

Example 1 with AllReduceBatchFinalReceiver

use of edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceBatchFinalReceiver 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);
}
Also used : MessageReceiver(edu.iu.dsc.tws.comms.api.MessageReceiver) AllReduceStreamingFinalReceiver(edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceStreamingFinalReceiver) ReduceBatchPartialReceiver(edu.iu.dsc.tws.comms.mpi.io.reduce.ReduceBatchPartialReceiver) ReduceStreamingPartialReceiver(edu.iu.dsc.tws.comms.mpi.io.reduce.ReduceStreamingPartialReceiver) AllReduceBatchFinalReceiver(edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceBatchFinalReceiver)

Aggregations

MessageReceiver (edu.iu.dsc.tws.comms.api.MessageReceiver)1 AllReduceBatchFinalReceiver (edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceBatchFinalReceiver)1 AllReduceStreamingFinalReceiver (edu.iu.dsc.tws.comms.mpi.io.allreduce.AllReduceStreamingFinalReceiver)1 ReduceBatchPartialReceiver (edu.iu.dsc.tws.comms.mpi.io.reduce.ReduceBatchPartialReceiver)1 ReduceStreamingPartialReceiver (edu.iu.dsc.tws.comms.mpi.io.reduce.ReduceStreamingPartialReceiver)1